Skip to content

Commit

Permalink
Merge pull request #265 from movio/cleanup-warning
Browse files Browse the repository at this point in the history
Clean up unused arguments warning
  • Loading branch information
pkqk authored Apr 23, 2024
2 parents 5c1a1cc + 6abd85f commit 8d2cb4f
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func mergeTypes(a, b map[string]*ast.Definition) (map[string]*ast.Definition, er
continue
}

mergedBoundaryObject, err := mergeBoundaryObjects(a, b, &newVB, va)
mergedBoundaryObject, err := mergeBoundaryObjects(&newVB, va)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -284,26 +284,23 @@ func mergeNamespaceObjects(aTypes, bTypes map[string]*ast.Definition, a, b *ast.
}, nil
}

func mergeBoundaryObjects(aTypes, bTypes map[string]*ast.Definition, a, b *ast.Definition) (*ast.Definition, error) {
result := &ast.Definition{
func mergeBoundaryObjects(a, b *ast.Definition) (*ast.Definition, error) {
mergedFields, err := mergeBoundaryObjectFields(a, b)
if err != nil {
return nil, err
}

return &ast.Definition{
Kind: ast.Object,
Description: mergeDescriptions(a, b),
Name: a.Name,
Directives: a.Directives.ForNames(boundaryDirectiveName),
Interfaces: append(a.Interfaces, b.Interfaces...),
Fields: nil,
}

mergedFields, err := mergeBoundaryObjectFields(aTypes, bTypes, a, b)
if err != nil {
return nil, err
}

result.Fields = mergedFields
return result, nil
Fields: mergedFields,
}, nil
}

func mergeBoundaryObjectFields(aTypes, bTypes map[string]*ast.Definition, a, b *ast.Definition) (ast.FieldList, error) {
func mergeBoundaryObjectFields(a, b *ast.Definition) (ast.FieldList, error) {
var result ast.FieldList
for _, f := range a.Fields {
if isQueryType(a) && (isNodeField(f) || isServiceField(f)) {
Expand Down

0 comments on commit 8d2cb4f

Please sign in to comment.