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
TL;DR: custom shop domains cannot be used with this library, due to a wrong redirect handling.
Prerequisites:
shop A has a custom domain a.com
you have valid credentials for shop A to make API requests (tested by using the Location header of the redirect response)
The request to the GraphQL endpoint for shop A on a.com/... returns a 301 response and redirects to the shop's {shop}.myshopify.com host. The default redirect handling of a 301 response in node-fetch is to set the request method to GET. That results in a 404 response on the API (which I think is not optimal - see 405; but this is an API, not library issue).
Expected behavior
The Shopify API should return a 308 for this request.
The Shopify API client should handle the redirect for GraphQL requests to use a POST request again.
Actual behavior
The Shopify API returns a 301, which resets the request method to GET, as this is the node-fetch default.
Steps to reproduce the problem
I'd say, the explanation does a quite good job for this...
Other
This is partly a Shopify API issue. But the library should be able to handle this case (imo).
The text was updated successfully, but these errors were encountered:
Issue summary
Before opening this issue, I have:
@shopify/*
package and version:11.6.1
20.11.1
{ logger: { level: LogSeverity.Debug } }
in my configuration, when applicableTL;DR: custom shop domains cannot be used with this library, due to a wrong redirect handling.
Prerequisites:
A
has a custom domaina.com
A
to make API requests (tested by using theLocation
header of the redirect response)The request to the GraphQL endpoint for shop
A
ona.com/...
returns a301
response and redirects to the shop's{shop}.myshopify.com
host. The default redirect handling of a301
response in node-fetch is to set the request method toGET
. That results in a404
response on the API (which I think is not optimal - see 405; but this is an API, not library issue).Expected behavior
308
for this request.POST
request again.Actual behavior
301
, which resets the request method toGET
, as this is thenode-fetch
default.Steps to reproduce the problem
I'd say, the explanation does a quite good job for this...
Other
This is partly a Shopify API issue. But the library should be able to handle this case (imo).
The text was updated successfully, but these errors were encountered: