GAP-4 Add Field Extensions Spec - #4
Conversation
So is the idea to compile this out of the SDL before passing to a GraphQL server? |
Yes |
|
I think this would benefit then from being layered on top of the soon-to-be-proposed language in the spec to clarify the difference between "human written"(?) schemas and "runtime" schemas. Not required for this to merge, but worth following along! @benjie wdyt about a dedicated 2xxx range for "language and syntax extensions"? side note, not directly relevant to this proposal but:
|
mjmahone
left a comment
There was a problem hiding this comment.
Ugh as a GAP proposal figuring out the difference between a field extension and an original field definition inside an extension is tough, because I think we must have some kind of syntax, or at least a special directive.
I ran into a bunch of bugs before getting an internal representation where fields can be pure extensions, and I still have unresolvable bugs in going from SDL => SchemaSet (then do work on that set) => SDL. It's very frustrating.
#33) I have been working on a lot of operations that benefit from treating the GraphQL Schema as a Set. For context, see changes in the Relay schema-set crate: https://github.com/facebook/relay/tree/main/compiler/crates/schema-set One of the core issues is there's no syntax I can use to get partial sets. For example I can have a type-definition and field definition removed, but there is still an argument on the field present. This proposes to solve that through syntax that looks like: ``` extend type Person { extend field(argument: String) @deprecated } ``` We could get into this state if we did something like: ``` type Person { field(argument: String): String @deprecated } ``` **exclude** ``` type Person { field: String } ``` This proposal should give a *syntax* that we could use in @egoodwinx's proposal in #4
|
@magicmark @egoodwinx can we get that one merged in? I recognize this is probably not the perfect endgame solution but it's serving us well and we have this implemented in Apollo Kotlin. Would be cool to be able to have a GAP number attached to it. |
|
@martinbonnin good to merge pending some fiddly process things (apologies):
|
|
@egoodwinx I took the liberty of rebasing your last two commits so 32e22ef now includes deletion of GAP-2 (7f7e887 only added the new files, didn't remove the old) so it shows up in history as a rename now. |
Whoops - thanks! I ran the prettier command and it reformatted all the files for some reason so I must have missed it. |
Copied from graphql/graphql-spec#1196 and graphql/graphql-spec#1162