require-field-of-type-query-in-mutation-result
- Category: Schema
- Rule name: @graphql-eslint/require-field-of-type-query-in-mutation-result
- Requires GraphQL Schema: trueℹ️
- Requires GraphQL Operations: falseℹ️
Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application.
Currently, no errors are reported for result type
union,interfaceandscalar.
Usage Examples
Incorrect
# eslint @graphql-eslint/require-field-of-type-query-in-mutation-result: 'error'
 
type User { ... }
 
type Mutation {
  createUser: User!
}Correct
# eslint @graphql-eslint/require-field-of-type-query-in-mutation-result: 'error'
 
type User { ... }
 
type Query { ... }
 
type CreateUserPayload {
  user: User!
  query: Query!
}
 
type Mutation {
  createUser: CreateUserPayload!
}Resources
Last updated on