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.
- Introspection types are defined in GraphQL Spec 4.5. These types should be represented with the types in
- The spec defines 2 new fields (and resolvers):
__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.
- First I thought to put the code into modules under
Language.GraphQL.Introspectionsince it has its own section in the spec. As I see graphql.js uses type/instrospection.js, so
Language.GraphQL.Type.Introspectionis fine too.
Language.GraphQL.Typeis 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.