Skip to Content
🚧 This is WIP documentation for v4 of the plugin. For v3 click here.
ESLGraphQL-ESLint
Rulesrequire-nullable-fields-with-oneof

require-nullable-fields-with-oneof

  • Category: Schema
  • Rule name: @graphql-eslint/require-nullable-fields-with-oneof
  • Requires GraphQL Schema: false ℹ️
  • Requires GraphQL Operations: false ℹ️
Require `input` or `type` fields to be non-nullable with `@oneOf` directive.

Usage Examples

Incorrect

# eslint @graphql-eslint/require-nullable-fields-with-oneof: 'error'
 
input Input @oneOf {
  foo: String!
  b: Int
}

Correct

# eslint @graphql-eslint/require-nullable-fields-with-oneof: 'error'
 
input Input @oneOf {
  foo: String
  bar: Int
}

Resources

Last updated on