Skip to content

Conversation

tyranron
Copy link
Member

@tyranron tyranron commented Oct 9, 2025

Resolves #1062
Part of #1347

Synopsis

GraphQL spec September 2025 supports @oneOf directive on input objects:

OneOf Input Objects are a special variant of Input Objects where the type system asserts that exactly one of the fields must be set and non-null, all others being omitted. This is represented in introspection with the __Type.isOneOf: Boolean field, and in SDL via the @oneOf directive on the input object.

input UserBy @oneOf {
  id: ID
  email: String
  username: String
  registrationNumber: Int
}
type Query {
  user(by: UserBy!): User
}

Solution

  • Add @oneOf directive to introspection schema
  • Add __Type.isOneOf field to introspection schema
  • Support placing @oneOf directive to the correct place
  • Support enums in derive(GraphQLInputObject) macro

Checklist

  • Docs are added
  • Tests are added
  • CHANGELOG entry is added

@tyranron tyranron added this to the 0.18.0 milestone Oct 9, 2025
@tyranron tyranron self-assigned this Oct 9, 2025
@tyranron tyranron mentioned this pull request Oct 9, 2025
23 tasks
@tyranron tyranron added enhancement Improvement of existing features or bugfix k::api Related to API (application interface) feature New feature or request labels Oct 9, 2025
@tyranron tyranron added the k::design Related to overall design and/or architecture label Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix feature New feature or request k::api Related to API (application interface) k::design Related to overall design and/or architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL spec September 2025 Support of the @OneOf Input Object feature
1 participant