Diff between schemaFile and endpoint can result in false negative
xzyfer opened this issue · 3 comments
Describe the bug
Doing a diff between a schemaPath
and an endpoint can result in a false negative if the schema doesn't reference all scalar types.
To Reproduce
Steps to reproduce the behavior:
- Create a simple schema as
test.graphql
schema {
query: RootQuery
}
type RootQuery {
foo: Foo
}
type Foo {
id: String
}
- Serve the schema locally
npx -p graphql -p @graphql-inspector/cli -c "graphql-inspector serve test.schema"
- Create a
.graphqlconfig
for the schema
{
"projects": {
"test": {
"schemaPath": "test.graphql",
"extensions": {
"endpoints": {
"local": "http://localhost:4000"
}
}
},
}
}
- Run the
diff
command
npx graphql-cli diff --project test --endpoint local
- See the report differences
--- local (http://localhost:4000) removed
+++ a.graphql added
@@ -1,8 +1,4 @@
-schema {
- query: RootQuery
-}
-
type Foo {
id: String
}
BREAKING CHANGES:
✖ Int was removed.
✖ Float was removed.
✖ ID was removed.
Expected behavior
No changes should be reported.
Versions (please complete the following information):
- OS: macOS Mojave
graphql-cli
: 3.0.11
Any thoughts on this?
We've just released new alpha versions channel for GraphQL CLI - 4.0.0-alpha.XXX
!
We use GraphQL Inspector as the default package for the diff
command to track changes between schemas.
Checkout new instructions and the migration guide and we will be happy to hear your feedback during that alpha period!
Feel free to contact us by opening an issue or using our Discord channel;
https://discord.gg/xud7bH
I've posted the wrong Discord link, this is the correct one: https://discord.gg/xud7bH9