Type alias GeneratedMutation<InputType, OutputType>

GeneratedMutation<InputType, OutputType>: string & {
    __generatedMutationInput: InputType;
    __generatedMutationOutput: OutputType;
}

Nominal type for branding generated graphql mutation operation strings with input and output types.

E.g.,

export const createWidget = `...` as GeneratedQuery<
CreateWidgetMutationVariables,
CreateWidgetMutation
>;

This allows graphql() to extract InputType and OutputType to correctly assign types to the variables and result objects.

Type Parameters

  • InputType

  • OutputType

Type declaration