diff --git a/router-tests/go.mod b/router-tests/go.mod index 43802d65a8..0e8314fb81 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -28,7 +28,7 @@ require ( github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e github.com/wundergraph/cosmo/router v0.0.0-20260319123623-f186a0f724f6 github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel/sdk v1.39.0 go.opentelemetry.io/otel/sdk/metric v1.39.0 diff --git a/router-tests/go.sum b/router-tests/go.sum index 9bb30f878f..032aa984dc 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -357,8 +357,8 @@ github.com/wundergraph/astjson v1.1.0 h1:xORDosrZ87zQFJwNGe/HIHXqzpdHOFmqWgykCLV github.com/wundergraph/astjson v1.1.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= github.com/wundergraph/go-arena v1.1.0 h1:9+wSRkJAkA2vbYHp6s8tEGhPViRGQNGXqPHT0QzhdIc= github.com/wundergraph/go-arena v1.1.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267 h1:qMkYR0oq0Cw61aDZs9VsCCVwNVSxRxT13ytz6WqCwJg= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b h1:8qC1P3uSAyxD3qU0ne88xNjA08KAIyeCRuxKQQn7wa4= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= diff --git a/router-tests/protocol/defer_test.go b/router-tests/protocol/defer_test.go new file mode 100644 index 0000000000..3c94a3030f --- /dev/null +++ b/router-tests/protocol/defer_test.go @@ -0,0 +1,305 @@ +package integration + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "slices" + "strings" + "testing" + + "github.com/sebdah/goldie/v2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/wundergraph/astjson" + + "github.com/wundergraph/cosmo/router-tests/testenv" + "github.com/wundergraph/cosmo/router/pkg/config" +) + +func TestDeferTestDataQueries(t *testing.T) { + t.Parallel() + + testDir := filepath.Join("testdata", "queries_defer") + entries, err := os.ReadDir(testDir) + require.NoError(t, err) + + groupQueries := map[string][]string{} + + for _, entry := range entries { + fileName := entry.Name() + ext := filepath.Ext(fileName) + name := strings.TrimSuffix(fileName, ext) + + if ext != ".graphql" { + continue + } + + // "full_defer_01_single_defer" → source = "full" + source, _, found := strings.Cut(name, "_defer_") + if !found { + continue + } + + groupQueries[source] = append(groupQueries[source], name) + } + + groups := make([]string, 0, len(groupQueries)) + for k, _ := range groupQueries { + groups = append(groups, k) + } + slices.Sort(groups) + + for _, group := range groups { + t.Run(group, func(t *testing.T) { + for _, name := range groupQueries[group] { + t.Run(name, func(t *testing.T) { + t.Parallel() + + gMultipart := goldie.New( + t, + goldie.WithFixtureDir("testdata/queries_defer"), + goldie.WithNameSuffix(".txt"), + goldie.WithDiffEngine(goldie.ClassicDiff), + ) + gFull := goldie.New( + t, + goldie.WithFixtureDir("testdata/queries_defer"), + goldie.WithNameSuffix(".json"), + goldie.WithDiffEngine(goldie.ClassicDiff), + ) + + testenv.Run(t, &testenv.Config{ + NoRetryClient: true, + ModifyEngineExecutionConfiguration: func(cfg *config.EngineExecutionConfiguration) { + // cfg.Debug.PrintIntermediateQueryPlans = true + // cfg.Debug.PrintPlanningPaths = true + // cfg.Debug.PrintNodeSuggestions = true + // cfg.Debug.PrintOperationTransformations = true + }, + }, func(t *testing.T, xEnv *testenv.Environment) { + queryFilePath := filepath.Join(testDir, fmt.Sprintf("%s.graphql", name)) + t.Cleanup(func() { + if t.Failed() { + abs, _ := filepath.Abs(queryFilePath) + t.Logf("query file: %s", abs) + } + }) + + queryData, err := os.ReadFile(queryFilePath) + require.NoError(t, err) + + payload := map[string]any{"query": string(queryData)} + payloadData, err := json.Marshal(payload) + require.NoError(t, err) + + req := xEnv.MakeGraphQLDeferRequest(http.MethodPost, bytes.NewReader(payloadData)) + res, err := xEnv.RouterClient.Do(req) + require.NoError(t, err) + defer func() { require.NoError(t, res.Body.Close()) }() + + assert.Equal(t, http.StatusOK, res.StatusCode) + + // defer could be fully discarded in case query has duplicate field which are not deffered + isMultipart := strings.HasPrefix(res.Header.Get("Content-Type"), "multipart/mixed") + + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + + update := false + + t.Run("raw multipart body", func(t *testing.T) { + if !update { + gMultipart.Assert(t, name, body) + } else { + gMultipart.Update(t, name, body) + } + }) + + var actual []byte + + if isMultipart { + // Reconstruct the full response from chunks + reconstructed, err := reconstructDeferResponse(body) + require.NoError(t, err) + actual = normalizeJSON(t, reconstructed) + } else { + actual = normalizeJSON(t, body) + } + + t.Run("assert full response", func(t *testing.T) { + if !update { + gFull.Assert(t, name+"_reconstructed", actual) + } else { + gFull.Update(t, name+"_reconstructed", actual) + } + }) + + t.Run("compare with response without defer", func(t *testing.T) { + expected, err := os.ReadFile(gFull.GoldenFileName(t, group+"_original")) + require.NoError(t, err) + + expected = normalizeWithKeysSort(t, expected) + actual = normalizeWithKeysSort(t, actual) + + // manually assert to never update the original when the update flag is specified + if diff := goldie.Diff(goldie.ClassicDiff, string(actual), string(expected)); diff != "" { + t.Fatal(diff) + } + }) + }) + }) + } + }) + } +} + +func normalizeWithKeysSort(tb testing.TB, data []byte) []byte { + var val map[string]interface{} + require.NoError(tb, json.Unmarshal(data, &val)) + + out, err := json.MarshalIndent(val, "", " ") + require.NoError(tb, err) + + return out +} + +// reconstructDeferResponse parses a multipart/mixed defer body, merges all +// incremental patches onto the initial data using astjson, and returns +// the complete JSON response (without transport fields like hasNext). +func reconstructDeferResponse(body []byte) ([]byte, error) { + parts, err := parseMultipartParts(body) + if err != nil { + return nil, err + } + if len(parts) == 0 { + return nil, fmt.Errorf("no parts in multipart response") + } + + var p astjson.Parser + result, err := p.ParseBytes(parts[0]) + if err != nil { + return nil, fmt.Errorf("parse initial part: %w", err) + } + + for _, part := range parts[1:] { + partVal, err := p.ParseBytes(part) + if err != nil { + return nil, fmt.Errorf("parse part: %w", err) + } + + for _, item := range partVal.GetArray("incremental") { + patchData := item.Get("data") + if patchData == nil { + continue + } + + // Build path: prepend "data", then each segment from the path array. + pathKeys := []string{"data"} + for _, seg := range item.GetArray("path") { + switch seg.Type() { + case astjson.TypeNumber: + pathKeys = append(pathKeys, string(seg.MarshalTo(nil))) + default: + s, _ := seg.StringBytes() + pathKeys = append(pathKeys, string(s)) + } + } + + if err := mergeAtPath(result, patchData, pathKeys); err != nil { + return nil, fmt.Errorf("merge at path %v: %w", pathKeys, err) + } + + // Collect errors from incremental items into root errors. + patchErrors := item.Get("errors") + if patchErrors != nil && patchErrors.Type() == astjson.TypeArray { + existing := result.Get("errors") + if existing == nil || existing.Type() == astjson.TypeNull { + result.Set(nil, "errors", patchErrors) + } else { + merged := appendArrayValues(existing, patchErrors) + result.Set(nil, "errors", merged) + } + } + } + } + + // Remove transport-only field. + result.Del("hasNext") + + return result.MarshalTo(nil), nil +} + +// mergeAtPath navigates result to the node at pathKeys and deep-merges patch there. +func mergeAtPath(result, patch *astjson.Value, pathKeys []string) error { + if len(pathKeys) == 0 { + _, _, err := astjson.MergeValues(nil, result, patch) + return err + } + + // Navigate to the parent of the target node. + current := result + for _, key := range pathKeys[:len(pathKeys)-1] { + next := current.Get(key) + if next == nil { + return nil + } + current = next + } + + lastKey := pathKeys[len(pathKeys)-1] + target := current.Get(lastKey) + if target == nil { + current.Set(nil, lastKey, patch) + return nil + } + + merged, _, err := astjson.MergeValues(nil, target, patch) + if err != nil { + return err + } + current.Set(nil, lastKey, merged) + return nil +} + +// appendArrayValues returns a new TypeArray containing all elements of a followed by all of b. +func appendArrayValues(a, b *astjson.Value) *astjson.Value { + out := astjson.ArrayValue(nil) + idx := 0 + for _, v := range a.GetArray() { + out.SetArrayItem(nil, idx, v) + idx++ + } + for _, v := range b.GetArray() { + out.SetArrayItem(nil, idx, v) + idx++ + } + return out +} + +// parseMultipartParts splits a multipart/mixed body on the --graphql boundary +// and returns the raw JSON bytes of each part. +func parseMultipartParts(body []byte) ([][]byte, error) { + boundary := []byte("\r\n--graphql") + parts := bytes.Split(body, boundary) + var result [][]byte + for _, part := range parts { + if bytes.HasPrefix(part, []byte("--")) { + continue + } + _, jsonBody, found := bytes.Cut(part, []byte("\r\n\r\n")) + if !found { + continue + } + jsonBody = bytes.TrimSpace(jsonBody) + if len(jsonBody) == 0 { + continue + } + result = append(result, jsonBody) + } + return result, nil +} diff --git a/router-tests/protocol/header_set_test.go b/router-tests/protocol/header_set_test.go index 0b973910d6..4f91fea774 100644 --- a/router-tests/protocol/header_set_test.go +++ b/router-tests/protocol/header_set_test.go @@ -1,23 +1,26 @@ package integration import ( - "github.com/wundergraph/cosmo/router-tests/testutils" - + "bytes" "fmt" + "io" "net/http" "strings" "testing" "time" + "github.com/wundergraph/cosmo/router-tests/testutils" + "github.com/MicahParks/jwkset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/zap" + "github.com/wundergraph/cosmo/router-tests/jwks" "github.com/wundergraph/cosmo/router-tests/testenv" "github.com/wundergraph/cosmo/router/core" "github.com/wundergraph/cosmo/router/pkg/authentication" "github.com/wundergraph/cosmo/router/pkg/config" - "go.uber.org/zap" ) func TestHeaderSet(t *testing.T) { @@ -76,6 +79,28 @@ func TestHeaderSet(t *testing.T) { require.Equal(t, fmt.Sprintf(`{"data":{"headerValue":"%s"}}`, employeeVal), res.Body) }) }) + + t.Run("global request rule sets header for defer", func(t *testing.T) { + t.Parallel() + testenv.Run(t, &testenv.Config{ + RouterOptions: global(customHeader, employeeVal), + }, func(t *testing.T, xEnv *testenv.Environment) { + payload := []byte(fmt.Sprintf(`{"query":"query { ... @defer { headerValue(name:\"%s\") } }"}`, customHeader)) + + req := xEnv.MakeGraphQLDeferRequest(http.MethodPost, bytes.NewReader(payload)) + res, err := xEnv.RouterClient.Do(req) + require.NoError(t, err) + defer func() { require.NoError(t, res.Body.Close()) }() + assert.Equal(t, http.StatusOK, res.StatusCode) + + body, err := io.ReadAll(res.Body) + require.NoError(t, err) + + bodyString := string(body) + assert.Contains(t, bodyString, `{"data":{},"hasNext":true}`) + assert.Contains(t, bodyString, fmt.Sprintf(`{"incremental":[{"data":{"headerValue":"%s"},"path":[]}],"hasNext":false}`, employeeVal)) + }) + }) }) t.Run("ResponseSet", func(t *testing.T) { diff --git a/router-tests/protocol/testdata/queries_defer/README.md b/router-tests/protocol/testdata/queries_defer/README.md new file mode 100644 index 0000000000..248dfb5e93 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/README.md @@ -0,0 +1,53 @@ +# Defer Query Test Fixtures + +This directory contains GraphQL query variants that exercise `@defer` support, +along with their golden response fixtures (`.txt`). + +## Naming Convention + +```text +{source}_{number}_{description}.graphql +``` + +`source` is the base query name (matches a file in `../queries/`). +`number` is the two-digit variation index (01–13). +`description` is a short slug. + +## Variation Types + +### Core Variations (01–10, applied to all source queries) + +| # | Name | What it tests | +|---|------|--------------| +| 01 | `single_defer` | One field deferred, rest immediate | +| 02 | `single_defer_between_regular` | Deferred fragment sandwiched between non-deferred fields | +| 03 | `multiple_fields_deferred` | Multiple fields inside a single `... @defer` | +| 04 | `all_fields_deferred` | Everything deferred; initial response is `{"data":{},"hasNext":true}` | +| 05 | `nested_defer` | Two levels of nested `... @defer { ... @defer { } }` | +| 06 | `nested_defer_variation` | Outer defer has a regular field plus an inner defer | +| 07 | `parallel_defers` | Two sibling `... @defer` fragments at the same level | +| 08 | `defer_nested_object` | An entire nested object (typically from a different subgraph) is deferred | +| 09 | `duplicated_field_across_defer` | Same field appears in both deferred and non-deferred selection | +| 10 | `extensive_parallel` | Every individual field group in its own `... @defer` inside a top-level defer | + +### Fragment Variations (11–13) + +Applied to: `employees`, `full`, `products`, `requires_mood`, `requires_different_depth`. + +For queries that have inline fragments (`... on SomeType { }`) but no named fragment +definitions, inline fragments are first promoted to named fragment definitions. + +| # | Name | What it tests | +|---|------|--------------| +| 11 | `fragment_around_and_inside` | `... @defer { ...Frag }` AND inside the fragment `... @defer { field }` | +| 12 | `fragment_body_defer` | Fragment spread used normally; fragment body contains `... @defer { fields }` | +| 13 | `fragment_spread_defer` | `...FragmentName @defer` — defer directive on the spread itself | + +## Regenerating Fixtures + +```bash +cd router-tests +go test -v -run TestDeferTestDataQueries -update ./... +``` + +Fixtures are deterministic because defer resolution is sequential in this router implementation. diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.graphql new file mode 100644 index 0000000000..396e97a884 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + notes + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.txt new file mode 100644 index 0000000000..72d11588a8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products"},{"id":2,"notes":"Dustin notes resolved by products"},{"id":3,"notes":"Stefan notes resolved by products"},{"id":4,"notes":"Björn notes resolved by products"},{"id":5,"notes":"Sergiy notes resolved by products"},{"id":7,"notes":"Suvij notes resolved by products"},{"id":8,"notes":"Nithin notes resolved by products"},{"id":10,"notes":"Eelco notes resolved by products"},{"id":11,"notes":"Alexandra notes resolved by products"},{"id":12,"notes":"David notes resolved by products"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_01_single_defer_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..f1cd53c260 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + notes + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..72d11588a8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products"},{"id":2,"notes":"Dustin notes resolved by products"},{"id":3,"notes":"Stefan notes resolved by products"},{"id":4,"notes":"Björn notes resolved by products"},{"id":5,"notes":"Sergiy notes resolved by products"},{"id":7,"notes":"Suvij notes resolved by products"},{"id":8,"notes":"Nithin notes resolved by products"},{"id":10,"notes":"Eelco notes resolved by products"},{"id":11,"notes":"Alexandra notes resolved by products"},{"id":12,"notes":"David notes resolved by products"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..3da2b9c4d0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + ... @defer { + notes + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..63d92929d9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products","hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products","hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products","hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products","hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"notes":"David notes resolved by products","hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..691ee06d0a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.graphql @@ -0,0 +1,15 @@ +query { + ... @defer { + employees { + id + notes + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..a8a82613ce --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},{"id":2,"notes":"Dustin notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},{"id":3,"notes":"Stefan notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},{"id":4,"notes":"Björn notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},{"id":5,"notes":"Sergiy notes resolved by products","hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},{"id":7,"notes":"Suvij notes resolved by products","hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},{"id":8,"notes":"Nithin notes resolved by products","hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},{"id":10,"notes":"Eelco notes resolved by products","hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},{"id":11,"notes":"Alexandra notes resolved by products","hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},{"id":12,"notes":"David notes resolved by products","hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..82a799829b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.graphql @@ -0,0 +1,17 @@ +query { + employees { + id + ... @defer { + notes + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.txt new file mode 100644 index 0000000000..92e9e7f3ac --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..8c49ff12b8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.graphql @@ -0,0 +1,17 @@ +query { + employees { + ... @defer { + id + notes + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..080408e63c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{},{},{},{},{},{},{},{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1,"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"id":2,"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"id":3,"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"id":4,"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"id":5,"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"id":7,"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"id":8,"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"id":10,"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"id":11,"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"id":12,"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..b41df3bfcf --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + ... @defer { notes } + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..92e9e7f3ac --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..396e97a884 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + notes + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..72d11588a8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products"},{"id":2,"notes":"Dustin notes resolved by products"},{"id":3,"notes":"Stefan notes resolved by products"},{"id":4,"notes":"Björn notes resolved by products"},{"id":5,"notes":"Sergiy notes resolved by products"},{"id":7,"notes":"Suvij notes resolved by products"},{"id":8,"notes":"Nithin notes resolved by products"},{"id":10,"notes":"Eelco notes resolved by products"},{"id":11,"notes":"Alexandra notes resolved by products"},{"id":12,"notes":"David notes resolved by products"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..820d297c0d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,15 @@ +query { + employees { + id + hobbies { __typename } + ... @defer { + hobbies { + employees { + id + details { forename } + } + } + notes + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..4bcd316b7f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},{"id":2,"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Programming"}]},{"id":3,"hobbies":[{"__typename":"Exercise"},{"__typename":"Exercise"},{"__typename":"Other"},{"__typename":"Travelling"}]},{"id":4,"hobbies":[{"__typename":"Exercise"},{"__typename":"Flying"},{"__typename":"Travelling"}]},{"id":5,"hobbies":[{"__typename":"Other"},{"__typename":"Other"},{"__typename":"Other"}]},{"id":7,"hobbies":[{"__typename":"Gaming"},{"__typename":"Other"}]},{"id":8,"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"}]},{"id":10,"hobbies":[{"__typename":"Programming"},{"__typename":"Exercise"},{"__typename":"Exercise"},{"__typename":"Exercise"},{"__typename":"Other"},{"__typename":"Travelling"}]},{"id":11,"hobbies":[{"__typename":"Other"}]},{"id":12,"hobbies":[{"__typename":"Programming"},{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Travelling"}]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",0,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",0,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",0,"hobbies",2]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",0,"hobbies",3]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",0,"hobbies",4]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",1,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",1,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",1,"hobbies",2]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",2,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",2,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",2,"hobbies",2]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",2,"hobbies",3]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",3,"hobbies",0]},{"data":{"employees":[{"id":4,"details":{"forename":"Björn"}}]},"path":["employees",3,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",3,"hobbies",2]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",4,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",4,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",4,"hobbies",2]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",5,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",5,"hobbies",1]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",6,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",6,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",6,"hobbies",2]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",7,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",7,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",7,"hobbies",2]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",7,"hobbies",3]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",7,"hobbies",4]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",7,"hobbies",5]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},"path":["employees",8,"hobbies",0]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",9,"hobbies",0]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",9,"hobbies",1]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",9,"hobbies",2]},{"data":{"employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},"path":["employees",9,"hobbies",3]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..21ada28e8b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "Jens notes resolved by products" + }, + { + "id": 2, + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "Dustin notes resolved by products" + }, + { + "id": 3, + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "Stefan notes resolved by products" + }, + { + "id": 4, + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "Björn notes resolved by products" + }, + { + "id": 5, + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ], + "notes": "Sergiy notes resolved by products" + }, + { + "id": 7, + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ], + "notes": "Suvij notes resolved by products" + }, + { + "id": 8, + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ], + "notes": "Nithin notes resolved by products" + }, + { + "id": 10, + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "Eelco notes resolved by products" + }, + { + "id": 11, + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ], + "notes": "Alexandra notes resolved by products" + }, + { + "id": 12, + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ], + "notes": "David notes resolved by products" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..de51477e16 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.graphql @@ -0,0 +1,17 @@ +query { + ... @defer { + employees { + ... @defer { id } + ... @defer { notes } + ... @defer { + hobbies { + __typename + employees { + id + details { forename } + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..bddc5e8971 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel.txt @@ -0,0 +1,28 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{},{},{},{},{},{},{},{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["employees",0]},{"data":{"id":2},"path":["employees",1]},{"data":{"id":3},"path":["employees",2]},{"data":{"id":4},"path":["employees",3]},{"data":{"id":5},"path":["employees",4]},{"data":{"id":7},"path":["employees",5]},{"data":{"id":8},"path":["employees",6]},{"data":{"id":10},"path":["employees",7]},{"data":{"id":11},"path":["employees",8]},{"data":{"id":12},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",1]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Flying","employees":[{"id":4,"details":{"forename":"Björn"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",4]},{"data":{"hobbies":[{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",5]},{"data":{"hobbies":[{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",6]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"__typename":"Other","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":5,"details":{"forename":"Sergiy"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":11,"details":{"forename":"Alexandra"}}]}]},"path":["employees",8]},{"data":{"hobbies":[{"__typename":"Programming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Exercise","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":3,"details":{"forename":"Stefan"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":8,"details":{"forename":"Nithin"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Gaming","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":2,"details":{"forename":"Dustin"}},{"id":7,"details":{"forename":"Suvij"}},{"id":8,"details":{"forename":"Nithin"}},{"id":12,"details":{"forename":"David"}}]},{"__typename":"Travelling","employees":[{"id":1,"details":{"forename":"Jens"}},{"id":3,"details":{"forename":"Stefan"}},{"id":4,"details":{"forename":"Björn"}},{"id":10,"details":{"forename":"Eelco"}},{"id":12,"details":{"forename":"David"}}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_original.graphql b/router-tests/protocol/testdata/queries_defer/employeeDetails_original.graphql new file mode 100644 index 0000000000..c87d78a82c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_original.graphql @@ -0,0 +1,19 @@ +query { + # Fetch from employees subgraph + employees { + id + # Fetch from products subgraph + notes + # Fetch from hobbies subgraph + hobbies { + __typename + # Fetch from employees subgraph + employees { + id + details { + forename + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employeeDetails_original.json b/router-tests/protocol/testdata/queries_defer/employeeDetails_original.json new file mode 100644 index 0000000000..7f3b750761 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employeeDetails_original.json @@ -0,0 +1,1724 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Flying", + "employees": [ + { + "id": 4, + "details": { + "forename": "Björn" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "hobbies": [ + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "hobbies": [ + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "hobbies": [ + { + "__typename": "Other", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 5, + "details": { + "forename": "Sergiy" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + } + } + ] + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "hobbies": [ + { + "__typename": "Programming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Exercise", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Gaming", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 2, + "details": { + "forename": "Dustin" + } + }, + { + "id": 7, + "details": { + "forename": "Suvij" + } + }, + { + "id": 8, + "details": { + "forename": "Nithin" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + }, + { + "__typename": "Travelling", + "employees": [ + { + "id": 1, + "details": { + "forename": "Jens" + } + }, + { + "id": 3, + "details": { + "forename": "Stefan" + } + }, + { + "id": 4, + "details": { + "forename": "Björn" + } + }, + { + "id": 10, + "details": { + "forename": "Eelco" + } + }, + { + "id": 12, + "details": { + "forename": "David" + } + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.graphql new file mode 100644 index 0000000000..36d1279326 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.graphql @@ -0,0 +1,17 @@ +query { + employee(id: 1) { + id + details { + forename + location { language } + } + ... @defer { + hobbies { __typename } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.txt new file mode 100644 index 0000000000..4f1cee65be --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_01_single_defer_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..c0da0ad4fb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,17 @@ +query { + employee(id: 1) { + id + ... @defer { + hobbies { __typename } + } + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..4f1cee65be --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..c2e1849801 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,17 @@ +query { + employee(id: 1) { + id + ... @defer { + details { + forename + location { language } + } + hobbies { __typename } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..790ec1b819 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","location":{"language":"German"}},"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..8e2844d2c3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.graphql @@ -0,0 +1,17 @@ +query { + ... @defer { + employee(id: 1) { + id + details { + forename + location { language } + } + hobbies { __typename } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..3248a3b625 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}},"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..9798a15637 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.graphql @@ -0,0 +1,19 @@ +query { + employee(id: 1) { + id + ... @defer { + details { + forename + location { language } + } + ... @defer { + hobbies { __typename } + } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.txt new file mode 100644 index 0000000000..81471d5fc9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","location":{"language":"German"}}},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..9807e7f466 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.graphql @@ -0,0 +1,19 @@ +query { + employee(id: 1) { + ... @defer { + id + details { + forename + location { language } + } + ... @defer { + hobbies { __typename } + } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..5096a915ad --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..0470ede1ae --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.graphql @@ -0,0 +1,12 @@ +query { + employee(id: 1) { + id + ... @defer { details { forename location { language } } } + ... @defer { hobbies { __typename } } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..81471d5fc9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","location":{"language":"German"}}},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..ec123a47c4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.graphql @@ -0,0 +1,16 @@ +query { + employee(id: 1) { + id + details { forename location { language } } + ... @defer { + hobbies { __typename } + } + } + teammates(team: OPERATIONS) { + id + ... @defer { + details { forename } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..c955117efe --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4},{"id":11}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["teammates",0]},{"data":{"details":{"forename":"Alexandra"},"products":["FINANCE"]},"path":["teammates",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..1898f3b769 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,15 @@ +query { + employee(id: 1) { + id + details { forename } + ... @defer { + details { location { language } } + hobbies { __typename } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..2b15eeb266 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employee":{"id":1,"details":{"forename":"Jens"}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]},{"data":{"location":{"language":"German"}},"path":["employee","details"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..222bca55f9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.graphql @@ -0,0 +1,14 @@ +query { + ... @defer { + employee(id: 1) { + ... @defer { id } + ... @defer { details { forename location { language } } } + ... @defer { hobbies { __typename } } + } + teammates(team: OPERATIONS) { + ... @defer { id } + ... @defer { details { forename } } + ... @defer { products } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..d7ae2d1ed5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel.txt @@ -0,0 +1,43 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employee":{},"teammates":[{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","location":{"language":"German"}}},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"__typename":"Exercise"},{"__typename":"Gaming"},{"__typename":"Other"},{"__typename":"Programming"},{"__typename":"Travelling"}]},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":4},"path":["teammates",0]},{"data":{"id":11},"path":["teammates",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Björn"}},"path":["teammates",0]},{"data":{"details":{"forename":"Alexandra"}},"path":["teammates",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["teammates",0]},{"data":{"products":["FINANCE"]},"path":["teammates",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employee_original.graphql b/router-tests/protocol/testdata/queries_defer/employee_original.graphql new file mode 100644 index 0000000000..8be0b7a68d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_original.graphql @@ -0,0 +1,25 @@ +query { + # can return null + employee(id: 1) { + # resolved through employees subgraph + id + details { + forename + location { + language + } + } + hobbies { + __typename + } + } + teammates(team: OPERATIONS) { + # resolved through employees subgraph + id + details { + forename + } + # resolved through products subgraph + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employee_original.json b/router-tests/protocol/testdata/queries_defer/employee_original.json new file mode 100644 index 0000000000..0e74b492eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employee_original.json @@ -0,0 +1,52 @@ +{ + "data": { + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + }, + "hobbies": [ + { + "__typename": "Exercise" + }, + { + "__typename": "Gaming" + }, + { + "__typename": "Other" + }, + { + "__typename": "Programming" + }, + { + "__typename": "Travelling" + } + ] + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.graphql new file mode 100644 index 0000000000..ec10823ba6 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.graphql @@ -0,0 +1,39 @@ +query { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.txt new file mode 100644 index 0000000000..307d797454 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..7193fc0aa0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_01_single_defer_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "products": [ + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "products": [ + "FINANCE" + ], + "hobbies": [ + { + "name": "Spending time with the family" + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..57b8a1cd75 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,39 @@ +query { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..307d797454 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..7193fc0aa0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "products": [ + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "products": [ + "FINANCE" + ], + "hobbies": [ + { + "name": "Spending time with the family" + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..f2a9bc3224 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,39 @@ +query { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..2a6eff6f5e --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..faca5a476f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.graphql @@ -0,0 +1,39 @@ +query { + ... @defer { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..d524cd39f2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..3ddebb3068 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.graphql @@ -0,0 +1,41 @@ +query { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.txt new file mode 100644 index 0000000000..99d49754ce --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"products":["FINANCE"]},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..7193fc0aa0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "products": [ + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "products": [ + "FINANCE" + ], + "hobbies": [ + { + "name": "Spending time with the family" + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..2f56993f2b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.graphql @@ -0,0 +1,41 @@ +query { + employees { + id + notes + ... @defer { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..c7a6eaa0d1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products"},{"id":2,"notes":"Dustin notes resolved by products"},{"id":3,"notes":"Stefan notes resolved by products"},{"id":4,"notes":"Björn notes resolved by products"},{"id":5,"notes":"Sergiy notes resolved by products"},{"id":7,"notes":"Suvij notes resolved by products"},{"id":8,"notes":"Nithin notes resolved by products"},{"id":10,"notes":"Eelco notes resolved by products"},{"id":11,"notes":"Alexandra notes resolved by products"},{"id":12,"notes":"David notes resolved by products"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"products":["FINANCE"]},"path":["employees",8]},{"data":{"details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..7193fc0aa0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "products": [ + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ], + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "products": [ + "FINANCE" + ], + "hobbies": [ + { + "name": "Spending time with the family" + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..07ba6a0756 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.graphql @@ -0,0 +1,41 @@ +query { + employees { + id + notes + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..a5366612fa --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"products":["FINANCE"]},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..2946b93fd9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..540d39830c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.graphql @@ -0,0 +1,39 @@ +query { + employees { + id + notes + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..a08f9944c4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},{"id":2,"notes":"Dustin notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},{"id":3,"notes":"Stefan notes resolved by products","role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},{"id":4,"notes":"Björn notes resolved by products","role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},{"id":5,"notes":"Sergiy notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},{"id":7,"notes":"Suvij notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":8,"notes":"Nithin notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":10,"notes":"Eelco notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},{"id":11,"notes":"Alexandra notes resolved by products","role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},{"id":12,"notes":"David notes resolved by products","role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..3d4a6f354f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..a649f2ecd1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,39 @@ +query { + employees { + id + notes + details { forename } + ... @defer { + details { + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + products + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..1532d86e94 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens"}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin"}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan"}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn"}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy"}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij"}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin"}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco"}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra"}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"path":["employees",0,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"path":["employees",1,"details"]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"path":["employees",2,"details"]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"path":["employees",3,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"path":["employees",4,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"path":["employees",5,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"path":["employees",6,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"path":["employees",7,"details"]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"path":["employees",8,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]},{"data":{"surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"path":["employees",9,"details"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..df05f3c5e0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.graphql @@ -0,0 +1,45 @@ +query { + ... @defer { + employees { + ... @defer { id } + ... @defer { notes } + ... @defer { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } + ... @defer { products } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..f15c8accf2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel.txt @@ -0,0 +1,43 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{},{},{},{},{},{},{},{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["employees",0]},{"data":{"id":2},"path":["employees",1]},{"data":{"id":3},"path":["employees",2]},{"data":{"id":4},"path":["employees",3]},{"data":{"id":5},"path":["employees",4]},{"data":{"id":7},"path":["employees",5]},{"data":{"id":8},"path":["employees",6]},{"data":{"id":10},"path":["employees",7]},{"data":{"id":11},"path":["employees",8]},{"data":{"id":12},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},"path":["employees",0]},{"data":{"details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null}},"path":["employees",1]},{"data":{"details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]}},"path":["employees",2]},{"data":{"details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]}},"path":["employees",3]},{"data":{"details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]}},"path":["employees",4]},{"data":{"details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},"path":["employees",5]},{"data":{"details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},"path":["employees",6]},{"data":{"details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]}},"path":["employees",7]},{"data":{"details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},"path":["employees",8]},{"data":{"details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]}},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"products":["FINANCE"]},"path":["employees",8]},{"data":{"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.graphql new file mode 100644 index 0000000000..05c4a859ba --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.graphql @@ -0,0 +1,47 @@ +fragment EmployeeDetails on Employee { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + } +} + +fragment EmployeeHobbies on Employee { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } +} + +query { + employees { + id + notes + ... @defer { ...EmployeeDetails } + ... @defer { ...EmployeeHobbies } + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.txt new file mode 100644 index 0000000000..51eef2a4f1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside_reconstructed.json new file mode 100644 index 0000000000..53edbb8100 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_11_fragment_around_and_inside_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + } + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + } + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + } + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + } + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + } + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + } + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + } + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + } + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ], + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + } + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.graphql new file mode 100644 index 0000000000..972c1d5548 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.graphql @@ -0,0 +1,43 @@ +fragment EmployeeDetails on Employee { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + } +} + +query { + employees { + id + notes + ...EmployeeDetails + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.txt new file mode 100644 index 0000000000..10211760e2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}]},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}]},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}]},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer_reconstructed.json new file mode 100644 index 0000000000..40447bb48b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_12_fragment_body_defer_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "products": [ + "CONSULTANCY", + "MARKETING" + ], + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ], + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "products": [ + "ENGINE", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "products": [ + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "products": [ + "FINANCE" + ], + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ], + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.graphql b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.graphql new file mode 100644 index 0000000000..76b9b3853f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.graphql @@ -0,0 +1,41 @@ +fragment EmployeeDetails on Employee { + details { + forename + surname + location { key { name } language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language } } + } + products +} + +query { + employees { + id + notes + ...EmployeeDetails @defer + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.txt b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.txt new file mode 100644 index 0000000000..a4a1234bfa --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products"},{"id":2,"notes":"Dustin notes resolved by products"},{"id":3,"notes":"Stefan notes resolved by products"},{"id":4,"notes":"Björn notes resolved by products"},{"id":5,"notes":"Sergiy notes resolved by products"},{"id":7,"notes":"Suvij notes resolved by products"},{"id":8,"notes":"Nithin notes resolved by products"},{"id":10,"notes":"Eelco notes resolved by products"},{"id":11,"notes":"Alexandra notes resolved by products"},{"id":12,"notes":"David notes resolved by products"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"details":{"forename":"Dustin","surname":"Deus","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"details":{"forename":"Stefan","surname":"Avram","location":{"key":{"name":"America"},"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English"},{"language":"Serbian"}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"details":{"forename":"Björn","surname":"Schwenzer","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English"},{"language":"German"}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"details":{"forename":"Sergiy","surname":"Petrunin","location":{"key":{"name":"Ukraine"},"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"details":{"forename":"Suvij","surname":"Surya","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"details":{"forename":"Nithin","surname":"Kumar","location":{"key":{"name":"India"},"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"details":{"forename":"Eelco","surname":"Wiersma","location":{"key":{"name":"Netherlands"},"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German"},{"language":"Indonesian"},{"language":"Dutch"},{"language":"Portuguese"},{"language":"Spanish"},{"language":"Thai"}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"details":{"forename":"Alexandra","surname":"Neuse","location":{"key":{"name":"Germany"},"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"details":{"forename":"David","surname":"Stutt","location":{"key":{"name":"England"},"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English"},{"language":"Korean"},{"language":"Taiwanese"}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer_reconstructed.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_defer_13_fragment_spread_defer_reconstructed.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/employees_original.graphql b/router-tests/protocol/testdata/queries_defer/employees_original.graphql new file mode 100644 index 0000000000..7f56d20f3a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_original.graphql @@ -0,0 +1,79 @@ +query { + employees { + # resolved through employees subgraph + id + # overridden by the products subgraph + notes + details { + # resolved through either employees or family subgraph + forename + surname + # resolved through employees subgraph + location { + key { + name + } + language + } + # resolved through family subgraph + hasChildren + # maritalStatus can return null + maritalStatus + nationality + # pets can return null + pets { + class + gender + name + ... on Cat { + type + } + ... on Dog { + breed + } + ... on Alligator { + dangerous + } + } + } + # resolved through employees subgraph + role { + departments + title + ... on Engineer { + engineerType + } + ... on Operator { + operatorType + } + } + # resolved through hobbies subgraph + hobbies { + ... on Exercise { + category + } + ... on Flying { + planeModels + yearsOfExperience + } + ... on Gaming { + genres + name + yearsOfExperience + } + ... on Other { + name + } + ... on Programming { + languages + } + ... on Travelling { + countriesLived { + language + } + } + } + # resolved through products subgraph + products + } +} diff --git a/router-tests/protocol/testdata/queries_defer/employees_original.json b/router-tests/protocol/testdata/queries_defer/employees_original.json new file mode 100644 index 0000000000..301f6214ff --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/employees_original.json @@ -0,0 +1,652 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "key": { + "name": "America" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Serbian" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "German" + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "key": { + "name": "Ukraine" + }, + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "key": { + "name": "India" + }, + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "key": { + "name": "Netherlands" + }, + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German" + }, + { + "language": "Indonesian" + }, + { + "language": "Dutch" + }, + { + "language": "Portuguese" + }, + { + "language": "Spanish" + }, + { + "language": "Thai" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "key": { + "name": "Germany" + }, + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "key": { + "name": "England" + }, + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English" + }, + { + "language": "Korean" + }, + { + "language": "Taiwanese" + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.graphql new file mode 100644 index 0000000000..5eff16120f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.graphql @@ -0,0 +1,5 @@ +query { + findEmployees { + ... @defer { details { forename } } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.txt new file mode 100644 index 0000000000..33085fd218 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_01_single_defer_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..0694c0e251 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..8e9a2cf9df --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{"details":{"forename":"Jens"}},{"details":{"forename":"Dustin"}},{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Suvij"}},{"details":{"forename":"Nithin"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"Alexandra"}},{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..0694c0e251 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..8e9a2cf9df --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{"details":{"forename":"Jens"}},{"details":{"forename":"Dustin"}},{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Suvij"}},{"details":{"forename":"Nithin"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"Alexandra"}},{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..0694c0e251 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..8e9a2cf9df --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{"details":{"forename":"Jens"}},{"details":{"forename":"Dustin"}},{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Suvij"}},{"details":{"forename":"Nithin"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"Alexandra"}},{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..4206bba75b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + ... @defer { details { forename } } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.txt new file mode 100644 index 0000000000..e304f87a99 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..4206bba75b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + ... @defer { details { forename } } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..e304f87a99 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..5eff16120f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.graphql @@ -0,0 +1,5 @@ +query { + findEmployees { + ... @defer { details { forename } } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..33085fd218 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..5eff16120f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.graphql @@ -0,0 +1,5 @@ +query { + findEmployees { + ... @defer { details { forename } } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..33085fd218 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..ed0cf83ebf --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,6 @@ +query { + findEmployees { + details { forename } + ... @defer { details { forename } } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..a5bd2c443f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1 @@ +{"data":{"findEmployees":[{"details":{"forename":"Jens"}},{"details":{"forename":"Dustin"}},{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Suvij"}},{"details":{"forename":"Nithin"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"Alexandra"}},{"details":{"forename":"David"}}]}} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..4206bba75b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.graphql @@ -0,0 +1,7 @@ +query { + ... @defer { + findEmployees { + ... @defer { details { forename } } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..e304f87a99 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"findEmployees":[{},{},{},{},{},{},{},{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens"}},"path":["findEmployees",0]},{"data":{"details":{"forename":"Dustin"}},"path":["findEmployees",1]},{"data":{"details":{"forename":"Stefan"}},"path":["findEmployees",2]},{"data":{"details":{"forename":"Björn"}},"path":["findEmployees",3]},{"data":{"details":{"forename":"Sergiy"}},"path":["findEmployees",4]},{"data":{"details":{"forename":"Suvij"}},"path":["findEmployees",5]},{"data":{"details":{"forename":"Nithin"}},"path":["findEmployees",6]},{"data":{"details":{"forename":"Eelco"}},"path":["findEmployees",7]},{"data":{"details":{"forename":"Alexandra"}},"path":["findEmployees",8]},{"data":{"details":{"forename":"David"}},"path":["findEmployees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.graphql b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.graphql new file mode 100644 index 0000000000..73f740eef5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.graphql @@ -0,0 +1,7 @@ +query { + findEmployees { + details { + forename + } + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.json b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.json new file mode 100644 index 0000000000..5483c6e2a1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployeesNoCriteria_original.json @@ -0,0 +1,56 @@ +{ + "data": { + "findEmployees": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Dustin" + } + }, + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Suvij" + } + }, + { + "details": { + "forename": "Nithin" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "Alexandra" + } + }, + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.graphql new file mode 100644 index 0000000000..c11e07354d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.graphql @@ -0,0 +1,16 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.txt new file mode 100644 index 0000000000..b4089e2f54 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"c":[{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..b7f8860cc7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_01_single_defer_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..123873016a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,16 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..b4089e2f54 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"c":[{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..b7f8860cc7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..89a9628310 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,16 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..87536489ad --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}],"c":[{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..7574026c39 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..ce33bfc0f5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.graphql @@ -0,0 +1,16 @@ +query { + ... @defer { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..bd10b3ceba --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}],"c":[{"details":{"forename":"David"}}],"d":[]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..82cdcebcfc --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..db86f5f284 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.graphql @@ -0,0 +1,18 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + ... @defer { + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.txt new file mode 100644 index 0000000000..b1ba78b462 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"c":[{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..7574026c39 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..41c9c88d54 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.graphql @@ -0,0 +1,18 @@ +query { + ... @defer { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + ... @defer { + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..b79079ef3a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"c":[{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..ef33d9630a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "d": [], + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..9a510df243 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.graphql @@ -0,0 +1,18 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + ... @defer { + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..b1ba78b462 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"c":[{"details":{"forename":"David"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..7574026c39 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..420f57b4b7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.graphql @@ -0,0 +1,14 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + ... @defer { details { forename } } + } + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..4ea1ed1cd0 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"a":[{},{},{},{},{}],"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}],"c":[{"details":{"forename":"David"}}],"d":[]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Stefan"}},"path":["a",0]},{"data":{"details":{"forename":"Björn"}},"path":["a",1]},{"data":{"details":{"forename":"Sergiy"}},"path":["a",2]},{"data":{"details":{"forename":"Eelco"}},"path":["a",3]},{"data":{"details":{"forename":"David"}},"path":["a",4]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..82cdcebcfc --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..94d101411e --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,15 @@ +query { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + ... @defer { details { forename } } + } + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..51a733ea7b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1 @@ +{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}],"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}],"c":[{"details":{"forename":"David"}}],"d":[]}} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..82cdcebcfc --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..2739ee57e6 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.graphql @@ -0,0 +1,22 @@ +query { + ... @defer { + a: findEmployees(criteria: { hasPets: true }) { + details { forename } + } + } + ... @defer { + b: findEmployees(criteria: { hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + ... @defer { + c: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } }) { + details { forename } + } + } + ... @defer { + d: findEmployees(criteria: { hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..c7b1492a48 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel.txt @@ -0,0 +1,28 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Stefan"}},{"details":{"forename":"Björn"}},{"details":{"forename":"Sergiy"}},{"details":{"forename":"Eelco"}},{"details":{"forename":"David"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"b":[{"details":{"forename":"Jens"}},{"details":{"forename":"Alexandra"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"c":[{"details":{"forename":"David"}}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"d":[]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..82cdcebcfc --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ], + "d": [] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_original.graphql b/router-tests/protocol/testdata/queries_defer/findEmployees_original.graphql new file mode 100644 index 0000000000..bd3bbb9993 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_original.graphql @@ -0,0 +1,30 @@ +query { + a: findEmployees(criteria: { + hasPets: true + }) { + details { + forename + } + } + b: findEmployees(criteria: { + hasPets: false, nationality: GERMAN, nested: { maritalStatus: MARRIED } + }) { + details { + forename + } + } + c: findEmployees(criteria: { + hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED } + }) { + details { + forename + } + } + d: findEmployees(criteria: { + hasPets: true, nationality: ENGLISH, nested: { maritalStatus: MARRIED, hasChildren: true } + }) { + details { + forename + } + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/findEmployees_original.json b/router-tests/protocol/testdata/queries_defer/findEmployees_original.json new file mode 100644 index 0000000000..7574026c39 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/findEmployees_original.json @@ -0,0 +1,51 @@ +{ + "data": { + "a": [ + { + "details": { + "forename": "Stefan" + } + }, + { + "details": { + "forename": "Björn" + } + }, + { + "details": { + "forename": "Sergiy" + } + }, + { + "details": { + "forename": "Eelco" + } + }, + { + "details": { + "forename": "David" + } + } + ], + "d": [], + "b": [ + { + "details": { + "forename": "Jens" + } + }, + { + "details": { + "forename": "Alexandra" + } + } + ], + "c": [ + { + "details": { + "forename": "David" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.graphql new file mode 100644 index 0000000000..5f16d8b8e3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.graphql @@ -0,0 +1,67 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + ... @defer { + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.txt new file mode 100644 index 0000000000..40fccb4ac4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..40f3103d03 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_01_single_defer_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..cfda2c40fe --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,67 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + ... @defer { + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..40fccb4ac4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..40f3103d03 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..350c99e0f1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,67 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + ... @defer { + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..4b98fa5366 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..55f77d08f6 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ], + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..f1c58371bb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.graphql @@ -0,0 +1,67 @@ +query { + ... @defer { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..eefd2120f3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..383238b6dc --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.graphql @@ -0,0 +1,69 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + ... @defer { + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + ... @defer { + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.txt new file mode 100644 index 0000000000..007aba17ce --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..bc1a1ecc7a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.graphql @@ -0,0 +1,69 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + ... @defer { + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + ... @defer { + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..a21c57db82 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..91a0e7ac4b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.graphql @@ -0,0 +1,69 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + ... @defer { + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } + ... @defer { + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..007aba17ce --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..e34011a831 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.graphql @@ -0,0 +1,67 @@ +query { + employees { + id + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..48ce25d494 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..e5d8f27c90 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,66 @@ +query { + employees { + id + notes + details { forename surname } + ... @defer { + details { + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } + } + employee(id: 1) { + id + details { forename } + ... @defer { + details { location { language } } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..e38aeb197f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse"}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus"}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram"}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer"}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin"}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya"}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar"}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma"}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse"}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt"}}],"employee":{"id":1,"details":{"forename":"Jens"}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"path":["employees",0,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"path":["employees",1,"details"]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"path":["employees",2,"details"]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"path":["employees",3,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"path":["employees",4,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"path":["employees",5,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"path":["employees",6,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"path":["employees",7,"details"]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"path":["employees",8,"details"]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]},{"data":{"location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"path":["employees",9,"details"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"location":{"language":"German"}},"path":["employee","details"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..fd9dda9154 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.graphql @@ -0,0 +1,72 @@ +query { + ... @defer { + employees { + ... @defer { id } + ... @defer { notes } + ... @defer { + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + } + ... @defer { + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + } + ... @defer { products } + } + employee(id: 1) { + ... @defer { id } + ... @defer { details { forename location { language } } } + } + teammates(team: OPERATIONS) { + ... @defer { id } + ... @defer { details { forename } } + ... @defer { products } + } + productTypes { + ... @defer { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + ... @defer { details { forename } } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + ... @defer { details { forename } } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..e56a829b4b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel.txt @@ -0,0 +1,78 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"employees":[{},{},{},{},{},{},{},{},{},{}],"employee":{},"teammates":[{},{}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{}],"b":[{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["employees",0]},{"data":{"id":2},"path":["employees",1]},{"data":{"id":3},"path":["employees",2]},{"data":{"id":4},"path":["employees",3]},{"data":{"id":5},"path":["employees",4]},{"data":{"id":7},"path":["employees",5]},{"data":{"id":8},"path":["employees",6]},{"data":{"id":10},"path":["employees",7]},{"data":{"id":11},"path":["employees",8]},{"data":{"id":12},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products"},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products"},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products"},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products"},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products"},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products"},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products"},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products"},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products"},"path":["employees",8]},{"data":{"notes":"David notes resolved by products"},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},"path":["employees",0]},{"data":{"details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null}},"path":["employees",1]},{"data":{"details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]}},"path":["employees",2]},{"data":{"details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]}},"path":["employees",3]},{"data":{"details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]}},"path":["employees",4]},{"data":{"details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},"path":["employees",5]},{"data":{"details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null}},"path":["employees",6]},{"data":{"details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]}},"path":["employees",7]},{"data":{"details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null}},"path":["employees",8]},{"data":{"details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]}},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},"path":["employees",0]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},"path":["employees",1]},{"data":{"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},"path":["employees",2]},{"data":{"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},"path":["employees",3]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},"path":["employees",4]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",5]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",6]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},"path":["employees",7]},{"data":{"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},"path":["employees",8]},{"data":{"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"products":["FINANCE"]},"path":["employees",8]},{"data":{"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Jens","location":{"language":"German"}}},"path":["employee"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":4},"path":["teammates",0]},{"data":{"id":11},"path":["teammates",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Björn"}},"path":["teammates",0]},{"data":{"details":{"forename":"Alexandra"}},"path":["teammates",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["teammates",0]},{"data":{"products":["FINANCE"]},"path":["teammates",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Sergiy"}},"path":["a",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Björn"}},"path":["b",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.graphql new file mode 100644 index 0000000000..84ebcce542 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.graphql @@ -0,0 +1,77 @@ +fragment EmployeesFields on Employee { + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } +} + +fragment ProductTypesFields on Products { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } +} + +query { + employees { + id + ... @defer { ...EmployeesFields } + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + ... @defer { + productTypes { + ...ProductTypesFields + } + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.txt b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.txt new file mode 100644 index 0000000000..a5ee694819 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside_reconstructed.json new file mode 100644 index 0000000000..40f3103d03 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_11_fragment_around_and_inside_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.graphql new file mode 100644 index 0000000000..087194c021 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.graphql @@ -0,0 +1,75 @@ +fragment EmployeesFields on Employee { + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + ... @defer { + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products + } +} + +fragment ProductTypesFields on Products { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } +} + +query { + employees { + id + ...EmployeesFields + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ...ProductTypesFields + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.txt b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.txt new file mode 100644 index 0000000000..48ce25d494 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1,"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"}},{"id":2,"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"}},{"id":3,"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]}},{"id":4,"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]}},{"id":5,"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"}},{"id":7,"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":8,"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}},{"id":10,"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"}},{"id":11,"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]}},{"id":12,"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"}}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_12_fragment_body_defer_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.graphql b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.graphql new file mode 100644 index 0000000000..b4948ee57d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.graphql @@ -0,0 +1,73 @@ +fragment EmployeesFields on Employee { + notes + details { + forename + surname + location { language } + hasChildren + maritalStatus + nationality + pets { + class + gender + name + ... on Cat { type } + ... on Dog { breed } + ... on Alligator { dangerous } + } + } + role { + departments + title + ... on Engineer { engineerType } + ... on Operator { operatorType } + } + hobbies { + ... on Exercise { category } + ... on Flying { planeModels yearsOfExperience } + ... on Gaming { genres name yearsOfExperience } + ... on Other { name } + ... on Programming { languages } + ... on Travelling { countriesLived { language key { name } } } + } + products +} + +fragment ProductTypesFields on Products { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { details { forename } } + name + } +} + +query { + employees { + id + ...EmployeesFields @defer + } + employee(id: 1) { + id + details { + forename + location { language } + } + } + teammates(team: OPERATIONS) { + id + details { forename } + products + } + productTypes { + ...ProductTypesFields @defer + } + a: findEmployees(criteria: { hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } }) { + details { forename } + } + b: findEmployees(criteria: { hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } }) { + details { forename } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.txt b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.txt new file mode 100644 index 0000000000..ffb8e2c53d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}],"employee":{"id":1,"details":{"forename":"Jens","location":{"language":"German"}}},"teammates":[{"id":4,"details":{"forename":"Björn"},"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},{"id":11,"details":{"forename":"Alexandra"},"products":["FINANCE"]}],"productTypes":[{},{"lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"url":"https://docs.wundergraph.com/","urls":["https://cosmo-docs.wundergraph.com/","https://wundergraph.com/pricing"]}],"a":[{"details":{"forename":"Sergiy"}}],"b":[{"details":{"forename":"Björn"}}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"notes":"Jens notes resolved by products","details":{"forename":"Jens","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING","MARKETING"],"title":["Founder","CEO"],"engineerType":"BACKEND"},"hobbies":[{"category":"SPORT"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":20},{"name":"WunderGraph"},{"languages":["GO","TYPESCRIPT"]},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","MARKETING","SDK"]},"path":["employees",0]},{"data":{"notes":"Dustin notes resolved by products","details":{"forename":"Dustin","surname":"Deus","location":{"language":"German"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"GERMAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Co-founder","Tech Lead"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["FPS"],"name":"Counter Strike","yearsOfExperience":0.5},{"languages":["GO","RUST"]}],"products":["COSMO","SDK"]},"path":["employees",1]},{"data":{"notes":"Stefan notes resolved by products","details":{"forename":"Stefan","surname":"Avram","location":{"language":"English"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"AMERICAN","pets":[{"class":"REPTILE","gender":"UNKNOWN","name":"Snappy","dangerous":"yes"}]},"role":{"departments":["MARKETING"],"title":["Co-founder","Head of Growth"]},"hobbies":[{"category":"HIKING"},{"category":"SPORT"},{"name":"Reading"},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"Serbian","key":{"name":"Serbia"}}]}],"products":["CONSULTANCY","MARKETING"]},"path":["employees",2]},{"data":{"notes":"Björn notes resolved by products","details":{"forename":"Björn","surname":"Schwenzer","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Abby","breed":"GOLDEN_RETRIEVER"},{"class":"MAMMAL","gender":"MALE","name":"Survivor"}]},"role":{"departments":["OPERATIONS","MARKETING"],"title":["Co-founder","COO"],"operatorType":["HUMAN_RESOURCES","FINANCE"]},"hobbies":[{"category":"HIKING"},{"planeModels":["Aquila AT01","Cessna C172","Cessna C206","Cirrus SR20","Cirrus SR22","Diamond DA40","Diamond HK36","Diamond DA20","Piper Cub","Pitts Special","Robin DR400"],"yearsOfExperience":20},{"countriesLived":[{"language":"English","key":{"name":"America"}},{"language":"German","key":{"name":"Germany"}}]}],"products":["FINANCE","HUMAN_RESOURCES","MARKETING"]},"path":["employees",3]},{"data":{"notes":"Sergiy notes resolved by products","details":{"forename":"Sergiy","surname":"Petrunin","location":{"language":"Ukrainian"},"hasChildren":false,"maritalStatus":"ENGAGED","nationality":"UKRAINIAN","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Blotch","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Grayone","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Rusty","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Manya","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Peach","type":"STREET"},{"class":"MAMMAL","gender":"MALE","name":"Panda","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Mommy","type":"STREET"},{"class":"MAMMAL","gender":"FEMALE","name":"Terry","type":"HOME"},{"class":"MAMMAL","gender":"FEMALE","name":"Tilda","type":"HOME"},{"class":"MAMMAL","gender":"MALE","name":"Vasya","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Senior GO Engineer"],"engineerType":"BACKEND"},"hobbies":[{"name":"Building a house"},{"name":"Forumla 1"},{"name":"Raising cats"}],"products":["ENGINE","SDK"]},"path":["employees",4]},{"data":{"notes":"Suvij notes resolved by products","details":{"forename":"Suvij","surname":"Surya","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"genres":["BOARD"],"name":"Chess","yearsOfExperience":9.5},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",5]},{"data":{"notes":"Nithin notes resolved by products","details":{"forename":"Nithin","surname":"Kumar","location":{"language":"Hindi"},"hasChildren":false,"maritalStatus":null,"nationality":"INDIAN","pets":null},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":17},{"name":"Watching anime"}],"products":["COSMO","SDK"]},"path":["employees",6]},{"data":{"notes":"Eelco notes resolved by products","details":{"forename":"Eelco","surname":"Wiersma","location":{"language":"Dutch"},"hasChildren":false,"maritalStatus":null,"nationality":"DUTCH","pets":[{"class":"MAMMAL","gender":"UNKNOWN","name":"Vanson"}]},"role":{"departments":["ENGINEERING"],"title":["Senior Frontend Engineer"],"engineerType":"FRONTEND"},"hobbies":[{"languages":["TYPESCRIPT"]},{"category":"CALISTHENICS"},{"category":"HIKING"},{"category":"STRENGTH_TRAINING"},{"name":"saas-ui"},{"countriesLived":[{"language":"German","key":{"name":"Germany"}},{"language":"Indonesian","key":{"name":"Indonesia"}},{"language":"Dutch","key":{"name":"Netherlands"}},{"language":"Portuguese","key":{"name":"Portugal"}},{"language":"Spanish","key":{"name":"Spain"}},{"language":"Thai","key":{"name":"Thailand"}}]}],"products":["CONSULTANCY","COSMO","SDK"]},"path":["employees",7]},{"data":{"notes":"Alexandra notes resolved by products","details":{"forename":"Alexandra","surname":"Neuse","location":{"language":"German"},"hasChildren":true,"maritalStatus":"MARRIED","nationality":"GERMAN","pets":null},"role":{"departments":["OPERATIONS"],"title":["Accounting & Finance"],"operatorType":["FINANCE"]},"hobbies":[{"name":"Spending time with the family"}],"products":["FINANCE"]},"path":["employees",8]},{"data":{"notes":"David notes resolved by products","details":{"forename":"David","surname":"Stutt","location":{"language":"English"},"hasChildren":false,"maritalStatus":"MARRIED","nationality":"ENGLISH","pets":[{"class":"MAMMAL","gender":"FEMALE","name":"Pepper","type":"HOME"}]},"role":{"departments":["ENGINEERING"],"title":["Software Engineer"],"engineerType":"FULLSTACK"},"hobbies":[{"languages":["CSHARP","GO","RUST","TYPESCRIPT"]},{"category":"STRENGTH_TRAINING"},{"genres":["ADVENTURE","BOARD","CARD","ROGUELITE","RPG","SIMULATION","STRATEGY"],"name":"Miscellaneous","yearsOfExperience":25.5},{"countriesLived":[{"language":"English","key":{"name":"England"}},{"language":"Korean","key":{"name":"Korea"}},{"language":"Taiwanese","key":{"name":"Taiwan"}}]}],"products":["CONSULTANCY","COSMO","ENGINE","SDK"]},"path":["employees",9]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer_reconstructed.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_defer_13_fragment_spread_defer_reconstructed.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/full_original.graphql b/router-tests/protocol/testdata/queries_defer/full_original.graphql new file mode 100644 index 0000000000..7dcebb6c3d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_original.graphql @@ -0,0 +1,125 @@ +query { + employees { + # resolved through employees subgraph + id + # overridden by the products subgraph + notes + details { + # resolved through either employees or family subgraph + forename + surname + # resolved through employees subgraph + location { + language + } + # resolved through family subgraph + hasChildren + # maritalStatus can return null + maritalStatus + nationality + # pets can return null + pets { + class + gender + name + ... on Cat { + type + } + ... on Dog { + breed + } + ... on Alligator { + dangerous + } + } + } + # resolved through employees subgraph + role { + departments + title + ... on Engineer { + engineerType + } + ... on Operator { + operatorType + } + } + # resolved through hobbies subgraph + hobbies { + ... on Exercise { + category + } + ... on Flying { + planeModels + yearsOfExperience + } + ... on Gaming { + genres + name + yearsOfExperience + } + ... on Other { + name + } + ... on Programming { + languages + } + ... on Travelling { + countriesLived { + language + key { + name + } + } + } + } + # resolved through products subgraph + products + } + # can return null + employee(id: 1) { + # resolved through employees subgraph + id + details { + forename + location { + language + } + } + } + teammates(team: OPERATIONS) { + # resolved through employees subgraph + id + ...EmployeeNameFragment + # resolved through products subgraph + products + } + productTypes { + ... on Documentation { + url(product: SDK) + urls(products: [COSMO, MARKETING]) + } + ... on Consultancy { + lead { + ...EmployeeNameFragment + } + name + } + } + a: findEmployees(criteria: { + hasPets: true, nationality: UKRAINIAN, nested: { maritalStatus: ENGAGED } + }) { + ...EmployeeNameFragment + } + b: findEmployees(criteria: { + hasPets: true, nationality: GERMAN, nested: { maritalStatus: MARRIED, hasChildren: true } + }) { + ...EmployeeNameFragment + } +} + +fragment EmployeeNameFragment on Employee { + details { + forename + } +} diff --git a/router-tests/protocol/testdata/queries_defer/full_original.json b/router-tests/protocol/testdata/queries_defer/full_original.json new file mode 100644 index 0000000000..2198cb4313 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/full_original.json @@ -0,0 +1,730 @@ +{ + "data": { + "employees": [ + { + "id": 1, + "notes": "Jens notes resolved by products", + "details": { + "forename": "Jens", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING", + "MARKETING" + ], + "title": [ + "Founder", + "CEO" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "category": "SPORT" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 20 + }, + { + "name": "WunderGraph" + }, + { + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "MARKETING", + "SDK" + ] + }, + { + "id": 2, + "notes": "Dustin notes resolved by products", + "details": { + "forename": "Dustin", + "surname": "Deus", + "location": { + "language": "German" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Co-founder", + "Tech Lead" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "FPS" + ], + "name": "Counter Strike", + "yearsOfExperience": 0.5 + }, + { + "languages": [ + "GO", + "RUST" + ] + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 3, + "notes": "Stefan notes resolved by products", + "details": { + "forename": "Stefan", + "surname": "Avram", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "AMERICAN", + "pets": [ + { + "class": "REPTILE", + "gender": "UNKNOWN", + "name": "Snappy", + "dangerous": "yes" + } + ] + }, + "role": { + "departments": [ + "MARKETING" + ], + "title": [ + "Co-founder", + "Head of Growth" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "category": "SPORT" + }, + { + "name": "Reading" + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "Serbian", + "key": { + "name": "Serbia" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "MARKETING" + ] + }, + { + "id": 4, + "notes": "Björn notes resolved by products", + "details": { + "forename": "Björn", + "surname": "Schwenzer", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Abby", + "breed": "GOLDEN_RETRIEVER" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Survivor" + } + ] + }, + "role": { + "departments": [ + "OPERATIONS", + "MARKETING" + ], + "title": [ + "Co-founder", + "COO" + ], + "operatorType": [ + "HUMAN_RESOURCES", + "FINANCE" + ] + }, + "hobbies": [ + { + "category": "HIKING" + }, + { + "planeModels": [ + "Aquila AT01", + "Cessna C172", + "Cessna C206", + "Cirrus SR20", + "Cirrus SR22", + "Diamond DA40", + "Diamond HK36", + "Diamond DA20", + "Piper Cub", + "Pitts Special", + "Robin DR400" + ], + "yearsOfExperience": 20 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "America" + } + }, + { + "language": "German", + "key": { + "name": "Germany" + } + } + ] + } + ], + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 5, + "notes": "Sergiy notes resolved by products", + "details": { + "forename": "Sergiy", + "surname": "Petrunin", + "location": { + "language": "Ukrainian" + }, + "hasChildren": false, + "maritalStatus": "ENGAGED", + "nationality": "UKRAINIAN", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Blotch", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Grayone", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Rusty", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Manya", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Peach", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Panda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Mommy", + "type": "STREET" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Terry", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Tilda", + "type": "HOME" + }, + { + "class": "MAMMAL", + "gender": "MALE", + "name": "Vasya", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior GO Engineer" + ], + "engineerType": "BACKEND" + }, + "hobbies": [ + { + "name": "Building a house" + }, + { + "name": "Forumla 1" + }, + { + "name": "Raising cats" + } + ], + "products": [ + "ENGINE", + "SDK" + ] + }, + { + "id": 7, + "notes": "Suvij notes resolved by products", + "details": { + "forename": "Suvij", + "surname": "Surya", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "genres": [ + "BOARD" + ], + "name": "Chess", + "yearsOfExperience": 9.5 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 8, + "notes": "Nithin notes resolved by products", + "details": { + "forename": "Nithin", + "surname": "Kumar", + "location": { + "language": "Hindi" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "INDIAN", + "pets": null + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 17 + }, + { + "name": "Watching anime" + } + ], + "products": [ + "COSMO", + "SDK" + ] + }, + { + "id": 10, + "notes": "Eelco notes resolved by products", + "details": { + "forename": "Eelco", + "surname": "Wiersma", + "location": { + "language": "Dutch" + }, + "hasChildren": false, + "maritalStatus": null, + "nationality": "DUTCH", + "pets": [ + { + "class": "MAMMAL", + "gender": "UNKNOWN", + "name": "Vanson" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Senior Frontend Engineer" + ], + "engineerType": "FRONTEND" + }, + "hobbies": [ + { + "languages": [ + "TYPESCRIPT" + ] + }, + { + "category": "CALISTHENICS" + }, + { + "category": "HIKING" + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "name": "saas-ui" + }, + { + "countriesLived": [ + { + "language": "German", + "key": { + "name": "Germany" + } + }, + { + "language": "Indonesian", + "key": { + "name": "Indonesia" + } + }, + { + "language": "Dutch", + "key": { + "name": "Netherlands" + } + }, + { + "language": "Portuguese", + "key": { + "name": "Portugal" + } + }, + { + "language": "Spanish", + "key": { + "name": "Spain" + } + }, + { + "language": "Thai", + "key": { + "name": "Thailand" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "SDK" + ] + }, + { + "id": 11, + "notes": "Alexandra notes resolved by products", + "details": { + "forename": "Alexandra", + "surname": "Neuse", + "location": { + "language": "German" + }, + "hasChildren": true, + "maritalStatus": "MARRIED", + "nationality": "GERMAN", + "pets": null + }, + "role": { + "departments": [ + "OPERATIONS" + ], + "title": [ + "Accounting & Finance" + ], + "operatorType": [ + "FINANCE" + ] + }, + "hobbies": [ + { + "name": "Spending time with the family" + } + ], + "products": [ + "FINANCE" + ] + }, + { + "id": 12, + "notes": "David notes resolved by products", + "details": { + "forename": "David", + "surname": "Stutt", + "location": { + "language": "English" + }, + "hasChildren": false, + "maritalStatus": "MARRIED", + "nationality": "ENGLISH", + "pets": [ + { + "class": "MAMMAL", + "gender": "FEMALE", + "name": "Pepper", + "type": "HOME" + } + ] + }, + "role": { + "departments": [ + "ENGINEERING" + ], + "title": [ + "Software Engineer" + ], + "engineerType": "FULLSTACK" + }, + "hobbies": [ + { + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, + { + "category": "STRENGTH_TRAINING" + }, + { + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "name": "Miscellaneous", + "yearsOfExperience": 25.5 + }, + { + "countriesLived": [ + { + "language": "English", + "key": { + "name": "England" + } + }, + { + "language": "Korean", + "key": { + "name": "Korea" + } + }, + { + "language": "Taiwanese", + "key": { + "name": "Taiwan" + } + } + ] + } + ], + "products": [ + "CONSULTANCY", + "COSMO", + "ENGINE", + "SDK" + ] + } + ], + "employee": { + "id": 1, + "details": { + "forename": "Jens", + "location": { + "language": "German" + } + } + }, + "teammates": [ + { + "id": 4, + "details": { + "forename": "Björn" + }, + "products": [ + "FINANCE", + "HUMAN_RESOURCES", + "MARKETING" + ] + }, + { + "id": 11, + "details": { + "forename": "Alexandra" + }, + "products": [ + "FINANCE" + ] + } + ], + "productTypes": [ + {}, + { + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "url": "https://docs.wundergraph.com/", + "urls": [ + "https://cosmo-docs.wundergraph.com/", + "https://wundergraph.com/pricing" + ] + } + ], + "a": [ + { + "details": { + "forename": "Sergiy" + } + } + ], + "b": [ + { + "details": { + "forename": "Björn" + } + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.graphql new file mode 100644 index 0000000000..c82f062749 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.graphql @@ -0,0 +1,33 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + lead { details { forename } } + repositoryURL + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + ... @defer { + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.txt new file mode 100644 index 0000000000..5995b48648 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","lead":{"details":{"forename":"Dustin"}},"repositoryURL":"https://github.com/wundergraph/cosmo","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..cb006baa1f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_01_single_defer_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..c82f062749 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,33 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + lead { details { forename } } + repositoryURL + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + ... @defer { + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..5995b48648 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","lead":{"details":{"forename":"Dustin"}},"repositoryURL":"https://github.com/wundergraph/cosmo","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..cb006baa1f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..68ee2aade4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,33 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + ... @defer { + repositoryURL + lead { details { forename } } + } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..ae554c1e09 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo","lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..3124058ba3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "upc": "cosmo", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..33f5221fb7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.graphql @@ -0,0 +1,33 @@ +query { + ... @defer { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + lead { details { forename } } + repositoryURL + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..8e7c33c70c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{},{"name":"COSMO","lead":{"details":{"forename":"Dustin"}},"repositoryURL":"https://github.com/wundergraph/cosmo","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..cb006baa1f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..4fee6963d2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.graphql @@ -0,0 +1,33 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + ... @defer { + repositoryURL + ... @defer { lead { details { forename } } } + } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.txt new file mode 100644 index 0000000000..b2f9b53270 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo"},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..3124058ba3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "upc": "cosmo", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..5ce6d8b40c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.graphql @@ -0,0 +1,35 @@ +query { + ... @defer { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + ... @defer { + repositoryURL + lead { details { forename } } + } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..9f21d0fb4b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{},{"name":"COSMO","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo","lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..6a5b6a9c4c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ], + "products": [ + {}, + { + "name": "COSMO", + "upc": "cosmo", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..fd720968f8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.graphql @@ -0,0 +1,31 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + ... @defer { repositoryURL } + ... @defer { lead { details { forename } } } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..b2f9b53270 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo"},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..3124058ba3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "upc": "cosmo", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..82def318b7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.graphql @@ -0,0 +1,31 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + repositoryURL + ... @defer { lead { details { forename } } } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + name + ... @defer { lead { details { forename } } } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..9ec2fdac0b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","repositoryURL":"https://github.com/wundergraph/cosmo","upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Jens"}}},"path":["productTypes",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..3b66e09d7a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "name": "CONSULTANCY", + "lead": { + "details": { + "forename": "Jens" + } + } + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..300b9fabea --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,34 @@ +query { + products { + ... on IProduct { + upc + } + ... on Cosmo { + name + lead { details { forename } } + ... @defer { + lead { details { forename } } + repositoryURL + } + } + ... on SDK { + owner { details { forename } } + clientLanguages + unicode + } + } + productTypes { + __typename + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..9ab18657eb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","lead":{"details":{"forename":"Dustin"}},"upc":"cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","upc":"sdk"}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo"},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..7f6ae911ab --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "upc": "cosmo", + "repositoryURL": "https://github.com/wundergraph/cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..7870ccf0b1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.graphql @@ -0,0 +1,37 @@ +query { + ... @defer { + products { + ... on IProduct @defer { + upc + } + ... on Cosmo { + ... @defer { name } + ... @defer { repositoryURL } + ... @defer { lead { details { forename } } } + } + ... on SDK { + ... @defer { clientLanguages } + ... @defer { unicode } + ... @defer { owner { details { forename } } } + } + } + } + ... @defer { + productTypes { + __typename + ... on IProduct @defer { + upc + } + ... on Documentation { + ... @defer { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + } + ... on Consultancy { + ... @defer { name } + ... @defer { lead { details { forename } } } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..dc83d62d0f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel.txt @@ -0,0 +1,73 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["products",1]},{"data":{"upc":"sdk"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"name":"COSMO"},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"repositoryURL":"https://github.com/wundergraph/cosmo"},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"clientLanguages":["RUST","TYPESCRIPT"]},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"unicode":"😀♥!\u0015\u0010🝥"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"owner":{"details":{"forename":"Jens"}}},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"productTypes":[{"__typename":"Cosmo"},{"__typename":"Consultancy"},{"__typename":"Documentation"}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["productTypes",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]},"path":["productTypes",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"name":"CONSULTANCY"},"path":["productTypes",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Jens"}}},"path":["productTypes",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..4ecb47963f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "upc": "cosmo", + "name": "COSMO", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "upc": "sdk", + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "owner": { + "details": { + "forename": "Jens" + } + } + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "name": "CONSULTANCY", + "lead": { + "details": { + "forename": "Jens" + } + } + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.graphql new file mode 100644 index 0000000000..df06d2be28 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.graphql @@ -0,0 +1,39 @@ +fragment CosmoDetails on Cosmo { + name + repositoryURL + ... @defer { lead { details { forename } } } +} + +fragment SDKDetails on SDK { + clientLanguages + unicode + owner { details { forename } } +} + +fragment ProductTypeDetails on Products { + ... on IProduct { + upc + } + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } +} + +query { + products { + ... on IProduct @defer { + upc + } + ... @defer { ...CosmoDetails } + ... @defer { ...SDKDetails } + } + productTypes { + __typename + ...ProductTypeDetails + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.txt b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.txt new file mode 100644 index 0000000000..b58f64c082 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","repositoryURL":"https://github.com/wundergraph/cosmo"},{"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥","owner":{"details":{"forename":"Jens"}}}],"productTypes":[{"__typename":"Cosmo","upc":"cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["products",1]},{"data":{"upc":"sdk"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"details":{"forename":"Dustin"}}},"path":["products",1]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside_reconstructed.json new file mode 100644 index 0000000000..98e61bc62b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_11_fragment_around_and_inside_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo", + "lead": { + "details": { + "forename": "Dustin" + } + } + }, + { + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "owner": { + "details": { + "forename": "Jens" + } + }, + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql new file mode 100644 index 0000000000..e86d7fd56d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql @@ -0,0 +1,69 @@ +query { + products { + ...IProductFragment + ...CosmoFragment + ...SDKFragment + } + productTypes { + __typename + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ...IProductFragment + ... on Consultancy { + lead { + details { + forename + } + } + name + } + } +} + +fragment IProductFragment on IProduct { + ... @defer { + upc + } +} + +fragment CosmoFragment on Cosmo { + name + lead { + ... @defer { + details { + forename + } + } + } + repositoryURL +} + +fragment SDKFragment on SDK { + owner { + details { + forename + } + } + clientLanguages + unicode +} + +fragment EmployeeFragment on Employee { + id + details { + ... @defer { + forename + location { + language + } + } + maritalStatus + } + role { + departments + title + } + products +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql.todo b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql.todo new file mode 100644 index 0000000000..4f6cf2beb1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.graphql.todo @@ -0,0 +1,39 @@ +fragment CosmoDetails on Cosmo { + name + ... @defer { + repositoryURL + lead { details { forename } } + } +} + +fragment SDKDetails on SDK { + ... @defer { + clientLanguages + unicode + owner { details { forename } } + } +} + +fragment ProductTypeDetails on ProductType { + upc + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ... on Consultancy { + lead { details { forename } } + name + } +} + +query { + products { + upc + ...CosmoDetails + ...SDKDetails + } + productTypes { + __typename + ...ProductTypeDetails + } +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.txt b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.txt new file mode 100644 index 0000000000..23ad231ba3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer.txt @@ -0,0 +1,23 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{"name":"COSMO","lead":{},"repositoryURL":"https://github.com/wundergraph/cosmo"},{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥"}],"productTypes":[{"__typename":"Cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation","url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["products",1]},{"data":{"upc":"sdk"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"details":{"forename":"Dustin"}},"path":["products",1,"lead"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["productTypes",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer_reconstructed.json new file mode 100644 index 0000000000..cb006baa1f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_12_fragment_body_defer_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.graphql b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.graphql new file mode 100644 index 0000000000..6b2028c007 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.graphql @@ -0,0 +1,63 @@ +query { + products { + ...IProductFragment @defer + ...CosmoFragment @defer + ...SDKFragment @defer + } + productTypes { + __typename + ... on Documentation @defer { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ...IProductFragment @defer + ... on Consultancy { + lead { + details { + forename + } + } + name + } + } +} + +fragment IProductFragment on IProduct { + upc +} + +fragment CosmoFragment on Cosmo { + name + lead { + details { + forename + } + } + repositoryURL +} + +fragment SDKFragment on SDK { + owner { + details { + forename + } + } + clientLanguages + unicode +} + +fragment EmployeeFragment on Employee { + id + details { + forename + location { + language + } + maritalStatus + } + role { + departments + title + } + products +} diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.txt b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.txt new file mode 100644 index 0000000000..a026201725 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer.txt @@ -0,0 +1,33 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{},{}],"productTypes":[{"__typename":"Cosmo"},{"__typename":"Consultancy","lead":{"details":{"forename":"Jens"}},"name":"CONSULTANCY"},{"__typename":"Documentation"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["products",1]},{"data":{"upc":"sdk"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"name":"COSMO","lead":{"details":{"forename":"Dustin"}},"repositoryURL":"https://github.com/wundergraph/cosmo"},"path":["products",1]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"owner":{"details":{"forename":"Jens"}},"clientLanguages":["RUST","TYPESCRIPT"],"unicode":"😀♥!\u0015\u0010🝥"},"path":["products",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"url":"https://cosmo-docs.wundergraph.com/","urls":["https://cal.com/stefan-avram-wundergraph/wundergraph-introduction","https://github.com/wundergraph/graphql-go-tools/blob/master/README.md","N/A","https://docs.wundergraph.com/"]},"path":["productTypes",2]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"upc":"cosmo"},"path":["productTypes",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer_reconstructed.json new file mode 100644 index 0000000000..01826bbec3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_defer_13_fragment_spread_defer_reconstructed.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "upc": "cosmo", + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo" + }, + { + "upc": "sdk", + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/products_original.graphql b/router-tests/protocol/testdata/queries_defer/products_original.graphql new file mode 100644 index 0000000000..96d9e8c4f3 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_original.graphql @@ -0,0 +1,63 @@ +query { + products { + ...IProductFragment + ...CosmoFragment + ...SDKFragment + } + productTypes { + __typename + ... on Documentation { + url(product: COSMO) + urls(products: [CONSULTANCY, ENGINE, HUMAN_RESOURCES, SDK]) + } + ...IProductFragment + ... on Consultancy { + lead { + details { + forename + } + } + name + } + } +} + +fragment IProductFragment on IProduct { + upc +} + +fragment CosmoFragment on Cosmo { + name + lead { + details { + forename + } + } + repositoryURL +} + +fragment SDKFragment on SDK { + owner { + details { + forename + } + } + clientLanguages + unicode +} + +fragment EmployeeFragment on Employee { + id + details { + forename + location { + language + } + maritalStatus + } + role { + departments + title + } + products +} diff --git a/router-tests/protocol/testdata/queries_defer/products_original.json b/router-tests/protocol/testdata/queries_defer/products_original.json new file mode 100644 index 0000000000..cb006baa1f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/products_original.json @@ -0,0 +1,55 @@ +{ + "data": { + "products": [ + {}, + { + "name": "COSMO", + "lead": { + "details": { + "forename": "Dustin" + } + }, + "repositoryURL": "https://github.com/wundergraph/cosmo", + "upc": "cosmo" + }, + { + "owner": { + "details": { + "forename": "Jens" + } + }, + "clientLanguages": [ + "RUST", + "TYPESCRIPT" + ], + "unicode": "😀♥!\u0015\u0010🝥", + "upc": "sdk" + } + ], + "productTypes": [ + { + "__typename": "Cosmo", + "upc": "cosmo" + }, + { + "__typename": "Consultancy", + "lead": { + "details": { + "forename": "Jens" + } + }, + "name": "CONSULTANCY" + }, + { + "__typename": "Documentation", + "url": "https://cosmo-docs.wundergraph.com/", + "urls": [ + "https://cal.com/stefan-avram-wundergraph/wundergraph-introduction", + "https://github.com/wundergraph/graphql-go-tools/blob/master/README.md", + "N/A", + "https://docs.wundergraph.com/" + ] + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.graphql new file mode 100644 index 0000000000..2601c955c8 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.graphql @@ -0,0 +1,15 @@ +query Requires { + products { + __typename + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + isLeadAvailable + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.txt new file mode 100644 index 0000000000..6fa88bc6dd --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"},"isLeadAvailable":false},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..e984c43f01 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_01_single_defer_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + }, + "isLeadAvailable": false + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..66526603a7 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,15 @@ +query Requires { + products { + __typename + ... on Consultancy { + isLeadAvailable + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..e15cf7b9c9 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy","isLeadAvailable":false},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..18d83bf7a2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,15 @@ +query Requires { + products { + __typename + ... on Consultancy { + ... @defer { isLeadAvailable } + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..e920efcbc5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"isLeadAvailable":false},"path":["products",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..a95176e816 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.graphql @@ -0,0 +1,15 @@ +query Requires { + ... @defer { + products { + __typename + ... on Consultancy { + lead { + __typename + id + derivedMood + } + isLeadAvailable + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..488dc231e1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"__typename":"Consultancy","lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"},"isLeadAvailable":false},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..e984c43f01 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + }, + "isLeadAvailable": false + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..d9a261fa0e --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.graphql @@ -0,0 +1,17 @@ +query Requires { + ... @defer { + products { + __typename + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + isLeadAvailable + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.txt new file mode 100644 index 0000000000..64df6dc3bb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"},"isLeadAvailable":false},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..e984c43f01 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + }, + "isLeadAvailable": false + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..2c8acc1208 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.graphql @@ -0,0 +1,17 @@ +query Requires { + ... @defer { + products { + __typename + ... on Consultancy { + isLeadAvailable + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..b09a2def55 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"__typename":"Consultancy","isLeadAvailable":false},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..18d83bf7a2 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.graphql @@ -0,0 +1,15 @@ +query Requires { + products { + __typename + ... on Consultancy { + ... @defer { isLeadAvailable } + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..e920efcbc5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"isLeadAvailable":false},"path":["products",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..ba5d41e5dd --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.graphql @@ -0,0 +1,13 @@ +query Requires { + products { + __typename + ... on Consultancy { + isLeadAvailable + lead { + __typename + id + ... @defer { derivedMood } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..531dbedd25 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy","isLeadAvailable":false,"lead":{"__typename":"Employee","id":1}},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..9cf3c1facb --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,12 @@ +query Requires { + products { + __typename + ... on Consultancy { + lead { __typename id } + ... @defer { + lead { derivedMood } + isLeadAvailable + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..84e918035e --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy","lead":{"__typename":"Employee","id":1}},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"isLeadAvailable":false},"path":["products",0]},{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..e984c43f01 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + }, + "isLeadAvailable": false + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..2f571c097a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.graphql @@ -0,0 +1,17 @@ +query Requires { + ... @defer { + products { + __typename + ... on Consultancy { + ... @defer { isLeadAvailable } + ... @defer { + lead { + __typename + ... @defer { id } + ... @defer { derivedMood } + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..92e5e9b74f --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel.txt @@ -0,0 +1,33 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"isLeadAvailable":false},"path":["products",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee"}},"path":["products",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["products",0,"lead"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.graphql new file mode 100644 index 0000000000..2ef53cd835 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.graphql @@ -0,0 +1,15 @@ +fragment ConsultancyDetails on Consultancy { + isLeadAvailable + lead { + __typename + id + ... @defer { derivedMood } + } +} + +query Requires { + products { + __typename + ... @defer { ...ConsultancyDetails } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.txt new file mode 100644 index 0000000000..531dbedd25 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy","isLeadAvailable":false,"lead":{"__typename":"Employee","id":1}},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_11_fragment_around_and_inside_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.graphql new file mode 100644 index 0000000000..0119bac569 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.graphql @@ -0,0 +1,15 @@ +fragment ConsultancyDetails on Consultancy { + isLeadAvailable + lead { + __typename + id + ... @defer { derivedMood } + } +} + +query Requires { + products { + __typename + ...ConsultancyDetails + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.txt new file mode 100644 index 0000000000..531dbedd25 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy","isLeadAvailable":false,"lead":{"__typename":"Employee","id":1}},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_12_fragment_body_defer_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.graphql new file mode 100644 index 0000000000..8250ac9d1b --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.graphql @@ -0,0 +1,15 @@ +fragment ConsultancyDetails on Consultancy { + isLeadAvailable + lead { + __typename + id + derivedMood + } +} + +query Requires { + products { + __typename + ...ConsultancyDetails @defer + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.txt new file mode 100644 index 0000000000..b6e1b67373 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"__typename":"Consultancy"},{"__typename":"Cosmo"},{"__typename":"SDK"}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"isLeadAvailable":false,"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer_reconstructed.json new file mode 100644 index 0000000000..45f330ce49 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_defer_13_fragment_spread_defer_reconstructed.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "isLeadAvailable": false, + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.graphql b/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.graphql new file mode 100644 index 0000000000..12ce47ae98 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.graphql @@ -0,0 +1,13 @@ +query Requires { + products { + __typename + ... on Consultancy { + lead { + __typename + id + derivedMood + } + isLeadAvailable + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.json b/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.json new file mode 100644 index 0000000000..e984c43f01 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_different_depth_original.json @@ -0,0 +1,21 @@ +{ + "data": { + "products": [ + { + "__typename": "Consultancy", + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + }, + "isLeadAvailable": false + }, + { + "__typename": "Cosmo" + }, + { + "__typename": "SDK" + } + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.graphql new file mode 100644 index 0000000000..92eae02426 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.graphql @@ -0,0 +1,13 @@ +query RequiresMood { + products { + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.txt new file mode 100644 index 0000000000..10d60e5dc1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_01_single_defer_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.graphql new file mode 100644 index 0000000000..9c639b6a08 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.graphql @@ -0,0 +1,11 @@ +query RequiresMood { + products { + ... on Consultancy { + lead { + __typename + id + ... @defer { derivedMood } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.txt new file mode 100644 index 0000000000..79830de216 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"lead":{"__typename":"Employee","id":1}},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_02_single_defer_between_regular_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.graphql new file mode 100644 index 0000000000..92eae02426 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.graphql @@ -0,0 +1,13 @@ +query RequiresMood { + products { + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.txt new file mode 100644 index 0000000000..10d60e5dc1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_03_multiple_fields_deferred_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.graphql new file mode 100644 index 0000000000..cbff26083c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.graphql @@ -0,0 +1,13 @@ +query RequiresMood { + ... @defer { + products { + ... on Consultancy { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.txt new file mode 100644 index 0000000000..4fa6f36fe5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},{},{}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_04_all_fields_deferred_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.graphql new file mode 100644 index 0000000000..35c652381a --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.graphql @@ -0,0 +1,15 @@ +query RequiresMood { + ... @defer { + products { + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.txt new file mode 100644 index 0000000000..036ad683a4 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer.txt @@ -0,0 +1,18 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_05_nested_defer_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.graphql new file mode 100644 index 0000000000..cbff26083c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.graphql @@ -0,0 +1,13 @@ +query RequiresMood { + ... @defer { + products { + ... on Consultancy { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.txt new file mode 100644 index 0000000000..4fa6f36fe5 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},{},{}]},"path":[]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_06_nested_defer_variation_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.graphql new file mode 100644 index 0000000000..92eae02426 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.graphql @@ -0,0 +1,13 @@ +query RequiresMood { + products { + ... on Consultancy { + ... @defer { + lead { + __typename + id + derivedMood + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.txt new file mode 100644 index 0000000000..10d60e5dc1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_07_parallel_defers_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.graphql new file mode 100644 index 0000000000..9c639b6a08 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.graphql @@ -0,0 +1,11 @@ +query RequiresMood { + products { + ... on Consultancy { + lead { + __typename + id + ... @defer { derivedMood } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.txt new file mode 100644 index 0000000000..79830de216 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"lead":{"__typename":"Employee","id":1}},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_08_defer_nested_object_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.graphql new file mode 100644 index 0000000000..04c6d10718 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.graphql @@ -0,0 +1,10 @@ +query RequiresMood { + products { + ... on Consultancy { + lead { __typename id } + ... @defer { + lead { derivedMood } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.txt new file mode 100644 index 0000000000..79830de216 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"lead":{"__typename":"Employee","id":1}},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_09_duplicated_field_across_defer_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.graphql new file mode 100644 index 0000000000..d5177e3f7d --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.graphql @@ -0,0 +1,15 @@ +query RequiresMood { + ... @defer { + products { + ... on Consultancy { + ... @defer { + lead { + __typename + ... @defer { id } + ... @defer { derivedMood } + } + } + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.txt new file mode 100644 index 0000000000..582e5d3975 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel.txt @@ -0,0 +1,28 @@ + +--graphql +Content-Type: application/json + +{"data":{},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"products":[{},{},{}]},"path":[]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee"}},"path":["products",0]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"id":1},"path":["products",0,"lead"]}],"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_10_extensive_parallel_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.graphql new file mode 100644 index 0000000000..c38fbd1320 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.graphql @@ -0,0 +1,13 @@ +fragment ConsultancyLead on Consultancy { + lead { + __typename + id + ... @defer { derivedMood } + } +} + +query RequiresMood { + products { + ... @defer { ...ConsultancyLead } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.txt new file mode 100644 index 0000000000..79830de216 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"lead":{"__typename":"Employee","id":1}},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_11_fragment_around_and_inside_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.graphql new file mode 100644 index 0000000000..ebe2e79215 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.graphql @@ -0,0 +1,13 @@ +fragment ConsultancyLead on Consultancy { + lead { + __typename + id + ... @defer { derivedMood } + } +} + +query RequiresMood { + products { + ...ConsultancyLead + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.txt new file mode 100644 index 0000000000..79830de216 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{"lead":{"__typename":"Employee","id":1}},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"derivedMood":"HAPPY"},"path":["products",0,"lead"]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_12_fragment_body_defer_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.graphql new file mode 100644 index 0000000000..4775ee10ba --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.graphql @@ -0,0 +1,13 @@ +fragment ConsultancyLead on Consultancy { + lead { + __typename + id + derivedMood + } +} + +query RequiresMood { + products { + ...ConsultancyLead @defer + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.txt b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.txt new file mode 100644 index 0000000000..10d60e5dc1 --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer.txt @@ -0,0 +1,13 @@ + +--graphql +Content-Type: application/json + +{"data":{"products":[{},{},{}]},"hasNext":true} + +--graphql +Content-Type: application/json + +{"incremental":[{"data":{"lead":{"__typename":"Employee","id":1,"derivedMood":"HAPPY"}},"path":["products",0]}],"hasNext":false} + +--graphql +--graphql-- diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer_reconstructed.json b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer_reconstructed.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_defer_13_fragment_spread_defer_reconstructed.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_original.graphql b/router-tests/protocol/testdata/queries_defer/requires_mood_original.graphql new file mode 100644 index 0000000000..1d0775039c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_original.graphql @@ -0,0 +1,11 @@ +query RequiresMood { + products { + ... on Consultancy { + lead { + __typename + id + derivedMood + } + } + } +} diff --git a/router-tests/protocol/testdata/queries_defer/requires_mood_original.json b/router-tests/protocol/testdata/queries_defer/requires_mood_original.json new file mode 100644 index 0000000000..cf34d4bd9c --- /dev/null +++ b/router-tests/protocol/testdata/queries_defer/requires_mood_original.json @@ -0,0 +1,15 @@ +{ + "data": { + "products": [ + { + "lead": { + "__typename": "Employee", + "id": 1, + "derivedMood": "HAPPY" + } + }, + {}, + {} + ] + } +} \ No newline at end of file diff --git a/router-tests/testenv/testenv.go b/router-tests/testenv/testenv.go index 93da790b38..59cb86f8ef 100644 --- a/router-tests/testenv/testenv.go +++ b/router-tests/testenv/testenv.go @@ -2370,6 +2370,17 @@ func (e *Environment) MakeGraphQLMultipartRequest(method string, body io.Reader) return req } +func (e *Environment) MakeGraphQLDeferRequest(method string, body io.Reader) *http.Request { + req, err := http.NewRequest(method, e.GraphQLRequestURL(), body) + require.NoError(e.t, err) + + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "multipart/mixed") + req.Header.Set("Connection", "keep-alive") + + return req +} + func (e *Environment) GraphQLWebSocketSubscriptionURL() string { u, err := url.Parse(e.GraphQLRequestURL()) require.NoError(e.t, err) diff --git a/router/core/context.go b/router/core/context.go index b29e8f9c3e..81da71bde5 100644 --- a/router/core/context.go +++ b/router/core/context.go @@ -17,6 +17,7 @@ import ( "go.uber.org/zap" "github.com/wundergraph/astjson" + graphqlmetrics "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/graphqlmetrics/v1" rcontext "github.com/wundergraph/cosmo/router/internal/context" "github.com/wundergraph/cosmo/router/internal/expr" @@ -300,12 +301,10 @@ func SubgraphHeadersBuilder(ctx *requestContext, headerPropagation *HeaderPropag keyGen := xxhash.New() - switch p := executionPlan.(type) { - case *plan.SynchronousResponsePlan: - headers := make(map[string]*HeaderWithHash, len(p.Response.DataSources)) - for i := range p.Response.DataSources { - h, hh := headerPropagation.BuildRequestHeaderForSubgraph(p.Response.DataSources[i].Name, ctx) - headers[p.Response.DataSources[i].Name] = &HeaderWithHash{ + makeHeaders := func(headers map[string]*HeaderWithHash, dataSources []resolve.DataSourceInfo) { + for i := range dataSources { + h, hh := headerPropagation.BuildRequestHeaderForSubgraph(dataSources[i].Name, ctx) + headers[dataSources[i].Name] = &HeaderWithHash{ Header: h, Hash: hh, } @@ -313,22 +312,29 @@ func SubgraphHeadersBuilder(ctx *requestContext, headerPropagation *HeaderPropag binary.LittleEndian.PutUint64(b[:], hh) _, _ = keyGen.Write(b[:]) } + } + + switch p := executionPlan.(type) { + case *plan.SynchronousResponsePlan: + headers := make(map[string]*HeaderWithHash, len(p.Response.DataSources)) + makeHeaders(headers, p.Response.DataSources) + + return &headerBuilder{ + headers: headers, + allHash: keyGen.Sum64(), + } + case *plan.DeferResponsePlan: + headers := make(map[string]*HeaderWithHash, len(p.Response.Response.DataSources)) + makeHeaders(headers, p.Response.Response.DataSources) + return &headerBuilder{ headers: headers, allHash: keyGen.Sum64(), } case *plan.SubscriptionResponsePlan: headers := make(map[string]*HeaderWithHash, len(p.Response.Response.DataSources)+1) - for i := range p.Response.Response.DataSources { - h, hh := headerPropagation.BuildRequestHeaderForSubgraph(p.Response.Response.DataSources[i].Name, ctx) - headers[p.Response.Response.DataSources[i].Name] = &HeaderWithHash{ - Header: h, - Hash: hh, - } - var b [8]byte - binary.LittleEndian.PutUint64(b[:], hh) - _, _ = keyGen.Write(b[:]) - } + makeHeaders(headers, p.Response.Response.DataSources) + h, hh := headerPropagation.BuildRequestHeaderForSubgraph(p.Response.Trigger.SourceName, ctx) headers[p.Response.Trigger.SourceName] = &HeaderWithHash{ Header: h, diff --git a/router/core/defer_response_writer.go b/router/core/defer_response_writer.go new file mode 100644 index 0000000000..5671143844 --- /dev/null +++ b/router/core/defer_response_writer.go @@ -0,0 +1,110 @@ +package core + +import ( + "bytes" + "context" + "io" + "net/http" + + "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" +) + +type HttpDeferWriter struct { + ctx context.Context + writer io.Writer + flusher http.Flusher + buf *bytes.Buffer + firstMessage bool +} + +var _ resolve.DeferResponseWriter = (*HttpDeferWriter)(nil) + +func (f *HttpDeferWriter) Complete() { + if f.ctx.Err() != nil { + return + } + + _, _ = f.writer.Write([]byte("\r\n--" + multipartBoundary + "--\r\n")) + + // Flush before closing the writer to ensure all data is sent + f.flusher.Flush() +} + +func (f *HttpDeferWriter) Write(p []byte) (n int, err error) { + if err = f.ctx.Err(); err != nil { + return + } + + return f.buf.Write(p) +} + +func (f *HttpDeferWriter) Flush() (err error) { + if err = f.ctx.Err(); err != nil { + return err + } + + resp := f.buf.Bytes() + f.buf.Reset() + + flushBreak := "" + if f.firstMessage { + flushBreak = multipartStart + f.firstMessage = false + } + + // For @defer, each payload must be formatted as a multipart/mixed part. + // For Apollo, the payload itself is raw JSON (not wrapped in a `payload` field like subscriptions). + // \r\n--graphql\r\n + // Content-Type: application/json; charset=utf-8\r\n + // \r\n + // {"data": {...}, "incremental": [...], "hasNext": true} + // \r\n + flushBreak += "\r\nContent-Type: " + jsonContent + "\r\n\r\n" + + separation := "\r\n" + multipartStart + + // resp sometimes ends with newlines. We need to remove them + // to cleanly add the separation in the next step. + if bytes.HasSuffix(resp, []byte{'\n'}) { + resp = bytes.TrimRight(resp, "\n") + } + + full := flushBreak + string(resp) + separation + _, err = f.writer.Write([]byte(full)) + if err != nil { + return err + } + + // Flush before closing the writer to ensure all data is sent + f.flusher.Flush() + + return nil +} + +func GetDeferResponseWriter(ctx *resolve.Context, _ *http.Request, w http.ResponseWriter) (*resolve.Context, resolve.DeferResponseWriter, bool) { + flusher, ok := w.(http.Flusher) + if !ok { + return ctx, nil, false + } + + // Standard headers for Apollo Client @defer support + w.Header().Set("Content-Type", "multipart/mixed; deferSpec=20220824; boundary=\""+multipartBoundary+"\"") + w.Header().Set("Transfer-Encoding", "chunked") + w.Header().Set("Cache-Control", "no-cache") + w.Header().Set("Connection", "keep-alive") + // allow unbuffered responses, it's used when it's necessary just to pass response through + // setting this to “yes” will allow the response to be cached + w.Header().Set("X-Accel-Buffering", "no") + + flushWriter := &HttpDeferWriter{ + writer: w, + flusher: flusher, + buf: &bytes.Buffer{}, + firstMessage: true, + } + + flushWriter.ctx = ctx.Context() + + // execution engine heartbeat not needed for defer? + return ctx, flushWriter, true +} diff --git a/router/core/graphql_handler.go b/router/core/graphql_handler.go index bdd0f71767..4969f55257 100644 --- a/router/core/graphql_handler.go +++ b/router/core/graphql_handler.go @@ -323,6 +323,67 @@ func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { }) return } + case *plan.DeferResponsePlan: + var ( + writer resolve.DeferResponseWriter + ok bool + ) + h.setDebugCacheHeaders(w, reqCtx.operation) + + defer propagateSubgraphErrors(resolveCtx) + resolveCtx, writer, ok = GetDeferResponseWriter(resolveCtx, r, w) + if !ok { + reqCtx.logger.Error("unable to get defer response writer", zap.Error(errCouldNotFlushResponse)) + trackFinalResponseError(r.Context(), errCouldNotFlushResponse) + writeRequestErrors(writeRequestErrorsParams{ + request: r, + writer: w, + statusCode: http.StatusInternalServerError, + requestErrors: graphqlerrors.RequestErrorsFromError(errCouldNotFlushResponse), + logger: reqCtx.logger, + headerPropagation: h.headerPropagation, + }) + return + } + + if !resolveCtx.ExecutionOptions.SkipLoader { + h.engineStats.ConnectionsInc() + defer h.engineStats.ConnectionsDec() + } + + _, err := h.executor.Resolver.ResolveGraphQLDeferResponse(resolveCtx, p.Response, writer) + reqCtx.dataSourceNames = getSubgraphNames(p.Response.Response.DataSources) + + if err != nil { + if errors.Is(err, context.Canceled) { + reqCtx.logger.Debug("context canceled: unable to resolve defer response", zap.Error(err)) + trackFinalResponseError(r.Context(), err) + return + } else if errors.Is(err, ErrUnauthorized) { + trackFinalResponseError(resolveCtx.Context(), err) + writeRequestErrors(writeRequestErrorsParams{ + request: r, + writer: w, + statusCode: http.StatusUnauthorized, + requestErrors: graphqlerrors.RequestErrorsFromError(err), + logger: reqCtx.logger, + headerPropagation: h.headerPropagation, + }) + return + } + + reqCtx.logger.Error("unable to resolve defer response", zap.Error(err)) + trackFinalResponseError(resolveCtx.Context(), err) + writeRequestErrors(writeRequestErrorsParams{ + request: r, + writer: w, + statusCode: http.StatusInternalServerError, + requestErrors: graphqlerrors.RequestErrorsFromError(errCouldNotResolveResponse), + logger: reqCtx.logger, + headerPropagation: h.headerPropagation, + }) + return + } default: reqCtx.logger.Error("unsupported plan kind") trackFinalResponseError(resolveCtx.Context(), errOperationPlanUnsupported) diff --git a/router/core/graphql_prehandler.go b/router/core/graphql_prehandler.go index 8c6bbb0af6..38da922ce9 100644 --- a/router/core/graphql_prehandler.go +++ b/router/core/graphql_prehandler.go @@ -1147,6 +1147,17 @@ func (h *PreHandler) handleOperation(req *http.Request, httpOperation *httpOpera requestContext.telemetry.ReleaseAttributes(&planningAttrs) + var printedPlan string + switch p := requestContext.operation.preparedPlan.preparedPlan.(type) { + case *plan.SynchronousResponsePlan: + printedPlan = p.Response.Fetches.QueryPlan().PrettyPrint() + case *plan.SubscriptionResponsePlan: + printedPlan = p.Response.Response.Fetches.QueryPlan().PrettyPrint() + case *plan.DeferResponsePlan: + printedPlan = p.Response.QueryPlanString() + } + fmt.Println("response plan:", printedPlan) + // we could log the query plan only if query plans are calculated if (h.queryPlansEnabled && requestContext.operation.executionOptions.IncludeQueryPlanInResponse) || h.alwaysIncludeQueryPlan { @@ -1154,6 +1165,8 @@ func (h *PreHandler) handleOperation(req *http.Request, httpOperation *httpOpera switch p := requestContext.operation.preparedPlan.preparedPlan.(type) { case *plan.SynchronousResponsePlan: p.Response.Fetches.NormalizedQuery = operationKit.parsedOperation.NormalizedRepresentation + case *plan.DeferResponsePlan: + // TODO: handle } if h.queryPlansLoggingEnabled { @@ -1163,6 +1176,8 @@ func (h *PreHandler) handleOperation(req *http.Request, httpOperation *httpOpera printedPlan = p.Response.Fetches.QueryPlan().PrettyPrint() case *plan.SubscriptionResponsePlan: printedPlan = p.Response.Response.Fetches.QueryPlan().PrettyPrint() + case *plan.DeferResponsePlan: + // TODO: handle } if h.developmentMode { h.log.Sugar().Debugf("Query Plan:\n%s", printedPlan) diff --git a/router/core/operation_planner.go b/router/core/operation_planner.go index f9da57396f..68c3426930 100644 --- a/router/core/operation_planner.go +++ b/router/core/operation_planner.go @@ -7,14 +7,15 @@ import ( "golang.org/x/sync/singleflight" - graphqlmetricsv1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/graphqlmetrics/v1" - "github.com/wundergraph/cosmo/router/pkg/graphqlschemausage" - "github.com/wundergraph/cosmo/router/pkg/slowplancache" "github.com/wundergraph/graphql-go-tools/v2/pkg/ast" "github.com/wundergraph/graphql-go-tools/v2/pkg/astparser" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/plan" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/postprocess" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" + + graphqlmetricsv1 "github.com/wundergraph/cosmo/router/gen/proto/wg/cosmo/graphqlmetrics/v1" + "github.com/wundergraph/cosmo/router/pkg/graphqlschemausage" + "github.com/wundergraph/cosmo/router/pkg/slowplancache" ) type planWithMetaData struct { @@ -81,15 +82,22 @@ func (p *OperationPlanner) planOperation(content string, name string, includeQue return nil, err } - var preparedPlan plan.Plan - if includeQueryPlan { - preparedPlan = planner.Plan(&doc, p.executor.RouterSchema, name, &report, plan.IncludeQueryPlanInResponse()) - } else { - preparedPlan = planner.Plan(&doc, p.executor.RouterSchema, name, &report) + var ( + plannerOptions []plan.Opts + ) + + if includeQueryPlan || true { // TMP: always calculate query plans + plannerOptions = append(plannerOptions, plan.IncludeQueryPlanInResponse()) } + + // create the raw query plan + // Note: planning uses the router schema as it needs access to all fields (including inaccessible), validation/introspection uses client schema + preparedPlan := planner.Plan(&doc, p.executor.RouterSchema, name, &report, plannerOptions...) if report.HasErrors() { return nil, &reportError{report: &report} } + + // postprocess query plan to get its final state post := postprocess.NewProcessor(postprocess.CollectDataSourceInfo()) post.Process(preparedPlan) diff --git a/router/core/operation_processor.go b/router/core/operation_processor.go index a9c5a9a474..b97cb7be91 100644 --- a/router/core/operation_processor.go +++ b/router/core/operation_processor.go @@ -1496,6 +1496,7 @@ func createParseKit(i int, options *parseKitOptions) *parseKit { astnormalization.WithInlineFragmentSpreads(), astnormalization.WithRemoveFragmentDefinitions(), astnormalization.WithRemoveUnusedVariables(), + astnormalization.WithInlineDefer(), ), variablesNormalizer: astnormalization.NewVariablesNormalizer(), variablesRemapper: astnormalization.NewVariablesMapper(), diff --git a/router/core/plan_generator.go b/router/core/plan_generator.go index 79465bd12e..9a66d5fede 100644 --- a/router/core/plan_generator.go +++ b/router/core/plan_generator.go @@ -28,7 +28,6 @@ import ( "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/datasource/introspection_datasource" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/plan" "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/postprocess" - "github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve" "github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport" ) @@ -111,7 +110,7 @@ func (pl *Planner) PlanOperation(operationFilePath string, outputFormat PlanOutp case PlanOutputFormatText: return rawPlan.PrettyPrint(), opTimes, nil case PlanOutputFormatJSON: - marshal, err := json.Marshal(rawPlan) + marshal, err := rawPlan.Marshal() if err != nil { return "", opTimes, fmt.Errorf("failed to marshal raw plan: %w", err) } @@ -181,6 +180,7 @@ func (pl *Planner) normalizeOperation(operation *ast.Document, operationName []b astnormalization.WithInlineFragmentSpreads(), astnormalization.WithRemoveUnusedVariables(), astnormalization.WithIgnoreSkipInclude(), + astnormalization.WithInlineDefer(), ) normalizer.NormalizeNamedOperation(operation, pl.definition, operationName, &report) if report.HasErrors() { @@ -196,8 +196,40 @@ func (pl *Planner) normalizeOperation(operation *ast.Document, operationName []b return nil } +type PlanWrapper struct { + Plan plan.Plan +} + +func (p *PlanWrapper) PrettyPrint() string { + switch p := p.Plan.(type) { + case *plan.SynchronousResponsePlan: + + return p.Response.Fetches.QueryPlan().PrettyPrint() + case *plan.SubscriptionResponsePlan: + return p.Response.Response.Fetches.QueryPlan().PrettyPrint() + case *plan.DeferResponsePlan: + return p.Response.QueryPlanString() + } + + return "" +} + +func (p *PlanWrapper) Marshal() ([]byte, error) { + switch p := p.Plan.(type) { + case *plan.SynchronousResponsePlan: + + return json.Marshal(p.Response.Fetches.QueryPlan()) + case *plan.SubscriptionResponsePlan: + return json.Marshal(p.Response.Response.Fetches.QueryPlan()) + case *plan.DeferResponsePlan: + return nil, errors.New("defer marshal unsupported yet") + } + + return nil, nil +} + // PlanPreparedOperation creates a query plan from a normalized and validated operation -func (pl *Planner) PlanPreparedOperation(operation *ast.Document) (planNode *resolve.FetchTreeQueryPlanNode, opTimes OperationTimes, err error) { +func (pl *Planner) PlanPreparedOperation(operation *ast.Document) (planNode *PlanWrapper, opTimes OperationTimes, err error) { defer func() { if r := recover(); r != nil { err = fmt.Errorf("panic during plan generation: %v", r) @@ -225,14 +257,7 @@ func (pl *Planner) PlanPreparedOperation(operation *ast.Document) (planNode *res // measure postprocessing time as part of planning time opTimes.PlanTime = time.Since(start) - switch p := preparedPlan.(type) { - case *plan.SynchronousResponsePlan: - return p.Response.Fetches.QueryPlan(), opTimes, nil - case *plan.SubscriptionResponsePlan: - return p.Response.Response.Fetches.QueryPlan(), opTimes, nil - } - - return &resolve.FetchTreeQueryPlanNode{}, opTimes, nil + return &PlanWrapper{preparedPlan}, opTimes, nil } func (pl *Planner) validateOperation(operation *ast.Document) (err error) { diff --git a/router/core/flushwriter.go b/router/core/subscription_response_writer.go similarity index 100% rename from router/core/flushwriter.go rename to router/core/subscription_response_writer.go diff --git a/router/core/flushwriter_test.go b/router/core/subscription_response_writer_test.go similarity index 100% rename from router/core/flushwriter_test.go rename to router/core/subscription_response_writer_test.go diff --git a/router/go.mod b/router/go.mod index a2b565e403..9d28417163 100644 --- a/router/go.mod +++ b/router/go.mod @@ -31,7 +31,7 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 github.com/twmb/franz-go v1.16.1 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 go.opentelemetry.io/contrib/propagators/b3 v1.23.0 diff --git a/router/go.sum b/router/go.sum index 3af92643bc..f0915fda8a 100644 --- a/router/go.sum +++ b/router/go.sum @@ -329,8 +329,8 @@ github.com/wundergraph/astjson v1.1.0 h1:xORDosrZ87zQFJwNGe/HIHXqzpdHOFmqWgykCLV github.com/wundergraph/astjson v1.1.0/go.mod h1:h12D/dxxnedtLzsKyBLK7/Oe4TAoGpRVC9nDpDrZSWw= github.com/wundergraph/go-arena v1.1.0 h1:9+wSRkJAkA2vbYHp6s8tEGhPViRGQNGXqPHT0QzhdIc= github.com/wundergraph/go-arena v1.1.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267 h1:qMkYR0oq0Cw61aDZs9VsCCVwNVSxRxT13ytz6WqCwJg= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b h1:8qC1P3uSAyxD3qU0ne88xNjA08KAIyeCRuxKQQn7wa4= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.267.0.20260409183305-e7151238827b/go.mod h1:HjTAO/cuICpu31IfHY9qmSPygx6Gza7Wt9hTSReTI+A= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= diff --git a/router/pkg/graphqlschemausage/schemausage.go b/router/pkg/graphqlschemausage/schemausage.go index f52bc7e6ec..69cc4ff50e 100644 --- a/router/pkg/graphqlschemausage/schemausage.go +++ b/router/pkg/graphqlschemausage/schemausage.go @@ -495,6 +495,8 @@ func buildFieldSubgraphIDMap(operationPlan plan.Plan) map[string][]string { switch p := operationPlan.(type) { case *plan.SynchronousResponsePlan: collector.collectFromNode(p.Response.Data) + case *plan.DeferResponsePlan: + // TODO: handle case *plan.SubscriptionResponsePlan: collector.collectFromNode(p.Response.Response.Data) }