Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions execution/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ update-fixtures:

.PHONY: format
format:
golangci-lint fmt --config ../.golangci.yml
golangci-lint fmt
Comment thread
devsergiy marked this conversation as resolved.
Comment thread
devsergiy marked this conversation as resolved.

lint:
golangci-lint run --config ../.golangci.yml .
golangci-lint run

.PHONY: prepare-merge
prepare-merge: format test
Expand Down
17 changes: 10 additions & 7 deletions execution/engine/execution_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ func withValueCompletion() executionTestOptions {
}
}

func withFetchReasons() executionTestOptions {
return func(options *_executionTestOptions) {
options.propagateFetchReasons = true
}
}

func TestExecutionEngine_Execute(t *testing.T) {
run := func(testCase ExecutionEngineTestCase, withError bool, expectedErrorMessage string, options ...executionTestOptions) func(t *testing.T) {
t.Helper()
Expand Down Expand Up @@ -262,6 +268,7 @@ func TestExecutionEngine_Execute(t *testing.T) {
for _, option := range options {
option(&opts)
}
engineConf.plannerConfig.BuildFetchReasons = opts.propagateFetchReasons
engine, err := NewExecutionEngine(ctx, abstractlogger.Noop{}, engineConf, resolve.ResolverOptions{
MaxConcurrency: 1024,
ResolvableOptions: opts.resolvableOptions,
Expand Down Expand Up @@ -827,7 +834,7 @@ func TestExecutionEngine_Execute(t *testing.T) {
},
))

t.Run("execute simple hero operation with propagating to subgraphs reason for fields being requested", runWithoutError(
t.Run("execute simple hero operation with propagating to subgraphs fetch reasons", runWithoutError(
ExecutionEngineTestCase{
schema: graphql.StarwarsSchema(t),
operation: graphql.LoadStarWarsQuery(starwars.FileSimpleHeroQuery, nil),
Expand Down Expand Up @@ -875,9 +882,7 @@ func TestExecutionEngine_Execute(t *testing.T) {
fields: []plan.FieldConfiguration{},
expectedResponse: `{"data":{"hero":{"name":"Luke Skywalker"}}}`,
},
func(eto *_executionTestOptions) {
eto.propagateFetchReasons = true
},
withFetchReasons(),
))

t.Run("execute simple hero operation with graphql data source and empty errors list", runWithoutError(
Expand Down Expand Up @@ -4539,9 +4544,7 @@ func TestExecutionEngine_Execute(t *testing.T) {
dataSources: makeDataSource(t, true),
expectedResponse: `{"data":{"accounts":[{"some":{"title":"User1"}},{"some":{"__typename":"User","id":"2"}},{"some":{"title":"User3"}}]}}`,
},
func(eto *_executionTestOptions) {
eto.propagateFetchReasons = true
},
withFetchReasons(),
))
})
}
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go 1.25

toolchain go1.25
toolchain go1.25.1

use (
// v1
Expand Down
4 changes: 2 additions & 2 deletions v2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ update-fixtures:

.PHONY: format
format:
golangci-lint fmt --config ../.golangci.yml
golangci-lint fmt
Comment thread
devsergiy marked this conversation as resolved.

.PHONY: lint
lint:
golangci-lint run --config ../.golangci.yml .
golangci-lint run
cd ../execution && make lint

.PHONY: prepare-merge
Expand Down
Loading
Loading