Generate a full list of changes on schema check, and add an argument to filter change lists#7395
Conversation
Summary of ChangesHello @jdolle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the schema change detection and reporting capabilities. It addresses a limitation where nested schema changes were not fully captured, by modifying the schema check process to record all changes. Furthermore, it introduces a new GraphQL argument to allow clients to dynamically request either a comprehensive or a simplified list of schema changes, improving both accuracy and usability for schema evolution management. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| this.logger.debug('Comparing Schemas'); | ||
|
|
||
| const changes = await diff(existing, incoming, [DiffRule.simplifyChanges]); | ||
| const changes = await diff(existing, incoming, rules); |
There was a problem hiding this comment.
This change exposes the rules option up the callstack so it can be modifies.
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-hive/cli |
0.57.0-alpha-20251218013447-eb42eb93dd38d8485006321d27473dd678c7f320 |
npm ↗︎ unpkg ↗︎ |
hive |
8.13.0-alpha-20251218013447-eb42eb93dd38d8485006321d27473dd678c7f320 |
npm ↗︎ unpkg ↗︎ |
📚 Storybook DeploymentThe latest changes are available as preview in: https://pr-7395.hive-storybook.pages.dev |
| * @todo modify the simplifyChanges rule to loosen the argument requirements. This rule | ||
| * doesn't need more information than the change type and path fields. | ||
| */ | ||
| return DiffRule.simplifyChanges({ |
There was a problem hiding this comment.
The rule's type definition is very strict and that our SchemaCheck model slightly modifies the change structure, but the only thing this specific rule is using is a change's path and a type, which are unmodified. So technically this is safe to use here even though the typing is a mess.
I'd be interested in hearing recommendations for how maybe we can avoid this typecasting.
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to fetch a full, non-simplified list of schema changes by adding a simplifyChanges argument to the relevant GraphQL fields. The implementation correctly modifies the schema, resolvers, and underlying providers to support this functionality. The approach of storing the full list of changes and filtering them at the resolver level is sound. I've included a few suggestions for improving code clarity and safety.
💻 Website PreviewThe latest changes are available as preview in: https://pr-7395.hive-landing-page.pages.dev |
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tag: |
… or the simplified list of changes
4e78a51 to
e6a477c
Compare
Background
Schema proposals require a full list of changes to be able to patch the schemas. Currently, our schema checks are responsible for calculating this list of changes and saving it to the DB. However, checks don't include the nested changes. e.g. if a new type is added, checks don't care about showing that type's new fields.
Description
This change modifies the check behavior so that it captures all changes and then the resolvers use the Rule from graphql-inspector to filter out the nested types.