This test example uses all libraries that have full support for ESM:
- GraphQL EZ: https://www.graphql-ez.com/
- Envelop: https://www.envelop.dev/
- GraphQL Tools: https://www.graphql-tools.com/
And using a republish of the GraphQL.js library https://npm.im/graphql called graphql-esm, which is full Node.js ESM with "type": "module". https://npm.im/graphql-esm.
This example also uses bob-tsm, which allows you to use TypeScript seemlesly, using esbuild behind the scenes.
You can use graphql-esm setting your package.json graphql dependency like this:
{
"dependencies": {
"graphql": "npm:graphql-esm@^16.0.1"
}
}
If you don´t have pnpm installed, you can do
npm i -g pnpm
To install dependencies,
pnpm i
To run with watch mode
pnpm dev