ComputedMutationInput type

Mutation input written with computed property names, such as { [field]: value }, whose keys TypeScript cannot list. The input is accepted when its literal keys exist on TShape and its relationship values include their key. Because the computed keys are unknown, the mutation result is typed from TShape instead of the input.

type ComputedMutationInput<TInput, TShape> = TInput &
  (string extends UnionKeys<TInput>
    ? [
        | KnownExtraMutationKeys<TInput, TShape>
        | InvalidMutationRelationshipKeys<TInput>
      ] extends [never]
      ? TShape
      : never
    : never)