So I have recently been using the GraphQL feature to build and run my queries. Some of my queries use ENUMs as an input. When you build these queries via the query builder and enter your input into the box is comes out as a string between quotes. This is not an enum (which requires the quotes to be removed) and so you get this confusing error message Enum "CustomerOrder_OrderType" cannot represent non-enum value: "ORDER". Did you mean the enum value "ORDER"?
This message should probably use backticks rather than quotes on the example just to differentiate them.
Also is there a way I am missing to escape the quotes when using the input box? It also feels like the input for a type that is a enum should be a drop down of the enums values.
Hey @tompea ,
Thanks for sharing this. I tried using a GraphQL API that takes the input as an enum but didn’t face similar issues. It would be super helpful if you could either provide a screen recording or any screenshots of the error you are facing that would help me reproduce it.
I used the https://api.cartql.com API, SKU is a CartItemType Also, I’m using the GraphQL v2 client.
My documentation tab does not seem to generate like yours. It does not give me the inputs of my query. I am wondering if this could be related to the fact that my query with inputs is not at the top level? I can confirm the schema is an enum.
The documentation tab reflects what is selected by the query builder.
Also, I would expect the CustomerOrder type to be an input type, like here. The screen recording shows the output type I think, probably that’s why I can’t see the input keyword.
Strange, jsut trying to figure out any differences in our approaches. Is your schema from a schema file or via introspection, mine is via introspection. It is also a Federated GraphQL Service although not sure that should make a differences.
Hey @tompea,
I’m using introspection; I don’t think it should matter how the schema is generated if the structure is similar. Let me check if anyone on the product team knows anything more.