contrib icon indicating copy to clipboard operation
contrib copied to clipboard

Override Type name for mutation input types

Open ysaakpr opened this issue 2 years ago • 0 comments

This PR allows to define override the graphql types in the CreateNodeInput and UpdateNodeInput inputs.

As of now, if the Type is defined using entgql.Type annotation, the only option would be to represent the model as a scalar type, without an option to define a custom type for type and inputs in graphql. Since as per GraphQL spec both type and input types are two distinct types, it will be better to override these fields with different type names in the annotation.

Another option would be to skip the entity field creation on mutations, and override the behaviour with new field and field type. But the process is more complicated than a simple switch like this.

ysaakpr avatar Jul 16 '23 04:07 ysaakpr