graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Generate `From<Variables>` implementation for `QueryBody<Variables>`

Open ffuugoo opened this issue 4 years ago • 1 comments

Basically subject.

I may be missing something, but I don't see why this won't work.

Variables structures are generated in a closed module alongside OPERATION_NAME and QUERY strings, which means that:

  • association of Variables with it's OPERATION_NAME and QUERY is obvious and unambiguous
  • it's impossible to implement this From in the user code due to orphan rules

It's not the most desperately needed trait-impl, but it would allow to properly generalize QueryBody construction over Variables in user code, which would be nice.

ffuugoo avatar Jul 17 '20 10:07 ffuugoo

I may be missing something

If there are actually no reasons to not do it just let me know I'll pop a PR on weekends.

ffuugoo avatar Jul 17 '20 11:07 ffuugoo