Type Alias AppSyncDocument<TData, TVariables>

AppSyncDocument: string | DocumentNode | TypedDocumentNode<TData, TVariables>

A GraphQL request document — either:

  • a plain string ('query { me { id } }'), in which case the response shape is whatever you say it is via the generic parameter to AppSyncClient.request;
  • a parsed DocumentNode from graphql;
  • a TypedDocumentNode (e.g. produced by graphql-codegen), which lets the client infer both the response and variables types automatically.

Type Parameters

  • TData = unknown

    The shape of response.data.

  • TVariables = Variables

    The shape of the variables object.