Right now GraphiQL will send the full value of the variables form, even if they query itself doesn't make use of them. This can be pretty cumbersome on e.g. Hasura where it'll refuse to run a query if it sees unexpected variables present, but you might have multiple operations with their own variables and you want to be able to run them in quick succession.
It'd be nice if, just like auto-setting an operationName, GraphiQL plucked only the relevant variables to be sent to the server.
I worry that this is too much in the realms of "magic." If the user enters variables into the variable editor and they are not sent to the server I think that could be very confusing (and misleading when they copy those same variables into their application and then it doesn't work even though it worked in GraphiQL). As such, I think this would make sense for an opt-in plugin but should not be part of the core implementation.
@sgrove - thank you for the suggestion. I agree with Benjie, that at this time it is probably too much added magic. I believe that the spec does allow you to pass additional (unused) variables in the request. Would it maybe be possible to raise this issue with Hasura? :)
Agreed this would be great for a plugin, not what we'd expect as spec behavior
What might help your situation @sgrove is possibly a way to re-use variables? That would be a really cool plugin.
Most helpful comment
I worry that this is too much in the realms of "magic." If the user enters variables into the variable editor and they are not sent to the server I think that could be very confusing (and misleading when they copy those same variables into their application and then it doesn't work even though it worked in GraphiQL). As such, I think this would make sense for an opt-in plugin but should not be part of the core implementation.