Closed dfalling closed 3 years ago
What is in your bsconfig.json
? Use will be added to the query with the extendQuery
configuration.
Sorry I cross-posted in the rescript forum, I wasn't sure where was the better place for help with this. Happy to close either discussion.
My bsconfig is:
],
"bs-dependencies": [
"@reasonml-community/graphql-ppx"
],
"ppx-flags": ["@reasonml-community/graphql-ppx/ppx"],
"graphql": {
"apolloMode": true,
"extendMutation": "ExtendMutation",
"extendQuery": "ExtendQuery",
"extendSubscription": "ExtendSubscription",
"templateTagReturnType": "templateTagReturnType",
"templateTagImport": "gql",
"templateTagLocation": "@apollo/client",
"templateTagIsFunction": true
},
My bsconfig.json's flags still seem to have no effect, but using these for my query does work:
%graphql(`
query TripsQuery @ppxConfig(
templateTagImport: "gql",
templateTagLocation: "@apollo/client",
templateTagIsFunction: true,
templateTagReturnType: "ApolloClient.GraphQL_PPX.templateTagReturnType",
extend: "ApolloClient.GraphQL_PPX.ExtendQuery"
){
....
}
`)
What is the folder structure, it seems like the ppx can't find the configuration for some reason.
.
├── bsconfig.json
├── graphql_schema.json
├── lib
│ └── bs
├── package.json
├── src
│ ├── App.bs.js
│ ├── App.res
│ └── views
│ ├── TripList.bs.js
│ ├── TripList.res # file with TripsQuery ppx
└── yarn.lock
if you put all configuration in the bsconfig.json
instead of the query local config? Perhaps it doesn't play well together (I looked at the code again but they should work well together, but perhaps I missed something). Do you have a minimal reproducible example that you can share for me to look into?
Yeah, if I strip my query down to just the query, I'm back to the use()
is not defined error.
Here's a minimal example: https://github.com/dfalling/ppx_demo
I just dropped a dependency that’s unrelated to GraphQL that resulted in a ton dependencies being removed from my yarn.lock. For some reason this has also broken my GraphQL PPX:
My query's pretty simple:
Any idea what would cause this? I've done clean builds and am not getting any errors for missing packages.
Thanks!