-
Notifications
You must be signed in to change notification settings - Fork 163
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
How to I get the shop id without having to do a query or api request ? #846
Comments
You can get it from session: const shopDomain = session.shop; Edit: I did not read well, the "id" is not possible to get without query, there are other disscusions about the topic |
Hi @thangpqgm, thank you for opening this issue. I'm going to put it in front of the team for discussion. |
I want to know if it's safe to use this "shop" field as a store identifier, for scenarios like storing whether a shop is VIP or how many credits it has. Otherwise, wouldn't we need to retrieve a shopId again in each loader? |
Hey everyone 👋 We chatted about this issue as a team but it was not clear to use exactly what the use case is. We understand you want the ID of the shop, but why? If you can frame the requirement in terms of a user flow or a business casse that would really help us decided how to address this. |
Judging by the recently released subscriptions reference app, it seems like it's safe to use The prisma schema contains
|
Currently, I can get the shop domain in the session but I can't get the shop id.
I have to do a query into the session table to get the shop id, which is really annoying,
Getting the shop ID by calling rest API or graph ql also has the same cost.
I thought about saving the shop ID in a cookie but it seems impossible because the admin app is wrapped in an iframe tag,
So is there a simpler way for me to get the shop id in the loader?
The text was updated successfully, but these errors were encountered: