Skip to content

error TS2315: Type 'ExecutionResult' is not generic #6220

@heavenkiller2018

Description

@heavenkiller2018

Intended outcome:

Actual outcome:

node_modules/@apollo/client/core/LocalState.d.ts:41:23 - error TS2315: Type 'ExecutionResult' is not generic.

41 remoteResult: ExecutionResult;
~~~~~~~~~~~~~~~~~~~~~~

node_modules/@apollo/client/core/LocalState.d.ts:45:17 - error TS2315: Type 'ExecutionResult' is not generic.

45 }): Promise<ExecutionResult>;
~~~~~~~~~~~~~~~~~~~~~~

node_modules/@apollo/client/core/watchQueryOptions.d.ts:55:32 - error TS2315: Type 'ExecutionResult' is not generic.

55 refetchQueries?: ((result: ExecutionResult) => RefetchQueryDescription) | RefetchQueryDescription;
~~~~~~~~~~~~~~~~~~

node_modules/@apollo/client/link/core/types.d.ts:23:56 - error TS2315: Type 'ExecutionResult' is not generic.

23 }, C = Record<string, any>, E = Record<string, any>> = ExecutionResult & {

How to reproduce the issue:

when i use apollo-client in nodejs, i found it's becauseof the change of latest graphql version (v15.0.0 (2020-04-02))

TS: remove TS-specific TData from ExecutionResult #2490
graphql/graphql-js#2490

src/execution/execute.d.ts

export interface ExecutionContext {
  schema: GraphQLSchema;
  fragments: { [key: string]: FragmentDefinitionNode };
  rootValue: any;
  contextValue: any;
  operation: OperationDefinitionNode;
  variableValues: { [key: string]: any };
  fieldResolver: GraphQLFieldResolver<any, any>;
  errors: Array<GraphQLError>;
}

Versions
System:
OS: Windows 10 10.0.17763
Binaries:
Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.12.1 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@apollo/client: ^3.0.0-beta.44 => 3.0.0-beta.44
apollo-server-express: ^2.12.0 => 2.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions