- Category:
Schema
- Rule name:
@graphql-eslint/no-root-type
- Requires GraphQL Schema:
true
ℹ️ - Requires GraphQL Operations:
false
ℹ️
Disallow using root types mutation
and/or subscription
.
# eslint @graphql-eslint/no-root-type: ['error', { disallow: ['mutation', 'subscription'] }]
type Mutation {
createUser(input: CreateUserInput!): User!
}
# eslint @graphql-eslint/no-root-type: ['error', { disallow: ['mutation', 'subscription'] }]
type Query {
users: [User!]!
}
The schema defines the following properties:
The elements of the array can contain the following enum values:
mutation
subscription
Additional restrictions:
- Minimum items:
1
- Unique items:
true