Feature #364


Support introspection

Added by Eugen Wissner over 1 year ago. Updated 2 months ago.

Target version:
% Done:


Actions #1

Updated by Adrian Sieber 2 months ago

Hi, are you still working on this? Otherwise I might give it a shot.

How should it ideally be implemented?

Actions #2

Updated by Eugen Wissner 2 months ago

Hi, no I had no time to work on it. It is the last big feature from the GraphQL specification which is missing. Any help would be very appreciated.

I haven't read the section on introspection in the GraphQL spec yet, but as far as I understand it just adds additional types and resolvers to the schema. So the main part of the implementation would be a function which takes a Schema and returns a new Schema with introspection types and resolvers added.

  1. Introspection types are defined in GraphQL Spec 4.5. These types should be represented with the types in Language.GraphQL.Type.
  2. The spec defines 2 new fields (and resolvers): __schema and __type. These 2 resolvers should be added to the Query type. The function that generates introspection information traverses the original schema and generates values (from Language.GraphQL.Type.Definition) with type information at each node.
  3. First I thought to put the code into modules under Language.GraphQL.Introspection since it has its own section in the spec. As I see graphql.js uses type/instrospection.js, so Language.GraphQL.Type.Introspection is fine too. Language.GraphQL.Type is probably the only dependency.

That's pretty much my vision. On the side of the spec the introspection seems to be relatively simple (it is a short section in the spec). If you see any practical difficulties (which is possible because I haven't thought about the introspection a lot) or need any kind of guidance, please let me know.


Also available in: Atom PDF