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

Shopify headers stripped from Remix GraphQL client responses #637

Open
hsdonkin opened this issue Feb 8, 2024 · 3 comments
Open

Shopify headers stripped from Remix GraphQL client responses #637

hsdonkin opened this issue Feb 8, 2024 · 3 comments

Comments

@hsdonkin
Copy link

hsdonkin commented Feb 8, 2024

Issue summary

Shopify headers like x-request-id are missing from the GraphQL client responses. It looks like these headers were originally passed on to the Response object returned by query() , but aren't included anymore

2e56ff3#diff-047f59df7546492ff3ec1669214d3aa77d47fb12c6488529d0366479a3a06f0eR30

  • @shopify/shopify-app-remix@2.4.0
  • Node version: 18
  • Operating system: OSX
// on 2.4.0

13:16:02 │ remix    │ Response {
13:16:02 │ remix    │   size: 0,
13:16:02 │ remix    │   [Symbol(Body internals)]: {
13:16:02 │ remix    │     body: ReadableStream {
13:16:02 │ remix    │       _state: 'readable',
13:16:02 │ remix    │       _reader: undefined,
13:16:02 │ remix    │       _storedError: undefined,
13:16:02 │ remix    │       _disturbed: false,
13:16:02 │ remix    │       _readableStreamController: [ReadableStreamDefaultController]
13:16:02 │ remix    │     },
13:16:02 │ remix    │     type: 'text/plain;charset=UTF-8',
13:16:02 │ remix    │     size: 468,
13:16:02 │ remix    │     boundary: null,
13:16:02 │ remix    │     disturbed: false,
13:16:02 │ remix    │     error: null
13:16:02 │ remix    │   },
13:16:02 │ remix    │   [Symbol(Response internals)]: {
13:16:02 │ remix    │     url: undefined,
13:16:02 │ remix    │     status: 200,
13:16:02 │ remix    │     statusText: '',
13:16:02 │ remix    │     headers: { 'content-type': 'text/plain;charset=UTF-8' },
13:16:02 │ remix    │     counter: 0,
13:16:02 │ remix    │     highWaterMark: undefined
13:16:02 │ remix    │   }
13:16:02 │ remix    │ }


// on 2.2.0

13:25:25 │ remix │ [shopify-app/INFO] Authenticating admin request
13:25:26 │ remix │ Response {
13:25:26 │ remix │   size: 0,
13:25:26 │ remix │   [Symbol(Body internals)]: {
13:25:26 │ remix │     body: ReadableStream {
13:25:26 │ remix │       _state: 'readable',
13:25:26 │ remix │       _reader: undefined,
13:25:26 │ remix │       _storedError: undefined,
13:25:26 │ remix │       _disturbed: false,
13:25:26 │ remix │       _readableStreamController: [ReadableStreamDefaultController]
13:25:26 │ remix │     },
13:25:26 │ remix │     type: 'text/plain;charset=UTF-8',
13:25:26 │ remix │     size: 461,
13:25:26 │ remix │     boundary: null,
13:25:26 │ remix │     disturbed: false,
13:25:26 │ remix │     error: null
13:25:26 │ remix │   },
13:25:26 │ remix │   [Symbol(Response internals)]: {
13:25:26 │ remix │     url: undefined,
13:25:26 │ remix │     status: 200,
13:25:26 │ remix │     statusText: '',
13:25:26 │ remix │     headers: {
13:25:26 │ remix │       'alt-svc': 'h3=":443"; ma=86400',
13:25:26 │ remix │       'cf-cache-status': 'DYNAMIC',
13:25:26 │ remix │       'cf-ray': '8526f1f4886d8e60-PDX',
13:25:26 │ remix │       connection: 'close',
13:25:26 │ remix │       'content-encoding': 'br',
13:25:26 │ remix │       'content-language': 'en',
13:25:26 │ remix │       'content-security-policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' 
https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self'
 wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com 
https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com 
https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com 
https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 
'unsafe-eval'; upgrade-insecure-requests; report-uri 
/csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsecti
on%5D=admin_api&source%5Buuid%5D=50f7e8b7-41cd-42dd-abac-4df8a122e8a8",
13:25:26 │ remix │       'content-type': 'application/json; charset=utf-8',
13:25:26 │ remix │       date: 'Thu, 08 Feb 2024 21:25:26 GMT',
13:25:26 │ remix │       nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
13:25:26 │ remix │       'referrer-policy': 'origin-when-cross-origin',
13:25:26 │ remix │       'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=mrjx
0GmH4BUwO533Kou9rgtprz6PKCRCNNbStYOeJ88SGARauwMxEgiOzDc3HOcqcNDEy1GjgVSTb5CZGFebfcQtUbj%2BD%2BsctwyK7FO%2Bage%2BrS
cma5Uwqwxav0IUqgbY25evDMFIA%2FuY8Yscbg%3D%3D"}],"group":"cf-nel","max_age":604800}',
13:25:26 │ remix │       server: 'cloudflare',
13:25:26 │ remix │       'server-timing': 'processing;dur=233, graphql;desc="admin/mutation/other", 
cfRequestDuration;dur=331.000090',
13:25:26 │ remix │       'strict-transport-security': 'max-age=7889238',
13:25:26 │ remix │       'transfer-encoding': 'chunked',
13:25:26 │ remix │       vary: 'Accept-Encoding',
13:25:26 │ remix │       'x-content-type-options': 'nosniff',
13:25:26 │ remix │       'x-dc': 'gcp-us-west1,gcp-us-east1',
13:25:26 │ remix │       'x-download-options': 'noopen',
13:25:26 │ remix │       'x-envoy-upstream-service-time': '235',
13:25:26 │ remix │       'x-frame-options': 'DENY',
13:25:26 │ remix │       'x-permitted-cross-domain-policies': 'none',
13:25:26 │ remix │       'x-request-id': '50f7e8b7-41cd-42dd-abac-4df8a122e8a8',

Expected behavior

When logging responses from the GraphQL client, headers like x-request-id should be included on the response

Actual behavior

No headers are returned on response

Steps to reproduce the problem

  1. npm init @shopify/app@latest
  2. console.log(await admin.graphql( ... ))
  3. No response headers included
  4. npm i @shopify/shopify-app-remix@2.2.0
  5. Headers included
@matteodepalo
Copy link
Contributor

Hi @hsdonkin, thank you for opening this issue. We can definitely look into adding headers back to the response, I'll add this to our backlog.

@hsdonkin
Copy link
Author

hsdonkin commented Feb 9, 2024

Cheers Matteo! It's giving me a really bad time with Shopify support right now because they keep asking about the x-request-id for other issues I'm having

Copy link
Contributor

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

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

No branches or pull requests

2 participants