You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have Query.primaryShopId and Query.shopById. A client currently needs two requests to those to get the primary shop data, which is the most common case and happens all the time on first load. We can simplify this for client development by creating Query.primaryShop, which combines those two lookups on the server (and reduces to a single DB query).
The text was updated successfully, but these errors were encountered:
How do we know which primary shop is desired if there's more than one shop? The existing primaryShopID query doesn't have input parameters. How would this query work in a multi-shop/multi-site setup, where shops are siblings? Ex: shop1.com & shop2.com?
Which GraphQL client would use this in our current starterkit configuration - the browser or the SSR application?
Is the response data required to get the rest of the page in most cases? One request is better than two but it's not great to have a blocking request for bootstrap info.
Can we leverage SSR to fetch the info on the server side and bootstrap the application with static data sent in the page on first request?
The SSR could also inspect the request (domain, path, etc) to determine which shop is desired based on routing rules. That data would be highly cacheable.
@ticean
The way that our current marketplace/multi-shop setup works is that each installation must have exactly one primary shop. There can be any number of other shops, but only one primary shop. I believe this is currently hard-coded to the first shop that is created, though I'm not certain about this.
We can discuss how we'd like improve this but I believe this issue is mostly about creating a helper query that simplifies the lookup of that primary shop (which is the only shop in a single shop installation)
We have
Query.primaryShopId
andQuery.shopById
. A client currently needs two requests to those to get the primary shop data, which is the most common case and happens all the time on first load. We can simplify this for client development by creatingQuery.primaryShop
, which combines those two lookups on the server (and reduces to a single DB query).The text was updated successfully, but these errors were encountered: