-
Notifications
You must be signed in to change notification settings - Fork 224
feat(graphiql): add shared types, constants, and validation #6579
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
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report
Test suite run success3385 tests passing in 1385 suites. Report generated by 🧪jest coverage report action from 9296984 |
0093e1f to
7bb8bbe
Compare
b3a1ffc to
b199d75
Compare
7bb8bbe to
6ad1b53
Compare
b199d75 to
f14423d
Compare
f14423d to
2fd515e
Compare
6ad1b53 to
b3d377e
Compare
2fd515e to
8c2c496
Compare
b3d377e to
16966e2
Compare
d5b6f9a to
3274ef0
Compare
16966e2 to
732bdea
Compare
Adds type definitions, configuration validation with XSS prevention, and default GraphQL query constants. - Add GraphiQL config type definitions - Add default welcome message and shop query constants - Add config validation with security checks (313 lines of tests) - Prevent XSS attacks through URL validation and string sanitization All validation tests pass
732bdea to
705da8c
Compare
3274ef0 to
9296984
Compare
|
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. |

WHY are these changes introduced?
This PR builds on the foundation from PR #6578 by establishing the core type system, configuration validation, and default content for the GraphiQL console. This is the second PR in the 8-PR migration stack.
Context: The GraphiQL console will receive configuration from the Rails server via
window.__GRAPHIQL_CONFIG__. This configuration includes URLs, API endpoints, and user data. We need:WHAT is this pull request doing?
This PR adds the type definitions, security validation layer, and default content that will be used throughout the GraphiQL application.
Key Changes:
1. Type Definitions (
src/types/config.ts):GraphiQLConfiginterface defining all configuration fieldsapiVersion,apiVersions,appName,appUrl,storeFqdnbaseUrlquery,variables,defaultQuerieswindow.__GRAPHIQL_CONFIG__2. Security Validation (
src/utils/configValidation.ts):*.myshopify.comdomainsSecurity Patterns Blocked:
3. Default Content (
src/constants/defaultContent.ts):Files Added:
src/types/config.ts- TypeScript interfacessrc/constants/defaultContent.ts- Welcome message and default querysrc/utils/configValidation.ts- Security validation (153 lines)src/utils/configValidation.test.ts- Security tests (313 lines)Dependencies
Builds on: PR #6578 (package foundation)
How to test your changes?
Measuring impact
Checklist