smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

how to add Alias to returned field name?

Open AzaliyaUfa opened this issue 1 year ago • 2 comments

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

AzaliyaUfa avatar Apr 25 '24 09:04 AzaliyaUfa

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.

mskacelik avatar Apr 25 '24 10:04 mskacelik

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

AzaliyaUfa avatar Apr 25 '24 10:04 AzaliyaUfa

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

jmartisk avatar Jun 10 '24 10:06 jmartisk