andreas/ocaml-graphql-server

enum in variables

Closed this issue · 1 comments

Ulrar commented

Hi,

Still the same problem about error messages, so I'm not a 100% on where this is coming from, but I think you can't use enums in variables.

This works

{"query":"mutation {  saveProject(project: {status: OPEN}) {    status  }}"}

This doesn't

{"query":"mutation saveProject($project: project)","variables":{"project":{"status":"OPEN"}}

I took away other stuff, but the only difference I have between the two (besides the actual variable) is that the enum is a string in the second one, since you don't have enums in JSON (at least, not as far as I know).
I get that when running the second mutation :
(Failure ": string")

So I assume the problem is that it's finding a string where it's expecting an enum ?

Ulrar commented

Okay, as usual I realise my mistake after creating the issue .. sorry, clearly those two queries aren't the same, and the problem isn't the enum at all it's the name of the query vs the name of the field. I'll go hide in shame now