Reproduction: https://codesandbox.io/s/stupefied-water-04jnz
package.json:
{
"scripts": {
"postinstall": "tsc"
},
"dependencies": {
"graphql": "^15.3.0",
"graphql-tools": "^6.0.13"
},
"devDependencies": {
"typescript": "^3.9.6"
}
}
λ yarn tsc
yarn run v1.22.4
node_modules/@graphql-tools/wrap/transforms/WrapFields.d.ts:20:5 - error TS2416: Property 'transformRequest' in type 'WrapFields' is not assignable to the same property in base type 'Transform'.
Type '(originalRequest: Request, delegationContext: Record<string, any>, transformationContext: WrapFieldsTransformationContext) => Request' is not assignable to type 'RequestTransform'.
Types of parameters 'delegationContext' and 'delegationContext' are incompatible.
Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'.
Type 'undefined' is not assignable to type 'Record<string, any>'.
20 transformRequest(originalRequest: Request, delegationContext: Record<string, any>, transformationContext: WrapFieldsTransformationContext): Request;
~~~~~~~~~~~~~~~~
node_modules/@graphql-tools/wrap/transforms/WrapFields.d.ts:21:5 - error TS2416: Property 'transformResult' in type 'WrapFields' is not assignable to the same property in base type 'Transform'.
Type '(originalResult: ExecutionResult<Record<string, any>>, delegationContext: Record<string, any>, transformationContext: WrapFieldsTransformationContext) => ExecutionResult<...>' is not assignable to type 'ResultTransform'.
Types of parameters 'delegationContext' and 'delegationContext' are incompatible.
Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'.
Type 'undefined' is not assignable to type 'Record<string, any>'.
21 transformResult(originalResult: ExecutionResult, delegationContext: Record<string, any>, transformationContext: WrapFieldsTransformationContext): ExecutionResult;
~~~~~~~~~~~~~~~
node_modules/@graphql-tools/wrap/transforms/WrapType.d.ts:7:5 - error TS2416: Property 'transformRequest' in type 'WrapType' is not assignable to the same property in base type 'Transform'.
Type '(originalRequest: Request, delegationContext: Record<string, any>, transformationContext: Record<string, any>) => Request' is not assignable to type 'RequestTransform'.
Types of parameters 'delegationContext' and 'delegationContext' are incompatible.
Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'.
Type 'undefined' is not assignable to type 'Record<string, any>'.
7 transformRequest(originalRequest: Request, delegationContext: Record<string, any>, transformationContext: Record<string, any>): Request;
~~~~~~~~~~~~~~~~
node_modules/@graphql-tools/wrap/transforms/WrapType.d.ts:8:5 - error TS2416: Property 'transformResult' in type 'WrapType' is not assignable to the same property in base type 'Transform'.
Type '(originalResult: ExecutionResult<Record<string, any>>, delegationContext: Record<string, any>, transformationContext: Record<string, any>) => ExecutionResult<...>' is not assignable to type 'ResultTransform'.
Types of parameters 'delegationContext' and 'delegationContext' are incompatible.
Type 'Record<string, any> | undefined' is not assignable to type 'Record<string, any>'.
Type 'undefined' is not assignable to type 'Record<string, any>'.
8 transformResult(originalResult: ExecutionResult, delegationContext: Record<string, any>, transformationContext: Record<string, any>): ExecutionResult;
~~~~~~~~~~~~~~~
Found 4 errors.
error Command failed with exit code 1.
my tsconfig.json:
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
"module": "commonjs",
"target": "es2019", // targeting node v12.9+
"lib": ["es2020"],
"outDir": "./build",
"noEmit": true,
/* Type-Checking Options */
"strict": true,
"noImplicitReturns": true,
/* Module Resolution Options */
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
/* Advanced Options */
"forceConsistentCasingInFileNames": true
},
"include": [
"src/"
]
}
Likely similar to https://github.com/ardatan/graphql-tools/issues/1605#issuecomment-640156418
Fix might be along line of https://github.com/ardatan/graphql-tools/pull/1614
But #1614 was already released with v6.0.9 🤔
edit: Ah nvm, different files were modified in that PR. Now we need a similar fix in WrapFields
Released in 6.0.14.
Most helpful comment
Released in 6.0.14.