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

Added check for graphql extensions.cost.throttleStatus #366

Merged
merged 3 commits into from Apr 1, 2020

Conversation

mete89
Copy link
Contributor

@mete89 mete89 commented Apr 1, 2020

Shopify doesn't return throttleStatus for "staff" plan which causes the error below.

TypeError: Cannot read property 'currentlyAvailable' of undefined
at Shopify.updateGraphqlLimits (/var/app/current/node_modules/shopify-api-node/index.js:191:31)
at /var/app/current/node_modules/shopify-api-node/index.js:234:12
at tryCatcher (/var/app/current/node_modules/bluebird/js/release/util.js:16:23)

Shopify doesn't return throttleStatus for "staff" plan which causes the error below.

TypeError: Cannot read property 'currentlyAvailable' of undefined
    at Shopify.updateGraphqlLimits (/var/app/current/node_modules/shopify-api-node/index.js:191:31)
    at /var/app/current/node_modules/shopify-api-node/index.js:234:12
    at tryCatcher (/var/app/current/node_modules/bluebird/js/release/util.js:16:23)
@lpinca
Copy link
Collaborator

lpinca commented Apr 1, 2020

Can you do something like this

if (!header) return;

instead for consistency with Shopify.prototype.updateLimits()?

Thanks.

throttleStatus check moved into updateGraphqlLimits function
@mete89
Copy link
Contributor Author

mete89 commented Apr 1, 2020

Hi @lpinca,

Does it look good now?

@lpinca
Copy link
Collaborator

lpinca commented Apr 1, 2020

Yes but please fix the lint error.

lpinca
lpinca approved these changes Apr 1, 2020
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 20fef8a on mete89:graphql-missing-throttle-status into 3af24fa on MONEI:master.

@lpinca lpinca merged commit 07308c2 into MONEI:master Apr 1, 2020
@lpinca
Copy link
Collaborator

lpinca commented Apr 1, 2020

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants