Shopify / graphql-js-schema

Transforms the JSON representation of a GraphQL schema into a set of ES6 type modules
MIT License
35 stars 12 forks source link

extract only minimal type info #10

Closed jamesmacaulay closed 8 years ago

jamesmacaulay commented 8 years ago

@minasmart and @mikkoh please review.

Implements a more minimal type bundle structure similar to the one described here:

https://github.com/Shopify/graphql-js-schema/issues/8#issuecomment-255872243

Please see the line-level comments for a guided tour :)

minasmart commented 8 years ago

Not completely reviewed, but I like this. Do you have an idea of the effort around updating the client to support?

jamesmacaulay commented 8 years ago

@minasmart I was just starting to look at that, I think it'll be pretty straightforward.

mikkoh commented 8 years ago

I like it.

minasmart commented 8 years ago

my review was supposed to have this gif:

I guess image pasting doesn't support gifs.

jamesmacaulay commented 8 years ago

I did a small refactor and then added the following commit, which I forgot to include in the original changeset:

https://github.com/Shopify/graphql-js-schema/pull/10/commits/9e45683522fccee9e073673d49074b5ad6ecd3e7

This removes all filtering of types in the output. I think this makes sense, it means that the client always has an index of all possible base types that might come in the response. Now that the type info is so stripped down, this doesn't add much to the resulting payload: all the introspection types fit in ~100 LOC now, for example.