Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jan 31, 2025
2 parents 6585f99 + eeba2ef commit f88e807
Show file tree
Hide file tree
Showing 38 changed files with 4,234 additions and 3,334 deletions.
10 changes: 2 additions & 8 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ export class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -218,10 +215,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-errors.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -50,10 +47,7 @@ export interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
6 changes: 1 addition & 5 deletions .api-reports/api-report-link_error.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import type { DocumentNode } from 'graphql';
import type { FormattedExecutionResult } from 'graphql';
import type { GraphQLErrorExtensions } from 'graphql';
import type { GraphQLFormattedError } from 'graphql';
import { Observable } from 'zen-observable-ts';
import type { Observer } from 'zen-observable-ts';
Expand Down Expand Up @@ -86,10 +85,7 @@ export interface ErrorResponse {
networkError?: NetworkError;
// (undocumented)
operation: Operation;
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
// (undocumented)
response?: FormattedExecutionResult;
}
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -275,10 +272,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -254,10 +251,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -273,10 +270,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_hoc.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -253,10 +250,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_hooks.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -251,10 +248,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -251,10 +248,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-react_ssr.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -252,10 +249,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-testing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -251,10 +248,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-testing_core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -251,10 +248,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report-utilities.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -266,10 +263,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
10 changes: 2 additions & 8 deletions .api-reports/api-report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ export class ApolloError extends Error {
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand All @@ -218,10 +215,7 @@ interface ApolloErrorOptions {
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
protocolErrors?: ReadonlyArray<GraphQLFormattedError>;
}

// @public (undocumented)
Expand Down
5 changes: 5 additions & 0 deletions .changeset/curvy-seahorses-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix type of `extensions` in `protocolErrors` for `ApolloError` and the `onError` link. According to the [multipart HTTP subscription protocol](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol), fatal tranport errors follow the [GraphQL error format](https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format) which require `extensions` to be a map as its value instead of an array.
14 changes: 14 additions & 0 deletions .github/workflows/cleanup-checks.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check
/** @param {import('@actions/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
export function setup({ context, github }) {
return {
async add_cleanup_label() {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["auto-cleanup"],
});
},
};
}
9 changes: 5 additions & 4 deletions .github/workflows/cleanup-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ jobs:
if: |
github.repository == 'apollographql/apollo-client' &&
github.event.review.state == 'APPROVED' &&
github.event.review.author_association == 'MEMBER' &&
contains(github.event.pull_request.labels.*.name, 'auto-cleanup') == false
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: add label
uses: actions-ecosystem/action-add-labels@v1
uses: actions/[email protected]
with:
labels: auto-cleanup
script: |
const script = (await import('${{ github.workspace }}/.github/workflows/cleanup-checks.mjs')).setup({context,core,github,exec,glob,io})
await script.add_cleanup_label()

cleanup:
if: |
Expand Down
Loading

0 comments on commit f88e807

Please sign in to comment.