fix(sdlmerge): pass report pointer as error
schemas / check (push) Skipped
schemas / vulnerabilities (push) Skipped
schemas / check-release (push) Skipped
schemas / build (push) Skipped
pre-commit / pre-commit (push) Skipped
schemas / vulnerabilities (pull_request) Successful in 57s
schemas / check-release (pull_request) Successful in 2m3s
schemas / check (pull_request) Successful in 2m21s
schemas / build (pull_request) Failing after 29s
schemas / deploy-prod (pull_request) Skipped
pre-commit / pre-commit (pull_request) Successful in 3m15s
schemas / check (push) Skipped
schemas / vulnerabilities (push) Skipped
schemas / check-release (push) Skipped
schemas / build (push) Skipped
pre-commit / pre-commit (push) Skipped
schemas / vulnerabilities (pull_request) Successful in 57s
schemas / check-release (pull_request) Successful in 2m3s
schemas / check (pull_request) Successful in 2m21s
schemas / build (pull_request) Failing after 29s
schemas / deploy-prod (pull_request) Skipped
pre-commit / pre-commit (pull_request) Successful in 3m15s
graphql-go-tools v2.25.0 moved operationreport.Report.Error to a pointer receiver, so only *Report implements error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLmypV3dLndLLzCSpYJHMv
This commit is contained in:
1 parent
1b2376cc7c
commit
afb6df6998
1 file changed
+7
-7
@@ -50,12 +50,12 @@ func MergeSDLs(SDLs ...string) (string, error) {
|
|||||||
|
|
||||||
doc, report := astparser.ParseGraphqlDocumentString(strings.Join(rawDocs, "\n"))
|
doc, report := astparser.ParseGraphqlDocumentString(strings.Join(rawDocs, "\n"))
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return "", fmt.Errorf("parse graphql document string: %w", report)
|
return "", fmt.Errorf("parse graphql document string: %w", &report)
|
||||||
}
|
}
|
||||||
|
|
||||||
astnormalization.NormalizeSubgraphSDL(&doc, &report)
|
astnormalization.NormalizeSubgraphSDL(&doc, &report)
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return "", fmt.Errorf("merge ast: %w", report)
|
return "", fmt.Errorf("merge ast: %w", &report)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := MergeAST(&doc); err != nil {
|
if err := MergeAST(&doc); err != nil {
|
||||||
@@ -81,11 +81,11 @@ func validateSubgraphs(subgraphs []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return fmt.Errorf(parseDocumentError, report)
|
return fmt.Errorf(parseDocumentError, &report)
|
||||||
}
|
}
|
||||||
validator.Validate(&doc, &report)
|
validator.Validate(&doc, &report)
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return fmt.Errorf("validate schema: %w", report)
|
return fmt.Errorf("validate schema: %w", &report)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -96,11 +96,11 @@ func normalizeSubgraphs(subgraphs []string) error {
|
|||||||
for i, subgraph := range subgraphs {
|
for i, subgraph := range subgraphs {
|
||||||
doc, report := astparser.ParseGraphqlDocumentString(subgraph)
|
doc, report := astparser.ParseGraphqlDocumentString(subgraph)
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return fmt.Errorf(parseDocumentError, report)
|
return fmt.Errorf(parseDocumentError, &report)
|
||||||
}
|
}
|
||||||
subgraphNormalizer.NormalizeDefinition(&doc, &report)
|
subgraphNormalizer.NormalizeDefinition(&doc, &report)
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return fmt.Errorf("normalize schema: %w", report)
|
return fmt.Errorf("normalize schema: %w", &report)
|
||||||
}
|
}
|
||||||
out, err := astprinter.PrintString(&doc)
|
out, err := astprinter.PrintString(&doc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -160,7 +160,7 @@ func (m *normalizer) normalize(operation *ast.Document) error {
|
|||||||
for _, walker := range m.walkers {
|
for _, walker := range m.walkers {
|
||||||
walker.Walk(operation, nil, &report)
|
walker.Walk(operation, nil, &report)
|
||||||
if report.HasErrors() {
|
if report.HasErrors() {
|
||||||
return fmt.Errorf("walk: %w", report)
|
return fmt.Errorf("walk: %w", &report)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user