Skip to content

Remove non-null restriction on clientMutationId field definitions. #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2016

Conversation

dylanahsmith
Copy link
Contributor

@dylanahsmith dylanahsmith commented Apr 25, 2016

Problem

I would like to define a relay compatible graphql server without imposing needless restrictions on the schema like requiring clients to send a clientMutationId in requests and ask for a clientMutationId field in the mutation payload.

graphql-relay-js defines these fields as non-null, but Relay Input Object Mutations Specification only says that they may be non-null.

I would also like to remove the need to even have the clientMutationId as part of the relay spec entirely, since there is no reason why the client should need to send it over the network, as shown in facebook/relay#1083. However, making that transition on the relay client would require the server to first make the clientMutationId field nullable so the client can stop sending it.

Solution

Remove the non-null constraint on clientMutationId in the mutation input object type and payload object type.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.782% when pulling f2aee93 on dylanahsmith:optional-client-mutation-id into 7e58a89 on graphql:master.

@wincent
Copy link
Contributor

wincent commented Aug 29, 2016

Looks reasonable, based on the discussion in facebook/relay#1083. Thanks for this, and sorry for the delay in getting to it. Will merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants