Skip to content

Commit

Permalink
Support query's 'context' parameter (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesstelford authored Aug 30, 2021
1 parent 8852b93 commit 7535729
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wear-a-mask.md
Original file line number Diff line number Diff line change
@@ -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).
3 changes: 2 additions & 1 deletion packages/apollo/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export type MutationOptions<
TTypedDocumentNode extends TypedDocumentNode<BaseTypedMutation>
> = {
mutation: TTypedDocumentNode;
context?: any;
context?: Record<string, any>;
fetchPolicy?: FetchPolicy;
optimisticResponse?:
| OperationData<TTypedDocumentNode>
Expand Down Expand Up @@ -193,6 +193,7 @@ type QueryFnOptions<
query: TTypedDocumentNode;
errorPolicy?: ErrorPolicy;
fetchPolicy?: FetchPolicy;
context?: Record<string, any>;
} & HasRequiredVariables<
TTypedDocumentNode,
{ variables: OperationVariables<TTypedDocumentNode> },
Expand Down

0 comments on commit 7535729

Please sign in to comment.