Skip to content

Make graphiql log more in verbose mode #5991

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

dmerand
Copy link
Contributor

@dmerand dmerand commented Jun 16, 2025

WHY are these changes introduced?

To improve debugging capabilities for GraphiQL server operations in the CLI, making it easier to diagnose issues with token refresh and GraphQL requests.

WHAT is this pull request doing?

Adds detailed debug logging throughout the GraphiQL server implementation:

  • Logs token refresh URL, request body (with redacted secrets), and response status
  • Logs GraphQL endpoint information and request details
  • Adds request timing measurements to track performance
  • Captures and logs error details for failed requests
  • Logs response bodies to help with troubleshooting

These logs are sent to the debug output stream, making them available when running with debug mode enabled.

How to test your changes?

  1. Run the CLI with debug mode enabled: DEBUG=* shopify dev
  2. Open the GraphiQL interface and execute some queries
  3. Check the debug output for the new detailed logs about token refresh and GraphQL requests
  4. Intentionally cause an error (e.g., by using an invalid token) to verify error logging

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

dmerand commented Jun 16, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.08% (-0.09% 🔻)
12494/16002
🟡 Branches
72.31% (+0% 🔼)
6076/8403
🟡 Functions
78.32% (-0.06% 🔻)
3265/4169
🟡 Lines
78.51% (-0.09% 🔻)
11823/15059
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / server.ts
1.02% (-0.23% 🔻)
0% 0%
1.06% (-0.25% 🔻)
🟢
... / Dev.tsx
90.59% (-2.35% 🔻)
75% (-1.79% 🔻)
86.36% (-4.55% 🔻)
92.5% (-1.25% 🔻)

Test suite run success

2884 tests passing in 1254 suites.

Report generated by 🧪jest coverage report action from 7b6c644

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.

1 participant