A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Apologies for double- or at least 1.5-x-posting but I cannot move my original post and I don't think it'll get visibility in its location 😬
I've tried a bunch of other things since then but no luck. Here's the gist: The embedded app from the tutorial calls ´products/count´ via
useAppQuery({
url: "/api/products/count", // that's the only important part
but whenever I try any other REST endpoint (products, orders, products/all) I receive a 400 BAD REQUEST response with a "no shop provided" body. How do I "provide" the shop and why? This is all happening from within an embedded app and obviously none of the other parameters change between count and the broken one (minus some time-stampy things).
I've been having the same problem with the QRCode sample app and just got it working. I don't have any explanation other than maybe there is a caching issue. But first i renamed an existing endpoint (might not be necessary) and restarted the app and then removed all other api middlewares from express and just added my new endpoint and now it works.
app.use("/api/*", shopify.validateAuthenticatedSession());
app.use(express.json());
// applyQrCodeApiEndpoints(app);
// applyQrCodePublicEndpoints(app);
applyOrdersApiEndpoints(app); // new endpoints
I imagine i could now add the other endpoints back in perhaps although i haven't tried that.