eturino/apollo-link-scalars

fails with version 0.1.11 due to graphql-tools upgrade.

Closed this issue · 1 comments

  • I'm submitting a ...
    [x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

We recently getting following error when building the frontend code using webpack. It seems somewhere in the code, we are not explicitly exporting package instead we pulling entire graphql-tools, hence it was failing at the compilation.

web-webpack error ModuleNotFoundError: Module not found: Error: Can't resolve 'child_process' in '/home/jenkins/workspace/project/node_modules/@graphql-tools/git-loader'

Instead of https://github.com/eturino/apollo-link-scalars/blob/v0.1.10/src/index.ts#L1, we can change to

import { makeExecutableSchema } from "@graphql-tools/schema";

Version update from 0.1.6 to 0.1.11.

@veeramarni versions 0.x before 0.3.0 are deprecated at this point. The problem that you are having is caused by an issue that version 0.1.x and 0.2.x had, which was exporting makeExecutableSchema from graphql-tools as part of this tool.
As discussed in

If you are using Apollo Client v3, please upgrade to version 2.0 (current master)
If you are using Apollo Client v2, please upgrade to version 0.3.0 v0.1.10...v0.3.0

The upgrade should be quite simple. If you are using makeExecutableSchema from this library, just replace it the version of graphql-tools that is compatible with the apollo client that you are using.

If things are not working, please ping me and I'll do my best to help.

btw, I'll change the readme to explain this.