teamwalnut / graphql-ppx

GraphQL language primitives for ReScript/ReasonML written in ReasonML
https://graphql-ppx.com
MIT License
257 stars 53 forks source link

custom-fields isn't working from bs-config as expected #258

Closed JasoonS closed 2 years ago

JasoonS commented 3 years ago

using isn't creating custom fields for me. It was working on some other code bases, but I can't get it to work now.

  "graphql": {
    //... other config ...
    "custom-fields": {
      "BigInt": "BigInt",
      "Bytes": "Bytes"
    },
  },

I still need to manually add @ppxCustom(module: "BigInt") to get it to work.

jfrolich commented 3 years ago

Did you try camelcase (customFields)? The kebab-case was used before all configuration was made consistent in 1.0 I think.

JasoonS commented 3 years ago

Hi @jfrolich , thank you so much for the response. I worked out the issue, it is thankfully very simple, just not user friendly.

It seems like the config you give to the ppx in the "graphql" section of the bsconfig cannot have trailing commas.

It would be a nice fix to give a reasonable error message if someone leaves a trailing comma in their graphql config

jfrolich commented 3 years ago

It seems like the config you give to the ppx in the "graphql" section of the bsconfig cannot have trailing commas.

AH! Thanks! I was planning to incorporate the custom JSON parsing library that ReScript uses in graphql-ppx for performance reasons. But this also seems like a good reason.

JasoonS commented 3 years ago

Amazing!