The dev-test-apollo-tooling package is an example of migrating from Apollo tooling to GraphQL Codegen. It attempts to generate output as close as possible to Apollo tooling’s output. Note: this package is a work in progress and currently requires a patch to near-operation-file. We will fix this package soon.
How to run this package:
- Make sure you have the correct Yarn version installed (check the root package.json,
packageManagerentry). Otherwise, you might run into unexplained bugs. - In the monorepo root, run:
yarn clean && yarn install && yarn build
- Patch
near-operation-filemanually (the automatic patch doesn’t always work). In the monorepo root, run:
yarn postinstall
- Go to the
dev-test-apollo-toolingdirectory and run:
cd dev-test-apollo-tooling yarn install yarn start
This will generate type files in dev-test-apollo-tooling/src/__generated__/*.