graphql-rust / graphql-client

Typed, correct GraphQL requests and responses in Rust
Apache License 2.0
1.15k stars 158 forks source link

Add example for type refining fragment #344

Open nirvdrum opened 4 years ago

nirvdrum commented 4 years ago

PR #181 added support for type refining fragments and was released in version 0.6.0. The existing examples, however, were not augmented to demonstrate how to work with such a fragment. I managed to piece it together from the newly added tests and some println! debugging. It wasn't immediately clear to me that a new enum would be generated and that I would need to pattern-match on that.

I could take a crack at it. It looks to me like working off the GitHub example would be easiest since it's publicly accessible.

tomhoule commented 3 years ago

Yep that would be great. I think we do have tests for this, that could be a starting point.