Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api.getPage() ignores some options on production #119

Open
mattcoy-arcticleaf opened this issue Mar 17, 2020 · 4 comments
Open

api.getPage() ignores some options on production #119

mattcoy-arcticleaf opened this issue Mar 17, 2020 · 4 comments

Comments

@mattcoy-arcticleaf
Copy link

When specifying options for a getPage request, such as limit, you are able to see the expected results on localhost. However, when the theme is bundled and pushed to the live store, the options no longer work (they are overridden by options set in the front matter for the page).

For example, if I run the following function in localhost, it will return 100 products, but on the live site, it will return the number of products specified in the category.html YAML:

getProducts

There is a more thorough explanation written here (not by me): https://support.bigcommerce.com/s/question/0D51B00003sQyL1/stencilutils-api-getpage-options-issue

Any chance this can be fixed so we can specify options within our requests that differ from those specified in the front matter?

@mattcoy-arcticleaf
Copy link
Author

@junedkazi , Any idea if this can be resolved? We have a store where we need these options to work.

@bookernath
Copy link
Contributor

@mattcoy-arcticleaf we're not sure if this has ever worked in production, it might be an area where CLI can do something that our production server won't do.

I'm curious about the use case though - is the GraphQL Storefront API a better option for fetching data for 100 products, perhaps?

You might use a query like

  site {
    route(path: "/shop-all") { //category URL
      node {
        ... on Category {
          products(first: 50) {
            pageInfo {
              hasNextPage
              startCursor
              endCursor
            }
            edges {
              node {
                name //any product fields you need
              }
            }
          }
        }
      }
    }
  }
}

@mattcoy-arcticleaf
Copy link
Author

@bookernath , sorry for the confusion. I was posting the products as a quick and concise example. My exact use case that I am trying to get working here is to get blog posts, which cannot be accessed by GraphQL.

@bookernath
Copy link
Contributor

Gotcha, thanks for the extra context. We're looking into this more today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants