graphql-schema_comparator
graphql-schema_comparator copied to clipboard
Extended Query being reported as a different to a non-extended Query, when it is actually the same.
When comparing a query where the expected type has been extended to exactly match the actual type, the comparator is currently reporting a change.
Can someone confirm if this is correct? I would have expected the two queries to show no changes.
Expected:
type Query {
}
extend type Query {
test(id: String!): String!
}
Actual:
type Query {
test(id: String!): String!
}
Output: `⏳ Checking for changes... 🎉 Done! Result:
Detected the following changes between schemas:
✅ Field test was added to object type Query
`
Just to confirm, are expected and actual the two schemas you're comparing?
I'd probably expect the diff between those to show no changes either. This might also be behaviour from the graphql-ruby gem itself. I'd suggest running GraphQL::Schema.from_definition(schema).to_definition to see what it outputs for the schema with extend
Yes that's right.
Thanks, unfortunately I have zero ruby knowledge, but I will try and figure out if i can do that tomorrow.