Relay-compiler-language-typescript: Relay 2: Cannot find module 'graphql-compiler'

Created on 26 Jan 2019  路  6Comments  路  Source: relay-tools/relay-compiler-language-typescript

relay-compiler --src . --include 'components/**' 'pages/**' --schema 'api/schema.graphql' --language typescript --artifactDirectory 'generated'

Error: Cannot find module 'graphql-compiler'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/steida/dev/este/node_modules/relay-compiler-language-typescript/lib/TypeScriptGenerator.js:21:23)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
help wanted

Most helpful comment

@sibelius @alloy @steida PR #87 to support Relay v2.0.0, removing dependency on graphql-compiler and accordingly to #78 (optionalInputFields).
One more thing, once merged this PR, could be addressed #86 (release a new package, due the changes, major).

All 6 comments

this is listed in peerDependencies as *, like a bunch of other.
@steida If you add them, it works.

graphql-compiler was merge with relay-compiler, there is no more graphql-compiler

@sibelius then this block should updated, and assert that the change it is not breaking something else.

https://github.com/relay-tools/relay-compiler-language-typescript/blob/7f71c0d563b3a7b0639340bc1b18a6fd38442724/src/TypeScriptGenerator.ts#L21

mainly require("relay-compiler/lib/GraphQLCompilerPublic"); this code does not exist anymore.

replaced by require("relay-compiler/lib/RelayCompilerPublic");

@sibelius @alloy @steida PR #87 to support Relay v2.0.0, removing dependency on graphql-compiler and accordingly to #78 (optionalInputFields).
One more thing, once merged this PR, could be addressed #86 (release a new package, due the changes, major).

Fixed by #87

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RichardLindhout picture RichardLindhout  路  17Comments

renanmav picture renanmav  路  11Comments

mrtnzlml picture mrtnzlml  路  6Comments

m64253 picture m64253  路  7Comments

wongmjane picture wongmjane  路  7Comments