haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

Support __typename introspection #192

Open jamesdabbs opened 6 years ago

jamesdabbs commented 6 years ago

Hey y'all - big fan of the project. Thanks for your work on it.

I'm currently working on using this as the backend for an Apollo client, which seems to assume that all types will at least support the __typename introspection field for client-side caching purposes. I've been faking it by manually adding an explicit __typename field to every type, but wanted to take a swing at implementing this properly and learning some of the internals and type machinery here.

I added a few tests, but if there's anything else I can do to improve this PR (implementation, documentation, or otherwise) please let me know.

For what it's worth, I'd be interested in continuing to contribute to this project, and would welcome any suggestions for how best to do so. I'm going to explore what I can implement in terms of supporting http://facebook.github.io/graphql/June2018/#sec-Schema-Introspection currently, though it looks like it may require some non-trivial internal changes to support e.g. querying the fields of input objects.

jml commented 6 years ago

@jamesdabbs Thanks for the PRs! Sorry we're lagging a bit in getting to reviewing them.

jamesdabbs commented 6 years ago

@jml - no worries at all! I'm in a bit of a busy patch so it'll be a week or so before I can pick up this thread anyways.