-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Schema Coordinates functions documentation #998
base: source
Are you sure you want to change the base?
Conversation
One thing that's a bit of an open question for me is the "Schema Coordinate AST":
This seems like a new thing we'll need to come up with - which makes sense. Ideally i'd like to be able to turn each branch in the spec (https://github.com/graphql/graphql-spec/pull/794/files#diff-30a69c5a5eded8e1aea52e53dad1181e6ec8f549ca2c50570b035153e2de1c43R257) into possible ASTs and just follow that. However, we need to deal with schema coordinates in an abstract way. At parse time, for
Which is p ugly, but it seems like we need to invent something here. (The spec just uses the abstract 'Name'.) Thoughts? |
For
|
This was my point during WG. We don't need to distinguish between objects and interfaces since they have the exact same form of coordinates. But I think it worth to use something like
|
|
Coming back to this! Thanks for the detailed thoughts y'all :)
Sounds like we have two votes for changing direction here a little bit - and using something like fwiw I'm personally not bothered by the fact Let's use @benjie I assume this will affect operation expressions too. Will using
|
ok here's an early sketch of what I have so far for the nodes: https://gist.github.com/magicmark/16bd0d7fbb987fc7f75b536993bdbaa5 (warning: i am dumb frontend developer. No real idea what i'm doing here other than snooping on prior art within graphql-js and other languages on astexplorer.net, please bear with me :D) |
I can't think of an issue with operation expressions/enums explicitly, but a field and an enum value are sufficiently distinct concepts that I think using a separate separator (e.g. |
Addresses graphql/graphql-wg#581
Description
Schema Coordinates are being proposed as a way to uniquely identify a specific type, field, argument, enum value, or directive defined in a GraphQL Schema.
In order to move to Stage 2, we need to add functions for parsing/printing schema coordinates to graphql-js.
This PR sketches out the interface for the functions I'll be working on. I'm making a PR now to share this early on, before the real implementation so we can hash out the naming/arguments etc.
cc @IvanGoncharov