Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Approach to extending types such as https://graphql.github.io/graphql-spec/June2018/#sec-Type-Extensions
Todo
GraphQL::Schema::BuildFromDefinition
so it actually extends types and "works".GraphQL::Schema
with type extensions and come up with a pretty way to do this. Extensions don't have a description so we fall flat making a new object.fromGraphQL::BaseType
. If the wasn't a problem how would it look like then? See below for a proposal. Also extensions aren't connected to the schema, since they sort of come after the fact?GraphQL::Schema
back toGraphQL::Language::Document
node. This mean tracking our extensions in some way or form so we can print it back. CheckGraphQL::Language::DocumentFromSchemaDefinition
andGraphQL::Schema::Printer
Questions
.fields
on an ObjectType should it return all the fields?Proposal for extensions
Extensions come after the fact,i.e. they should extend an existing type. However I have no clue how to do this elegantly. It's not like an interface where it gets implemented.
Sample: 1 Pure after the fact thing
Another way is to implement it like an interface, but that's not really what it is.
How is the JS world tackling this
tldr;; They have an extendSchema that extends the schema
extend
definition graphql/graphql-js#922