graphql-schema_comparator icon indicating copy to clipboard operation
graphql-schema_comparator copied to clipboard

Change message regressions on 1.1.1

Open bessey opened this issue 3 years ago • 2 comments

Background

Hi, we use the schema comparer library to output breaking change warnings as PR comments, as I'm sure many do. We do not use the rake task directly but rather take the output of GraphQL::SchemaComparator.compare and process it to our liking.

As we have some niche use case customisations, we have extensive testing of the output of our custom comparer.

Problem

In a routine upgrade from 1.0.0 to 1.1.1 (while remaining on GraphQL 1.12.10) while most tests still passed, we saw 2 failures:

The first is that removed arguments are missing their type:

Before: "Argument include_internal: Boolean! was removed from field Query.organisation" After: "Argument include_internal: was removed from field Query.organisation"

The second is that when field description is changed on an interface which is implemented by another type, that type's name is no longer included in output, instead duplicating the interface's name:

Diff:04:08
@@ -1,7 +1,7 @@04:08
 ## Detected safe changes in your GraphQL schema for `/v1/graphql`04:08
 04:08
 Detected changes when compared against the staging schema @ 12/08/2021:04:08
-- ✅  Field `Organisation.visibleAccountsCount` description changed from `Number of accounts` to `Number of accounts on organisation`04:08
+- ✅  Field `OrganisationalUnit.visibleAccountsCount` description changed from `Number of accounts` to `Number of accounts on organisation`04:08
 - ✅  Field `OrganisationalUnit.visibleAccountsCount` description changed from `Number of accounts` to `Number of accounts on organisation`04:08

in this instance the relevant SDL is:

type Organisation implements OrganisationalUnit {}

interface OrganisationalUnit {
  """
  Number of accounts on organisation
  """
  visibleAccountsCount: Int
}

bessey avatar Feb 10 '22 11:02 bessey

1.1 was a large refactor to use the newer graphql class-based API, so it's not too surprising that a few things fell through the cracks of the test coverage.

Did you want to try contributing these fixes?

swalkinshaw avatar Feb 10 '22 15:02 swalkinshaw

Yep, I'll give it a go. Was blocked on some other 1.13 bugs but those are out the way now

bessey avatar Mar 02 '22 15:03 bessey