Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (21 loc) · 787 Bytes

File metadata and controls

29 lines (21 loc) · 787 Bytes

Mutations must return unique input types (mutations-inputs-unique)

All mutations must return a unique input type

Rule Details

Best practice is to have a unique Input type for every mutation. This allows us to modify any mutation input without worrying about breaking others.

Autofixer not available.

Examples of incorrect code for this rule:

type Mutation {
  sampleMutation(input: SampleMutationInput!): SampleMutationPayload
  secondMutation(input: SampleMutationInput!): SecondMutationPayload
}

Examples of correct code for this rule:

type Mutation {
  sampleMutation(input: SampleMutationInput!): SampleMutationPayload
  secondMutation(input: SecondMutationInput!): SecondMutationPayload
  arglessMutation: ThirdMutationPayload
}