Skip to content

Updates to schema coordinates (#3044) #4422

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

Merged
merged 18 commits into from
Jun 5, 2025

Conversation

magicmark
Copy link

@magicmark magicmark commented May 31, 2025

Updates to #3044

Implements the new spec changes:

  • Split apart the AST nodes and parsing for the new coordinate types (FieldCoordinate, ArgumentCoordinate etc)
  • Added MyEnum::value separator syntax
  • Explicit error handling for "containing elements"
  • (todo?) throw on returning meta-fields

@magicmark magicmark requested a review from a team as a code owner May 31, 2025 03:57
Copy link

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this ❤️

@JoviDeCroock
Copy link
Member

JoviDeCroock commented May 31, 2025

Code looks good, mainly feeling conflicted about conflating enum-members and type-fields. Input-fields and type-fields feel similar compared to enum-members

magicmark and others added 9 commits May 31, 2025 23:15
- Add error handling as proposed by Benjie
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
Co-authored-by: Benjie <benjie@jemjie.com>
@magicmark magicmark mentioned this pull request Jun 2, 2025
@benjie
Copy link
Member

benjie commented Jun 5, 2025

@JoviDeCroock has a good point, and perhaps it would actually be better to represent this in the schema coordinates syntax itself:

Type # Any named type
Type.field # A field (e.g. on an object, interface, or inputObject type)
Type.field(argName:) # An argument (on an object or interface type)
Type::value # an Enum value

:: is the syntax used to reference an enum value in C++, Rust, PHP, Perl and others.

@benjie
Copy link
Member

benjie commented Jun 5, 2025

I have raised magicmark/graphql-spec#1; if we agree then I'll also make these changes to this branch and get it merged into #3044

@magicmark
Copy link
Author

magicmark commented Jun 5, 2025

ack. @benjie done! added the enum changes.

@magicmark magicmark changed the title Add intermediate nodes for schema coordinate parsing Updates to schema coordinates (https://github.com/graphql/graphql-js/pull/3044) Jun 5, 2025
@magicmark magicmark changed the title Updates to schema coordinates (https://github.com/graphql/graphql-js/pull/3044) Updates to schema coordinates (#3044) Jun 5, 2025
@benjie
Copy link
Member

benjie commented Jun 5, 2025

Merging this even though it doesn't pass CI under the instruction of the champion 👍

@benjie benjie merged commit bbc3dfa into graphql:schema-coordinates Jun 5, 2025
12 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants