All mutations must return a nullable type with the suffix Payload
.
Best practice is to have a unique Payload
type for every mutation. This allows us to add new fields to a mutation
response without breaking the API.
Autofixer not available.
Examples of incorrect code for this rule:
type Mutation {
sampleMutation: Int
}
type Mutation {
sampleMutation: SampleMutationPayload!
}
type Mutation {
sampleMutation: [SampleMutationPayload]
}
Examples of correct code for this rule:
type Mutation {
sampleMutation: SampleMutationPayload
}
If you have a mutation that you're sure will never need to change.