Skip to content
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

Non-nullable fields on an input object type #9960

Closed
joelterry-promenade opened this issue May 4, 2024 · 4 comments
Closed

Non-nullable fields on an input object type #9960

joelterry-promenade opened this issue May 4, 2024 · 4 comments

Comments

@joelterry-promenade
Copy link

Is your feature request related to a problem? Please describe.

throw new Error(
'Fields on an input object type can not be non-nullable. It seems like the schema was not validated.'
);

Is this part of the GraphQL spec or is it an opinion? Would there be a lot of pushback to removing this check?

Describe the solution you'd like

Remove this check.

Describe alternatives you've considered

No response

Is your feature request related to a problem? Please describe.

No response

@lars250698
Copy link

I'm not sure about this check either. Non-Nullable fields on input objects seem to be allowed in the spec, there are even examples of it in the spec. I don't get the reason of this check.

@eddeee888
Copy link
Collaborator

eddeee888 commented Feb 18, 2025

Hello,

This is in the context of @oneOf directive. Here's the condition.

When said directive is used, the fields cannot be non-nullable. In this case, I believe this is correct.
Here's a relevant proposal and blog post

@lars250698
Copy link

That makes a lot of sense, thanks for clarifying!

@joelterry-promenade
Copy link
Author

@eddeee888 Ah sorry for the misunderstanding, thanks for clearing that up!

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

No branches or pull requests

3 participants