hydrogen
hydrogen copied to clipboard
Add comprehensive CI validations for various potential GraphQL issues
WHY are these changes introduced?
A few days ago a PR introduced an unused GraphQL fragment. CI passed, but this produced immediate server errors. As a result, this PR adds in comprehensive CI validations to ensure that any subsequent PRs will have CI fail if there are known GraphQL issues.
WHAT is this pull request doing?
Ensures that:
- CI should fail if there are any unused GraphQL fragments
- Anything in the examples folder at the root of this repo will be skipped over as part of our newly added validations (ie: we don't want to validate those)
- CI should fail if ANY automatically generated .d.ts files in a given PR have been manually modified
- CI should fail if there are any types in a .d.ts file that do not exist in the Storefront API or Customer Account API GraphQL
HOW to test your changes?
- Create a branch based on my branch that adds in an unused GraphQL fragment
- Push up your branch and validate that CI fails
- Switch the base of your branch to a branch without my CI validations
- Force push your branch and validate that CI passes (hiding the issue)
Here are some examples:
- CI passes when adding in an unused fragment, BEFORE we have the new CI validations
- CI fails when adding in an unused fragment, AFTER we have the new CI validations
Post-merge steps
Checklist
- [x] I've read the Contributing Guidelines
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [ ] I've added a changeset if this PR contains user-facing or noteworthy changes
- [x] I've added tests to cover my changes
- [x] I've added or updated the documentation