accounts icon indicating copy to clipboard operation
accounts copied to clipboard

error TS2430: Interface 'ExecutionResult<TData>' incorrectly extends interface 'ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>'.

Open KeithGillette opened this issue 2 years ago • 1 comments

Bug report

Describe the bug

Running tsc from [email protected] with default skipLibCheck: false on a project importing @graphql/[email protected] and [email protected] generates the following error:

node_modules/@accounts/graphql-api/node_modules/@graphql-tools/utils/Interfaces.d.ts:3:18 - error TS2430: Interface 'ExecutionResult<TData>' incorrectly extends interface 'ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>'.
  Types of property 'data' are incompatible.
    Type 'TData' is not assignable to type 'ObjMap<unknown>'.

3 export interface ExecutionResult<TData = Record<string, any>> extends GraphQLExecutionResult {

To Reproduce

See bug description.

Expected behavior

The project should transpile without error with TypeScript's default skipLibCheck: false setting.

Screenshots

N/A

System information

  • accounts-js: 0.33.2
  • graphql: 16.5.0
  • typescript: 4.7.4

Additional context

The version of graphql in @accounts/graphql-api dependencies is 2 major versions behind.

KeithGillette avatar Jun 27 '22 11:06 KeithGillette

The outdated graphql peer dependency also results in npm install errors with npm>=8.6when attempting to use the latest graphql:

npm ERR! Could not resolve dependency:
npm ERR! peer graphql@"^14.6.0 || ^15.0.0" from @accounts/[email protected]
npm ERR! node_modules/@accounts/graphql-api
npm ERR!   @accounts/graphql-api@"0.33.2" from the root project

KeithGillette avatar Jul 21 '22 17:07 KeithGillette