Skip to content

Commit

Permalink
Fix operation.setContext() type
Browse files Browse the repository at this point in the history
  • Loading branch information
henryqdineen committed Apr 5, 2024
1 parent 285b2d9 commit 0f37e96
Show file tree
Hide file tree
Showing 27 changed files with 109 additions and 26 deletions.
5 changes: 4 additions & 1 deletion .api-reports/api-report-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,10 @@ export interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_batch-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_core.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_error.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_http.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_persisted-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_remove-typename.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-link_ws.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: Context) => Context;
setContext: {
(context: Context): void;
(updateContext: (previousContext: Context) => Context): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_hoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-react_ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-testing_core.md
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,10 @@ interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,10 @@ export interface Operation {
// (undocumented)
query: DocumentNode;
// (undocumented)
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
// (undocumented)
variables: Record<string, any>;
}
Expand Down
5 changes: 5 additions & 0 deletions .changeset/strange-needles-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix operation.setContext() type
5 changes: 4 additions & 1 deletion src/link/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export interface Operation {
variables: Record<string, any>;
operationName: string;
extensions: Record<string, any>;
setContext: (context: DefaultContext) => DefaultContext;
setContext: {
(context: DefaultContext): void;
(updateContext: (previousContext: DefaultContext) => DefaultContext): void;
};
getContext: () => DefaultContext;
}

Expand Down

0 comments on commit 0f37e96

Please sign in to comment.