Skip to content

[GraphQL] Custom Operations #2755

@lukasluecke

Description

@lukasluecke

I'd like to open a discussion on the future potential for custom GraphQL operations beyond what's currently possible with #2445 and #2447 (and the minor changes afterwards).

Naming
Currently the only way to name operations is to specify a name that will get suffixed by the resource name. It would be nice to have a bit more control about this, maybe with a token for the resource name? E.g. create${Resource}Custom

Arguments
Currently the following methods exist:

  • Choose specific fields from resource (denormalization_context)
  • Use different class (input)
  • Remove default arguments (args={})

It would be nice to be able to specify custom fields with types inline (I think @alanpoulain mentioned something about this once).

In the meantime maybe we could at least enable changing the nullability of existing fields per operation, e.g. the id field. (#2738, but customizable)

Result
Currently the following methods exist:

  • Choose specific fields from resource (normalization_context)
  • Use different class (output)

Setting output does not seem to work at the moment (#2754). Might be enough for now to fix this.

Otherwise the same options for custom fields and types as in the arguments would be nice to have.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions