Skip to content

Sorting in Front-end API? #176

Answered by rodrigoddalmeida
Kealtie asked this question in Help
Discussion options

You must be logged in to vote

You can sort products by name, price on our Frontend APIs with the following:

  • Swell.js
await swell.products.list({
  sort: "name asc, price asc",
});
  • GraphQL
query {
  products(sort: "name asc, price asc") {
    results {
      ...
    }
  }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Kealtie
Comment options

@rodrigoddalmeida
Comment options

Answer selected by rodrigoddalmeida
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants