GraphQL responses authentication html page instead of json

Solved
manhnq94
Excursionist
30 1 5

Hi everyone,

Sometimes my GraphQL query requesting for product info responses with an authentication html page and I don't know why this is happened. It occurs randomly once every 1-2 days, and yesterday I got 48 responses like this. I don't think this problem related to the query because it worked fine for most of the times.

The following is my request and response, please help me check why I got this html response instead of json format.

Request :

graphQLquery = """
	query ($productID: ID!){
		product(id: $productID) {
			id
			tags
			handle
			productType
		}
	}
"""
variables = {
	"productID": f'gid://shopify/Product/{product_id}'
}

Response :

<html>
	<body>
		<noscript>
			<a href="https://accounts.shopify.com/oauth/authorize?client_id=cant_show&amp;destination_uuid=cant_show&amp;nonce=39dc17984c5382a5a9829c8227f55609&amp;prompt=merge&amp;redirect_uri=https%3A%2F%2Fcant_show%2Fadmin%2Fauth%2Fidentity%2Fcallback&amp;response_type=code&amp;scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage&amp;state=cb7ddd31c6c499d094bb97fffe37e878&amp;ui_locales=en&amp;ux=shop%20new_design_language">Continue</a>
		</noscript>
		<script type="text/javascript" defer>
			window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?client_id=cant_show\u0026destination_uuid=cant_show\u0026nonce=39dc17984c5382a5a9829c8227f55609\u0026prompt=merge\u0026redirect_uri=https%3A%2F%2Fcant_show%2Fadmin%2Fauth%2Fidentity%2Fcallback\u0026response_type=code\u0026scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage\u0026state=cb7ddd31c6c499d094bb97fffe37e878\u0026ui_locales=en\u0026ux=shop%20new_design_language";
		</script>
	</body>
</html>

GraphQL_ERR.PNG

Thanks.

Accepted Solution (1)
syf_
Shopify Staff
Shopify Staff
95 21 23

This is an accepted solution.

Hi @manhnq94,

This was a known issue that occurred on Jan 5, 2021 which was resolved, and you should no longer be experiencing such errors, see this thread.

If you're still encountering such errors, please provide us with a request id (found in the response header) and we will look into the issue further.

 

Thanks,

Seth.

 

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 5 (5)
syf_
Shopify Staff
Shopify Staff
95 21 23

This is an accepted solution.

Hi @manhnq94,

This was a known issue that occurred on Jan 5, 2021 which was resolved, and you should no longer be experiencing such errors, see this thread.

If you're still encountering such errors, please provide us with a request id (found in the response header) and we will look into the issue further.

 

Thanks,

Seth.

 

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

manhnq94
Excursionist
30 1 5

Thank you for quick update,

If I still encounter this issue, I'll let you know.

bestrada
Tourist
12 2 1

hi @syf_ this is happening to me now.

shopify instance = thelivingfresh.myshopify.com

request id = "ea619be6-5ea6-460b-a0a1-fbdfb546ed72"

here is the query i am trying to execute:

 

    {
      product(id:"gid://shopify/Product/6799445131456") {
        variants(first:24) {
          edges {
            node {
              metafield(namespace:"fanrock-dtc", key:"images") {
                value
              }
            }
          }
        }
      }
    }

 

syf_
Shopify Staff
Shopify Staff
95 21 23

@bestrada,

it seems the request you were making wasn't properly authenticated so you were redirected to a login page. Could you confirm for me if you're still experiencing this.

Thanks,
Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

HDK
Shopify Partner
11 0 3

We are occasionally encountering a very similar problem, getting a "There was a problem loading this website" html- response instead of json, for example while creating a product. Even worse, randomly the calls seems to do what is was supposed to do (creating a product), but due to the missing response there is no confirmation, resulting in creating the same product over and over again.