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

Enable strict mode in tsconfig and fix type errors #11200

Merged
merged 33 commits into from Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
aca904f
Enable strict mode in tsconfig.json
jerelmiller Sep 7, 2023
0da3d3d
Fix type issues in utilities/graphql/transform
jerelmiller Sep 7, 2023
78ccf61
Use spread to push incoming objects in offsetLimitPagination
jerelmiller Sep 7, 2023
69d528a
Fix type issues in writeToStore test
jerelmiller Sep 7, 2023
e503cbb
Fix type issues in Concast
jerelmiller Sep 7, 2023
0fe49a0
Remove unused filterInPlace utility
jerelmiller Sep 7, 2023
e34d084
Add this type to itAsync
jerelmiller Sep 7, 2023
962bd47
Add ! annotation to mockLink
jerelmiller Sep 7, 2023
36129f8
Fix assignment from unknown in error link
jerelmiller Sep 7, 2023
cea054e
Fix type issue in readFromStore
jerelmiller Sep 7, 2023
bed3439
Fix type issues in useQuery
jerelmiller Sep 7, 2023
b568689
some progress
phryneas Sep 8, 2023
6498326
more type fixes
phryneas Sep 13, 2023
b8c6eb6
change `addExportedVariables` signature
phryneas Sep 13, 2023
c3a761d
better typing
phryneas Sep 13, 2023
9eb5e3e
undo deprecation
phryneas Sep 13, 2023
0966cc9
Merge branch 'main' into enable-strict-mode
phryneas Sep 13, 2023
a101977
test types
phryneas Sep 13, 2023
55a6351
add api extractor
phryneas Sep 14, 2023
f909921
add api reports
phryneas Sep 14, 2023
e1e2fbb
add workflow
phryneas Sep 14, 2023
0426c84
formatting
phryneas Sep 14, 2023
be151b0
package lock
phryneas Sep 14, 2023
c83b042
remove `ensureResult` for this PR, add `TODO` type
phryneas Sep 14, 2023
4aa485b
Merge branch 'pr/api-extractor' into enable-strict-mode
phryneas Sep 14, 2023
1e7c5c6
API updates for this PR
phryneas Sep 14, 2023
c080309
Merge remote-tracking branch 'origin/main' into enable-strict-mode
phryneas Nov 10, 2023
0b2cf25
size-limit
phryneas Nov 10, 2023
9303630
introduce IDE-only `tsconfig.json`
phryneas Nov 10, 2023
5e3fb70
formatting
phryneas Nov 10, 2023
04dcc0d
fix path
phryneas Nov 10, 2023
2cb5c83
Merge pull request #11359 from apollographql/pr/enable-test-ts
jerelmiller Nov 10, 2023
94b07f9
Add changeset
jerelmiller Nov 10, 2023
File filter

Filter by extension

Filter by extension


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

Large diffs are not rendered by default.

2,192 changes: 2,192 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
@@ -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
//
// @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
@@ -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)

```