Skip to content

Support 'OneOf Input Objects' from new GraphQL Spec(September 2025 Edition) #3687

@toy0605

Description

@toy0605

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

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

Description

The September 2025 Edition of the GraphQL Specification has been released,
and a new feature(OneOf Input Objects) has been officially introduced.

However, it requires discussion on how this should be implemented and exposed for usage.

Adapter support status

Describe the solution you'd like

This is just a suggestion and should be open for discussion.

Suggestion example

// New `isOneOf` property
@InputType({ isOneOf: true })
export class UserByInput {
  @Field(type => ID)
  id: string;

  @Field(type => String)
  email: string;

  @Field(type => String)
  username: string;
}

@Resolver(of => User)
export class UserResolver {
  @Query(type => User)
  user(@Args("by") by: UserByInput) {
    // ...
  }
}
input UserByInput @oneOf {
  id: ID
  email: String
  username: String
}

type Query {
  user(by: UserByInput!): User
}

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

New GraphQL Specification

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions