Open ad-si opened 1 year ago
It looks like the generated code uses the enum's toString
functions within the InputObject
module. Here's an example of what is generated for the Star Wars API example:
So it appears that the basic case of encoding an enum within an InputObject is working as expected.
If you think there might be a bug, I would be interested to see a minimum reproduction of the relevant schema. There are some instructions for making a minimum reproduction here: https://github.com/dillonkearns/elm-graphql/blob/master/reproducing-issues/README.md
I have following GraphQL Enum:
It generates an
src/Api/Enum/Order.elm
file with following type:However, the generated
src/Api/InputObject.elm
file references a functionencodeOrder
which isn't defined anywhere.I was able to fix it by adding it manually:
Is this a bug and it should be generated automatically, or am I missing something?