-
Notifications
You must be signed in to change notification settings - Fork 124
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
[Bug] Not getting GraphQL errors with newest updates. #577
Comments
Why would the request even be throwing? Looking at the docs for v9 here, it seems that a error object should be returned in these cases This is the function determining to throw: https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/lib/clients/common.ts#L60 |
It might just be me but I have a really hard time navigating your packages. Anyhow, according to this release note @shopify/shopify-app-remix should have support for the new clients. And according to this commit in the remix app template, some work have been done to support the type generation. However, I cannot figure out if the loop have been closed to support the new clients. @lizkenyon This morning I did more testing, and I cannot get any proper errors using the admin query interface. |
Hey, thanks for raising this! Before v9, the GQL client would always throw a I'm having a little bit of trouble identifying where we would return an error object prior to v9. Could you please share a code sample from before you upgraded your app so I can have a better idea of what we might have broken? If there is a difference in behaviour, we would definitely want to fix it. |
Hi, I think a PR was just created by some of your colleagues that fixes this in @shopify-api-js here: Shopify/shopify-api-js#1146 If this doesn't work, I'll get back to you with details. /Magnus |
@paulomarg I am still not certain how all these packages are interconnected. Can you think of an easy way for me to test the effect of the linked PR? |
Hey! So, what we did recently was to create packages which are standalone clients:
This way, apps can use only the clients if they're not interested in the other bits (e.g. if your app doesn't need other features from I also think you're right - if all you wanted was access to the body (or the errors inside it), that PR will make it possible to use it again in the thrown |
The PR fixed my issue — thanks. |
Amazing, I'm closing this then! |
(I also posted this on the remix template but I think this is probably the right place)
After upgrading to shopify-api v9.0.1 and shopify-app-remix v2.3.0 I am not getting correct graphql errors. Usually I receive an error object with error codes and extensions data. Is the request handled correctly by shopify-app-remix? I am just querying with await admin.graphql(…).
Now this is response when max query cost is exceeding:
The text was updated successfully, but these errors were encountered: