Skip to content
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

Expose name and alias in LookAheadMethods #1199

Merged

Conversation

soerenmeier
Copy link
Contributor

Currently it is only possible to get the name or if an alias is present the alias, or I'm missing something.
This exposed the name and alias separately. I'm not sure about the name field_unique_name.

soerenmeier and others added 2 commits October 28, 2023 22:34
Currently it is only possible to get the name or if an alias is present
the alias. This allows to get the name and alias separately.
@tyranron tyranron added enhancement Improvement of existing features or bugfix k::api Related to API (application interface) labels Nov 2, 2023
@tyranron tyranron added this to the 0.16.0 milestone Nov 2, 2023
@tyranron
Copy link
Member

tyranron commented Nov 2, 2023

@soerenmeier I did some investigation on the naming and didn't find any consistency regarding the naming.

graphql-parse-resolve-info npm package has it in the following way:

  • name: the name of the GraphQL field
  • alias: the alias this GraphQL field has been requested as, or if no alias was specified then the name

graphql-ruby has only this:

#name ⇒ String(also: #graphql_name) readonly
The GraphQL name for this field, camelized unless camelize: false is provided.

#original_name ⇒ Symbol readonly
The original name of the field, passed in by the user.

So, I propose to remain field_unique_name as field_name, while the proposed field_name being named as field_original_name. This way, we'll preserve backwards compatibility and naming consistency over all the methods.

@tyranron tyranron enabled auto-merge (squash) November 2, 2023 12:30
@tyranron tyranron merged commit da005fc into graphql-rust:master Nov 2, 2023
167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants