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

Catalog search makes redundant call to API on initial load #770

Open
ayaanqui opened this issue Nov 5, 2021 · 0 comments
Open

Catalog search makes redundant call to API on initial load #770

ayaanqui opened this issue Nov 5, 2021 · 0 comments
Labels
🐛 bug Something isn't working 📖 catalog Anything related to the stock catalog pages 🌠 performance

Comments

@ayaanqui
Copy link
Collaborator

ayaanqui commented Nov 5, 2021

The catalog search page makes a useless call to the API with the default setQuery options, and once this result is loaded the intended API call is made, which needlessly slows down the fetching of the data and puts unnecessary load on the GraphQL server.

Recreating the problem

Go on to localhost:3000/stockcenter/strains and then analyse the network calls and check out the query with this as the POST request

{
  "operationName": "StrainList",
  "variables": {
    "cursor": 0,
    "limit": 10,
    "filter": ""
  },
  "query": "query StrainList(..."
}
@ayaanqui ayaanqui added 🐛 bug Something isn't working 🌠 performance 📖 catalog Anything related to the stock catalog pages labels Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📖 catalog Anything related to the stock catalog pages 🌠 performance
Projects
None yet
Development

No branches or pull requests

1 participant