hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Add comprehensive CI validations for various potential GraphQL issues

Open kdaviduik opened this issue 4 months ago • 1 comments

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?

  1. Create a branch based on my branch that adds in an unused GraphQL fragment
  2. Push up your branch and validate that CI fails
  3. Switch the base of your branch to a branch without my CI validations
  4. Force push your branch and validate that CI passes (hiding the issue)

Here are some examples:

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

kdaviduik avatar Aug 22 '25 22:08 kdaviduik