Skip to content

Commit

Permalink
Merge branch 'main' into fix-6311
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell authored Feb 10, 2023
2 parents 183c3f3 + 8a883d8 commit e394739
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-berries-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Update `SingleExecutionResult` and `IncrementalPayload`'s `data` types such that they no longer include `undefined`, which was not a valid runtime value, to fix errors when TypeScript's `exactOptionalPropertyTypes` is enabled.
2 changes: 2 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

exclude-issue-created-after: '2018-01-01T00:00:00Z'
issue-inactive-days: '30'
exclude-any-issue-labels: '💬 discussion'
# issue-comment: >
# This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

# Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/apollo-client) or our [discord server](https://discord.gg/graphos) for questions.

exclude-pr-created-after: '2018-01-01T00:00:00Z'
pr-inactive-days: '30'
exclude-any-pr-labels: '💬 discussion'
# pr-comment: >
Expand Down
8 changes: 3 additions & 5 deletions src/link/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export { DocumentNode };
import { Observable } from "../../utilities";

export type Path = ReadonlyArray<string | number>;
type Data<T> = T | null | undefined;


interface ExecutionPatchResultBase {
hasNext?: boolean;
Expand All @@ -17,7 +15,7 @@ export interface ExecutionPatchInitialResult<
TExtensions = Record<string, any>
> extends ExecutionPatchResultBase {
// if data is present, incremental is not
data: Data<TData>;
data: TData | null | undefined;
incremental?: never;
errors?: ReadonlyArray<GraphQLError>;
extensions?: TExtensions;
Expand All @@ -29,7 +27,7 @@ export interface IncrementalPayload<
> {
// data and path must both be present
// https://github.com/graphql/graphql-spec/pull/742/files#diff-98d0cd153b72b63c417ad4238e8cc0d3385691ccbde7f7674bc0d2a718b896ecR288-R293
data: Data<TData>;
data: TData | null;
label?: string;
path: Path;
errors?: ReadonlyArray<GraphQLError>;
Expand Down Expand Up @@ -79,7 +77,7 @@ export interface SingleExecutionResult<
TContext = DefaultContext,
TExtensions = Record<string, any>
> extends ExecutionResult<TData, TExtensions> {
data?: Data<TData>;
data?: TData | null;
context?: TContext;
}

Expand Down

0 comments on commit e394739

Please sign in to comment.