Skip to content

@oneOf handles non-null inputs #3353

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

Conversation

felipe-gdr
Copy link
Member

@felipe-gdr felipe-gdr commented Oct 20, 2023

Non-null inputs are not going through @oneOf validation.

For example, the query bellow will not blow up, even though both fields under the oneOf type are being passed.

  # schema
  type Query {
    search(by: SearchInput!): String
  }
  input SearchInput @oneOf {
    name: String
    id: ID
  }

  # query
  query myQuery {
    search(by: {name: "Figaro", id: "1001"})
  }

@felipe-gdr felipe-gdr marked this pull request as draft October 20, 2023 05:20
@dondonz
Copy link
Member

dondonz commented Oct 20, 2023

Nice! Thanks

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

Successfully merging this pull request may close these issues.

3 participants