smallrye / smallrye-graphql

Implementation for MicroProfile GraphQL
Apache License 2.0
155 stars 89 forks source link

how to add Alias to returned field name? #2096

Closed AzaliyaUfa closed 1 month ago

AzaliyaUfa commented 3 months ago

with io.smallrye.graphql.client.core.utils.validation.NameValidation.validateFieldName(NameValidation.java:85) it became impossible to return "required_name: name" construction in Field.field

mskacelik commented 3 months ago

Hmm, it seems that the cause of the exception is the white space after the colon. So deleting it would fix the issue.

That being said, GraphQL specification has white space as part of the Ignored Tokens https://spec.graphql.org/draft/#sec-Language.Source-Text.Ignored-Tokens.

So, If you want, we can add this feature so the name validation will ignore all the ignored tokens around the Lexical Tokens.

AzaliyaUfa commented 3 months ago

thank you so much, it really fixed the problem! but adding the option to set an Alias to the field would being great))

jmartisk commented 1 month ago

fixed by https://github.com/smallrye/smallrye-graphql/pull/2118