Closed dfalling closed 2 years ago
I have the ppx configured in my bsconfig like this:
"ppx-flags": ["@reasonml-community/graphql-ppx/ppx"], "graphql": { "apolloMode": true, "extendMutation": "ApolloClient.GraphQL_PPX.ExtendMutation", "extendQuery": "ApolloClient.GraphQL_PPX.ExtendQuery", "extendSubscription": "ApolloClient.GraphQL_PPX.ExtendSubscription", "templateTagReturnType": "ApolloClient.GraphQL_PPX.templateTagReturnType", "templateTagImport": "gql", "templateTagLocation": "@apollo/client", "templateTagIsFunction": true },
I'd like to use my query like this:
query TripsQuery { trips { ...ListTrip } }
But the compiler warns:
This has type: ApolloClient.GraphQL_PPX.templateTagReturnType (defined as ApolloClient__Graphql_Language.documentNode) Somewhere wanted: string
This problem is fixed if I duplicate the config:
query TripsQuery ( templateTagImport: "gql", templateTagLocation: "@apollo/client", templateTagIsFunction: true, templateTagReturnType: "ApolloClient.GraphQL_PPX.templateTagReturnType", extend: "ApolloClient.GraphQL_PPX.ExtendQuery" ){ trips { ...ListTrip } }
Is there something I'm missing to make this work? It's pretty bloated to define this config every time I have a fragment, query, or mutation.
Thanks!
I have the ppx configured in my bsconfig like this:
I'd like to use my query like this:
But the compiler warns:
This problem is fixed if I duplicate the config:
Is there something I'm missing to make this work? It's pretty bloated to define this config every time I have a fragment, query, or mutation.
Thanks!