cli
cli copied to clipboard
Access GraphiQL on remote URL
WHY are these changes introduced?
Fixes #4223
We aren't able to access GraphiQL on a remote environment because the localhost URL is hardcoded.
WHAT is this pull request doing?
Pulls the URL from the request context, so even if it's behind a tunnel or proxy, the URLs will be correctly formed from the perspective of the browser.
How to test your changes?
- Run an HTTPS tunnel to
localhost:3457 p shopify app dev --path /path/to/your/app --graphiql-key=abcdef- Hit
gto open up GraphiQL. It will give an error page. Add?key=abcdefto your URL and then it should work. - Replace
localhost:3457with your tunnel URL on https. Everything should still work properly, including firing a GraphQL query. - Try uninstalling your app and going through the install flow from GraphiQL. Things should work as normal.
Measuring impact
How do we know this change was effective? Please choose one:
- [x] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
- [ ] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've considered possible documentation changes
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 73.28% (+0.09% πΌ) |
8209/11203 |
| π‘ | Branches | 69.65% (-0.01% π») |
3990/5729 |
| π‘ | Functions | 71.85% (+0.03% πΌ) |
2149/2991 |
| π‘ | Lines | 73.6% (+0.1% πΌ) |
7764/10549 |
Show files with reduced coverage π»
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π΄ | ... / server.ts |
1.28% (-0.02% π») |
0% | 0% | 1.35% (-0.02% π») |
| π’ | ... / ConcurrentOutput.tsx |
98.39% (-1.61% π») |
90.91% (-4.55% π») |
100% | 98.33% (-1.67% π») |
Test suite run success
1854 tests passing in 846 suites.
Report generated by π§ͺjest coverage report action from ef1a724ff4c32b62d2e06a286a7c40dbaa392769
I'm electing to leave out a changeset, as we have not fully documented this feature yet - we still hide the --graphiql-key param and aren't documenting it. We need to make some time eventually to publish some sort of guide to how to use GraphiQL in app dev in the cloud.