Skip to content
This repository was archived by the owner on Sep 14, 2026. It is now read-only.
This repository was archived by the owner on Sep 14, 2026. It is now read-only.

withAlias adds field name to alias name #61

Open

Description

@jens-josh

q.withAlias("alias").field();

produces the graphql:

field_alias: field

I'd expect it to produce

alias: field

See startField()
https://github.com/Shopify/graphql_java_gen/blob/master/support/src/main/java/com/shopify/graphql/support/Query.java#L66

Activity

  1. dylanahsmith commented on Dec 22, 2022

    @dylanahsmith
    Contributor

    Don't you mean the alias name would end up being field__alias in your example.
    It preserves the original field name so that it can be obtained on the response to parse it with this library, with the assumption that the alias is there so the field can be queried more than once.

  2. jens-josh commented on Jan 4, 2023

    @jens-josh
    Author

    If that's by design, then maybe we can have a variant of withAlias that generates the alias as requested?

  3. dylanahsmith commented on Jan 10, 2023

    @dylanahsmith
    Contributor

    That would break response parsing, which isn't done with access to the original request.

    Do you have an actual use case for being able to avoid the field name prefix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions