Skip to content

GraphQL Aliases #22

@travis-r6s

Description

@travis-r6s

Is there anyway to specify an alias in the query object?

My use case - I have a list of product ID's that I want to fetch from shopify. I want to fetch the products all at once, so would usually programatically create a gql string like so:

query products {
  [id]: product (...) {..}
  [id]: product (...) {..}
  [id]: product (...) {..}
  [id]: product (...) {..}
  ...
}

I can create an object similar to the above to pass into query, but obviously can't have multiple product: [{}] as they are duplicate keys. Or perhaps there is a way to create a chain with a number of queries?

Hope that makes sense..?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions