Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API Extractor API reports as a CI check #11215

Merged
merged 6 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
958 changes: 958 additions & 0 deletions .api-reports/api-report-cache.md

Large diffs are not rendered by default.

2,196 changes: 2,196 additions & 0 deletions .api-reports/api-report-core.md

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions .api-reports/api-report-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## API Report File for "@apollo/client"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

// @public (undocumented)
interface ErrorCodes {
// (undocumented)
[key: number]: {
file: string;
condition?: string;
message?: string;
};
}

// @public (undocumented)
export function loadDevMessages(): void;

// Warning: (ae-forgotten-export) The symbol "ErrorCodes" needs to be exported by the entry point index.d.ts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can read up on this warning here:

https://api-extractor.com/pages/messages/ae-forgotten-export/

TLDR: The type is not public, but used by a public export.
That means multiple things:

  • if it points to a third-party package, consumers of ours that use declaration: true, they might get a TS build error (along the lines of "export cannot be named")
  • it might be fiddly to type

On the other hand, it might be perfectly fine - we shouldn't add every helper type to our public api, as it would add tons of stuff to keep supporting for backwards compatibility.

=> The warnings are here, we should consider them on a per-case basis (mostly when we add new stuff), but not take them too seriously.

//
// @public (undocumented)
export function loadErrorMessageHandler(...errorCodes: ErrorCodes[]): ((message: string | number, args: unknown[]) => string | undefined) & ErrorCodes;

// @public (undocumented)
export function loadErrorMessages(): void;

// (No @packageDocumentation comment for this package)

```
174 changes: 174 additions & 0 deletions .api-reports/api-report-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
## API Report File for "@apollo/client"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import type { ExecutionResult } from 'graphql';
import type { GraphQLError } from 'graphql';
import type { GraphQLErrorExtensions } from 'graphql';

// @public (undocumented)
export class ApolloError extends Error {
constructor({ graphQLErrors, protocolErrors, clientErrors, networkError, errorMessage, extraInfo, }: ApolloErrorOptions);
// (undocumented)
clientErrors: ReadonlyArray<Error>;
// (undocumented)
extraInfo: any;
// (undocumented)
graphQLErrors: GraphQLErrors;
// (undocumented)
message: string;
// (undocumented)
name: string;
// Warning: (ae-forgotten-export) The symbol "ServerParseError" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ServerError" needs to be exported by the entry point index.d.ts
//
// (undocumented)
networkError: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
}

// @public (undocumented)
export interface ApolloErrorOptions {
// (undocumented)
clientErrors?: ReadonlyArray<Error>;
// (undocumented)
errorMessage?: string;
// (undocumented)
extraInfo?: any;
// (undocumented)
graphQLErrors?: ReadonlyArray<GraphQLError>;
// (undocumented)
networkError?: Error | ServerParseError | ServerError | null;
// (undocumented)
protocolErrors?: ReadonlyArray<{
message: string;
extensions?: GraphQLErrorExtensions[];
}>;
}

// @public (undocumented)
interface DefaultContext extends Record<string, any> {
}

// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
interface ExecutionPatchIncrementalResult<TData = Record<string, any>, TExtensions = Record<string, any>> extends ExecutionPatchResultBase {
// (undocumented)
data?: never;
// (undocumented)
errors?: never;
// (undocumented)
extensions?: never;
// Warning: (ae-forgotten-export) The symbol "IncrementalPayload" needs to be exported by the entry point index.d.ts
//
// (undocumented)
incremental?: IncrementalPayload<TData, TExtensions>[];
}

// @public (undocumented)
interface ExecutionPatchInitialResult<TData = Record<string, any>, TExtensions = Record<string, any>> extends ExecutionPatchResultBase {
// (undocumented)
data: TData | null | undefined;
// (undocumented)
errors?: ReadonlyArray<GraphQLError>;
// (undocumented)
extensions?: TExtensions;
// (undocumented)
incremental?: never;
}

// Warning: (ae-forgotten-export) The symbol "ExecutionPatchInitialResult" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchIncrementalResult" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type ExecutionPatchResult<TData = Record<string, any>, TExtensions = Record<string, any>> = ExecutionPatchInitialResult<TData, TExtensions> | ExecutionPatchIncrementalResult<TData, TExtensions>;

// @public (undocumented)
interface ExecutionPatchResultBase {
// (undocumented)
hasNext?: boolean;
}

// Warning: (ae-forgotten-export) The symbol "SingleExecutionResult" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResult" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type FetchResult<TData = Record<string, any>, TContext = Record<string, any>, TExtensions = Record<string, any>> = SingleExecutionResult<TData, TContext, TExtensions> | ExecutionPatchResult<TData, TExtensions>;

// Warning: (ae-forgotten-export) The symbol "FetchResult" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type FetchResultWithSymbolExtensions<T> = FetchResult<T> & {
extensions: Record<string | symbol, any>;
};

// @public (undocumented)
export type GraphQLErrors = ReadonlyArray<GraphQLError>;

// Warning: (ae-forgotten-export) The symbol "FetchResultWithSymbolExtensions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function graphQLResultHasProtocolErrors<T>(result: FetchResult<T>): result is FetchResultWithSymbolExtensions<T>;

// @public (undocumented)
interface IncrementalPayload<TData, TExtensions> {
// (undocumented)
data: TData | null;
// (undocumented)
errors?: ReadonlyArray<GraphQLError>;
// (undocumented)
extensions?: TExtensions;
// (undocumented)
label?: string;
// Warning: (ae-forgotten-export) The symbol "Path" needs to be exported by the entry point index.d.ts
//
// (undocumented)
path: Path;
}

// @public (undocumented)
export function isApolloError(err: Error): err is ApolloError;

// @public (undocumented)
export type NetworkError = Error | ServerParseError | ServerError | null;

// @public (undocumented)
type Path = ReadonlyArray<string | number>;

// @public (undocumented)
export const PROTOCOL_ERRORS_SYMBOL: unique symbol;

// @public (undocumented)
type ServerError = Error & {
response: Response;
result: Record<string, any> | string;
statusCode: number;
};

// @public (undocumented)
type ServerParseError = Error & {
response: Response;
statusCode: number;
bodyText: string;
};

// Warning: (ae-forgotten-export) The symbol "DefaultContext" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> extends ExecutionResult<TData, TExtensions> {
// (undocumented)
context?: TContext;
// (undocumented)
data?: TData | null;
}

// (No @packageDocumentation comment for this package)

```
Loading