You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to able to assert that a field on an input is optional, but not nullable (so I can do a partial update of an entity). GraphQL has no such syntax so I was hoping I could use this dirctive for that.
Not possible with GraphQL itself (graphql/graphql-spec#476) but might be possible to support via a directive. However, I'm not sure it fits in with this library; happy to be challenged though.
I personally think this definitely fits into the goals of this library. The problem space here is an old one. If you're providing inputs (type fields, not mutation parameters) that are optional, you need to be able to say "if provided, this field cannot be null." GraphQL does not currently distinguish between "required" and "non-nullable". That sure feels like an input constraint to me.
If you're providing inputs (type fields, not mutation parameters) that are optional, you need to be able to say "if provided, this field cannot be null."
This is a very common use case for partial updates that include fields that should not be set to explicit null. Leaving field out of partial update is fine though and leaves the field untouched.
I would like to able to assert that a field on an input is optional, but not nullable (so I can do a partial update of an entity). GraphQL has no such syntax so I was hoping I could use this dirctive for that.
Something like:
Is this possible?
The text was updated successfully, but these errors were encountered: