diff --git a/.changeset/wear-a-mask.md b/.changeset/wear-a-mask.md new file mode 100644 index 0000000..91f9c55 --- /dev/null +++ b/.changeset/wear-a-mask.md @@ -0,0 +1,5 @@ +--- +"@ts-gql/apollo": patch +--- + +Support `query`'s `context` parameter, and tightens up `mutate`'s existing `context` parameter to be [more in line with Apollo's](https://github.com/apollographql/apollo-client/blob/main/src/core/types.ts#L16). diff --git a/packages/apollo/index.d.ts b/packages/apollo/index.d.ts index 9530a7c..eaf6adb 100644 --- a/packages/apollo/index.d.ts +++ b/packages/apollo/index.d.ts @@ -165,7 +165,7 @@ export type MutationOptions< TTypedDocumentNode extends TypedDocumentNode > = { mutation: TTypedDocumentNode; - context?: any; + context?: Record; fetchPolicy?: FetchPolicy; optimisticResponse?: | OperationData @@ -193,6 +193,7 @@ type QueryFnOptions< query: TTypedDocumentNode; errorPolicy?: ErrorPolicy; fetchPolicy?: FetchPolicy; + context?: Record; } & HasRequiredVariables< TTypedDocumentNode, { variables: OperationVariables },