Skip to content

Updates to schema coordinates (#3044)#4422

Merged
benjie merged 18 commits into
graphql:schema-coordinatesfrom
magicmark:schema-coordinates
Jun 5, 2025
Merged

Updates to schema coordinates (#3044)#4422
benjie merged 18 commits into
graphql:schema-coordinatesfrom
magicmark:schema-coordinates

Conversation

@magicmark

@magicmark magicmark commented May 31, 2025

Copy link
Copy Markdown
Contributor

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
Comment thread src/language/parser.ts Outdated

@martinbonnin martinbonnin left a comment

Copy link
Copy Markdown
Contributor

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 ❤️

Comment thread src/language/ast.ts Outdated
Comment thread src/language/parser.ts Outdated
Comment thread src/language/ast.ts Outdated
@JoviDeCroock

JoviDeCroock commented May 31, 2025

Copy link
Copy Markdown
Contributor

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

benjie commented Jun 5, 2025

Copy link
Copy Markdown
Member

@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

benjie commented Jun 5, 2025

Copy link
Copy Markdown
Member

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

magicmark commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

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

benjie commented Jun 5, 2025

Copy link
Copy Markdown
Member

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