I wanna be able to just write this:
let make = %graphql(`
query BlockQuery {
main_blockheight {
number
}
}
`)
But instead, I keep getting the error The value use can't be found in BlockHeightQuery.BlockQuery
, unless I write this:
let make = %graphql(`
query BlockQuery @ppxConfig(
templateTagImport: "gql",
templateTagLocation: "@apollo/client",
templateTagIsFunction: true,
templateTagReturnType: "ApolloClient.GraphQL_PPX.templateTagReturnType",
extend: "ApolloClient.GraphQL_PPX.ExtendQuery"
){
main_blockheight {
number
}
}
`)
Not a problem, if I can specify the ppxConfig
in bsconfig.json but it doesn’t work.
bsconfig.json
"bs-dependencies": [
"@rescript/react",
"@ryyppy/rescript-promise",
"bs-fetch",
"rescript-apollo-client",
"@reasonml-community/graphql-ppx",
],
"ppx-flags": ["@reasonml-community/graphql-ppx/ppx"],
"graphql": {
"apolloMode": true,
"extendMutation": "ApolloClient.GraphQL_PPX.ExtendMutation",
"extendQuery": "ApolloClient.GraphQL_PPX.ExtendQuery",
"extend": "ApolloClient.GraphQL_PPX.ExtendQuery",
"extendSubscription": "ApolloClient.GraphQL_PPX.ExtendSubscription",
"templateTagReturnType": "ApolloClient.GraphQL_PPX.templateTagReturnType",
"templateTagImport": "gql",
"templateTagIsFunction": true,
"templateTagLocation": "@apollo/client"
},