Closed JasoonS closed 3 years ago
My current fix - add this line as a post install script to my package.json:
"postinstall": "sed -i 's/type documentNode/type documentNode = string/g;s/type documentNode = string = string/type documentNode = string/g' node_modules/rescript-apollo-client/src/graphql/language/ApolloClient__Graphql_Language.res",
Which reliably replaces that line of code on a new install...
Could you post your bsconfig? That error usually means that you're missing the template tag configuration like "templateTagReturnType" in your config. For background, the graphql definition is normally just a string, but it's converted to documentNode
by running through gql
. This made to happen through the configuration. The type error is probably correct.
Are you sure the app is functional after that and you're not just getting the compiler to be happy?
Yeah, you are right. It isn't functional.
I'm not sure what the issue is to be honest. If I use the example you have in this repo and don't change much everything works. I get the problem when using newer versions of rescript. So I'll just stick with the older bs-platform for now :)
I found the issue!
In general the bsconfig.json file allows trailing commas, but graphqlppx does not!
Thank you for your help and patience :)
I just started a new project with the latest version of rescript and rescript-apollo client on the backend nodejs. And ran into the following error:
Making that change solved it for me. But I don't know the nuances of this change at all...
(additional info, I tried this code on bs-platform 9.0.2 also, same thing error)