Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Version 9 incompatible with relay-compiler version 7? #151

Closed
m64253 opened this issue Oct 23, 2019 · 7 comments
Closed

Version 9 incompatible with relay-compiler version 7? #151

m64253 opened this issue Oct 23, 2019 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@m64253
Copy link

m64253 commented Oct 23, 2019

I guess this commit to relay-compiler facebook/relay@536f781 are causing some deep imports like this to fail?

import * as RelayMaskTransform from "relay-compiler/lib/transforms/RelayMaskTransform";

@smmoosavi
Copy link

@types/relay-compiler needs to be updated and add types for new files

@smmoosavi
Copy link

after fixing file imports, this error will occurs

ERROR:
  Error writing modules:
  Error: Invalid AST Node: { QUERY_TYPE_KEY: Symbol(Query), MUTATION_TYPE_KEY: Symbol(Mutation), SUBSCRIPTION_TYPE_KEY: Symbol(Subsription), _baseSchema: { __validationErrors: [], extensions: undefined, astNode: [Object], extensionASTNodes: undefined, __allowedLegacyNames: [], _queryType: Root, _mutationType: null, _subscriptionType: null, _directives: [Array], _typeMap: [Object], _possibleTypeMap: {}, _implementations: [Object] }, _extendedSchema: { __validationErrors: undefined, extensions: undefined, astNode: [Object], extensionASTNodes: [], __allowedLegacyNames: [], _queryType: Root, _mutationType: null, _subscriptionType: null, _directives: [Array], _typeMap: [Object], _possibleTypeMap: {}, _implementations: [Object] }, _typeMap: {}, _fieldsMap: {}, _typeNameMap: {}, _clientIdMap: {}, _possibleTypesMap: {}, _directivesMap: {} }
at visit (/path-to-project/node_modules/graphql/language/visitor.js:236:15)
at Object.visitIR [as visit] (/path-to-project/node_modules/relay-compiler/lib/core/GraphQLIRVisitor.js:41:10)
at Object.exports.generate (/path-to-project/node_modules/relay-compiler-language-typescript/lib/TypeScriptGenerator.js:68:46)
at /path-to-project/node_modules/relay-compiler/bin/relay-compiler:11541:64
at Generator.next (<anonymous>)
at asyncGeneratorStep (/path-to-project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/path-to-project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /path-to-project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise (<anonymous>)
at /path-to-project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12

the error throws from this line

const ast: ts.Statement[] = IRVisitor.visit(node, createVisitor(options));

@janicduplessis
Copy link

Relay now uses its own ast so some updates are needed to use their schema helpers instead of using graphql-js.

I made the changes to the compiled files quickly just to get it working if that can help someone https://gist.github.com/janicduplessis/6c134b4c21168aa28b81e3fd818ec9bd

We'll need to update this based on the recent changes in https://github.com/facebook/relay/blob/master/packages/relay-compiler/language/javascript/RelayFlowGenerator.js and https://github.com/facebook/relay/blob/master/packages/relay-compiler/language/javascript/RelayFlowTypeTransformers.js

@sorenhoyer
Copy link
Contributor

I guess it'll be quite a lot of work to get it relay v7 compatible. I made a fork with some of the changes here: https://github.com/sorenhoyer/relay-compiler-language-typescript - not sure I'll have time over the weekend to continue, so hopefully somebody else is working on this and will beat me to it :D

@sorenhoyer
Copy link
Contributor

sorenhoyer commented Oct 25, 2019

Started some work on it here in a draft PR. #154 #155

@alloy
Copy link
Member

alloy commented Oct 28, 2019

Thanks for all jumping on this, people, really happy with the community effort 🙌

@renanmav
Copy link
Contributor

Fixed by #155

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants