Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

A lot of data gets queried when hitting "more products" #621

Closed
NyanKiyoshi opened this issue Feb 21, 2020 · 0 comments · Fixed by #855
Closed

A lot of data gets queried when hitting "more products" #621

NyanKiyoshi opened this issue Feb 21, 2020 · 0 comments · Fixed by #855
Labels
backlog bug Something isn't working performance Something is not properly optimized and affecting performances, e.g. latency

Comments

@NyanKiyoshi
Copy link
Member

The following query will be triggered when wanting to display more products within a collection [or maybe category too]:

query Collection(
  $id: ID!
  $attributes: [AttributeInput]
  $after: String
  $pageSize: Int
  $sortBy: ProductOrder
  $priceLte: Float
  $priceGte: Float
) {
  collection(id: $id) {
    id
    slug
    name
    seoDescription
    seoTitle
    backgroundImage {
      url
      __typename
    }
    __typename
  }
  products(
    after: $after
    first: $pageSize
    sortBy: $sortBy
    filter: {
      attributes: $attributes
      collections: [$id]
      minimalPrice: { gte: $priceGte, lte: $priceLte }
    }
  ) {
    totalCount
    edges {
      node {
        ...BasicProductFields
        ...ProductPricingField
        category {
          id
          name
          __typename
        }
        __typename
      }
      __typename
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
      __typename
    }
    __typename
  }
  attributes(filter: { inCollection: $id }, first: 100) {
    edges {
      node {
        id
        name
        slug
        values {
          id
          name
          slug
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}

This is awfully slow and useless when dealing with a store having a lot of attributes. This should be reworked and optimized.

@NyanKiyoshi NyanKiyoshi added bug Something isn't working backlog performance Something is not properly optimized and affecting performances, e.g. latency labels Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog bug Something isn't working performance Something is not properly optimized and affecting performances, e.g. latency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant