nfroidure / whook

Build strong and efficient REST web services.
https://slides.com/nfroidure/introducing-whook
MIT License
31 stars 7 forks source link

`apollographql/apollo-server` breaks the build #140

Closed nfroidure closed 1 year ago

nfroidure commented 2 years ago

The build is broken since TypeScript 4.8:

> @whook/graphql@10.0.3 build
> rimraf -f 'dist' && tsc --outDir dist

Error: ../../node_modules/apollo-server-core/dist/types.d.ts(3,50): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@graphql-tools/schema")' call instead.
lerna ERR! npm run build exited 2 in '@whook/graphql'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
Error: Process completed with exit code 2.

Full logs: https://github.com/nfroidure/whook/runs/8152053130?check_suite_focus=true

Temporary adding:

import type { IMocks } from '@graphql-tools/mock';
+ // @ts-ignore
import type { IExecutableSchemaDefinition } from '@graphql-tools/schema';

Fixes the build, issue reported here: https://github.com/apollographql/apollo-server/issues/6868#issuecomment-1233786862