-
-
Notifications
You must be signed in to change notification settings - Fork 206
Generate changes for new or deleted schemas #2923
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
base: master
Are you sure you want to change the base?
Conversation
💻 Website PreviewThe latest changes are available as preview in: https://pr-2923.graphql-inspector.pages.dev |
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-inspector/action |
5.0.16-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/cli |
6.0.4-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/audit-command |
5.0.16-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/coverage-command |
6.1.10-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/diff-command |
6.0.4-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/introspect-command |
5.0.16-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/similar-command |
5.0.16-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/validate-command |
5.0.16-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
@graphql-inspector/core |
7.1.0-alpha-20251120235634-88fd4e9a4cbe3ef4792bdd0a808b897ac20ae425 |
npm ↗︎ unpkg ↗︎ |
| Object.values(oldSchema.getTypeMap()).filter(t => !isPrimitive(t)), | ||
| Object.values(newSchema.getTypeMap()).filter(t => !isPrimitive(t)), | ||
| Object.values(oldSchema?.getTypeMap() ?? {}).filter( | ||
| t => !isPrimitive(t) && !isForIntrospection(t), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to exclude these introspection types. Otherwise they'll show as "added" if null is passed as the oldSchema.
Before, both oldSchema and newSchema contained identical types and so no changes were output.
| "message": "Schema query root has changed from 'unknown' to 'Query'", | ||
| "meta": { | ||
| "newQueryTypeName": "Query", | ||
| "oldQueryTypeName": "unknown", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't unknown also a legit name that the root Query type could be named after? Maybe it should be null and not a string instead.
type unknown {
foo: Int
}
schema {
query: unknown
}
Description
Ref CONSOLE-1540
Showing a list of changes can be useful even for new or deleted schemas.
This change allows
nullto be passed todiffas either the old and/or new schema.Currently, on Hive, checking a new schema shows "no changes". This isn't harmful since additions are safe, but it's confusing. Showing a full list of additions in the new schema would make much more sense.
Type of change
How Has This Been Tested?
See unit tests
Checklist:
CONTRIBUTING doc and the
style guidelines of this project