GeneratedQuery<InputType, OutputType>: string & {
    __generatedQueryInput: InputType;
    __generatedQueryOutput: OutputType;
}

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

E.g.,

export const getWidget = `...` as GeneratedQuery<
GetWidgetQueryVariables,
GetWidgetQuery
>;

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

Type Parameters

  • InputType

  • OutputType

Type declaration