Skip to content

Commit

Permalink
update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmac committed Nov 16, 2021
1 parent 8aba200 commit e74caaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func buildFieldURLMap(services ...*Service) FieldURLMap {
result := FieldURLMap{}
for _, rs := range services {
for _, t := range rs.Schema.Types {
if (t.Kind != ast.Object && t.Kind != ast.Interface) || isGraphQLBuiltinName(t.Name) || t.Name == serviceObjectName {
if !t.IsCompositeType() || isGraphQLBuiltinName(t.Name) || t.Name == serviceObjectName {
continue
}
for _, f := range mergeableFields(t) {
Expand Down
6 changes: 6 additions & 0 deletions merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ func TestBuildFieldURLMapSingleSchema(t *testing.T) {
Location1: loc1,
Expected: FieldURLMap{
"Query.gizmo": loc1,
"Named.name": loc1,
"Gizmo.id": loc1,
"Gizmo.name": loc1,
},
Expand Down Expand Up @@ -496,6 +497,8 @@ func TestBuildFieldURLMapTwoSchemasNoBoundaryType(t *testing.T) {
"Gizmo.name": loc1,
"Gimmick.id": loc2,
"Gimmick.size": loc2,
"Named.name": loc1,
"Sized.size": loc2,
},
}
fixture.Check(t)
Expand Down Expand Up @@ -561,6 +564,9 @@ func TestBuildFieldURLMapTwoSchemasWithBoundaryType(t *testing.T) {
"Query.gizmo": loc1,
"Gizmo.name": loc1,
"Gizmo.size": loc2,
"Named.name": loc1,
"Sized.size": loc2,
"Node.id": loc2,
},
}
fixture.Check(t)
Expand Down

0 comments on commit e74caaa

Please sign in to comment.