diff --git a/router-tests/go.mod b/router-tests/go.mod index a8b9386517..b2d4753154 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -31,7 +31,7 @@ require ( github.com/wundergraph/cosmo/router v0.0.0-20260710155145-803a4bc06d92 github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e github.com/wundergraph/cosmo/speedtrap v0.0.0-00010101000000-000000000000 - github.com/wundergraph/graphql-go-tools/v2 v2.14.1 + github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190 go.opentelemetry.io/otel v1.44.0 go.opentelemetry.io/otel/sdk v1.44.0 go.opentelemetry.io/otel/sdk/metric v1.44.0 diff --git a/router-tests/go.sum b/router-tests/go.sum index 8f0aea41cd..231d379930 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -386,8 +386,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.3.0 h1:n0ng5a1vbd8YGq1u3rMr0vPU5f6AZ1BXIiUhL1UIok8= github.com/wundergraph/go-arena v1.3.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.14.1 h1:TecnvTyhskoeiqo6W+1xh7HqAPL/RG5vfbFhezu7RLs= -github.com/wundergraph/graphql-go-tools/v2 v2.14.1/go.mod h1:zREIKLmpjfNcGSubndaW/913r0Y8XbbYOXQeZFkwHdo= +github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190 h1:V0d3bNpOZiA8Ft58zCA5Uobqa3lgx6927z8BKGUDD5E= +github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190/go.mod h1:zREIKLmpjfNcGSubndaW/913r0Y8XbbYOXQeZFkwHdo= 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/modules/query_stats_test.go b/router-tests/modules/query_stats_test.go index c6cafc9e77..3fe778fd96 100644 --- a/router-tests/modules/query_stats_test.go +++ b/router-tests/modules/query_stats_test.go @@ -168,7 +168,9 @@ func TestCustomModuleQueryStats(t *testing.T) { assert.Equal(t, expectedSubgraphFetches, qps.SubgraphFetches) - assert.Equal(t, []core.SubgraphRootField{ + // The list is deduplicated in fetch-tree traversal order, which is + // an implementation detail of the schedule tree shape: assert as a set. + assert.ElementsMatch(t, []core.SubgraphRootField{ { SubgraphName: "employees", TypeName: "Query", diff --git a/router-tests/operations/testdata/fixtures/query_plans/only_query_plan.json b/router-tests/operations/testdata/fixtures/query_plans/only_query_plan.json index 7adfa96583..f6066c5c28 100644 --- a/router-tests/operations/testdata/fixtures/query_plans/only_query_plan.json +++ b/router-tests/operations/testdata/fixtures/query_plans/only_query_plan.json @@ -19,251 +19,256 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "availability", - "subgraphId": "5", - "fetchId": 1, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isUserRequested": false, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "availability", + "subgraphId": "5", + "fetchId": 1, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Employee", - "fieldName": "id" - }, - "isKey": true, - "isRequires": false + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" } - ] - } - ] - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "mood", - "subgraphId": "6", - "fetchId": 2, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isUserRequested": false, - "dependsOn": [ + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", + "dependencies": [ { - "fetchId": 0, - "subgraph": "employees", "coordinate": { "typeName": "Employee", - "fieldName": "id" + "fieldName": "isAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 3, - "dependsOnFetchIds": [ - 0, - 2 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Employee", - "fieldName": "derivedMood", - "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" - }, - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "derivedMood" - }, - "isUserRequested": true, - "dependsOn": [ + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 4, + "dependsOnFetchIds": [ + 0, + 1 + ], + "representations": [ { - "fetchId": 2, - "subgraph": "mood", - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Consultancy", + "fieldName": "isLeadAvailable", + "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" }, { - "fetchId": 0, - "subgraph": "employees", + "kind": "@key", + "typeName": "Consultancy", + "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", + "dependencies": [ + { "coordinate": { - "typeName": "Employee", - "fieldName": "id" + "typeName": "Consultancy", + "fieldName": "isLeadAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 3, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Employee", + "fieldName": "isAvailable" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "upc" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 4, - "dependsOnFetchIds": [ - 0, - 1 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Consultancy", - "fieldName": "isLeadAvailable", - "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" - }, - { - "kind": "@key", - "typeName": "Consultancy", - "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Consultancy", - "fieldName": "isLeadAvailable" - }, - "isUserRequested": true, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "mood", + "subgraphId": "6", + "fetchId": 2, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 3, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 2, - "subgraph": "mood", "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" + "typeName": "Employee", + "fieldName": "currentMood" }, - "isKey": false, - "isRequires": true - }, + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] + } + ] + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 3, + "dependsOnFetchIds": [ + 0, + 2 + ], + "representations": [ { - "fetchId": 1, - "subgraph": "availability", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Employee", + "fieldName": "derivedMood", + "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" }, { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 1, - "subgraph": "availability", "coordinate": { "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isKey": false, - "isRequires": true - }, - { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "upc" + "fieldName": "derivedMood" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Employee", + "fieldName": "currentMood" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] } ] } diff --git a/router-tests/operations/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json b/router-tests/operations/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json index b438fd183d..02d12f1c62 100644 --- a/router-tests/operations/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json +++ b/router-tests/operations/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json @@ -19,251 +19,256 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "availability", - "subgraphId": "5", - "fetchId": 1, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isUserRequested": false, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "availability", + "subgraphId": "5", + "fetchId": 1, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Employee", - "fieldName": "id" - }, - "isKey": true, - "isRequires": false + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" } - ] - } - ] - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "mood", - "subgraphId": "6", - "fetchId": 2, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isUserRequested": false, - "dependsOn": [ + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", + "dependencies": [ { - "fetchId": 0, - "subgraph": "employees", "coordinate": { "typeName": "Employee", - "fieldName": "id" + "fieldName": "isAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 3, - "dependsOnFetchIds": [ - 0, - 2 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Employee", - "fieldName": "derivedMood", - "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" - }, - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "derivedMood" - }, - "isUserRequested": true, - "dependsOn": [ + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 4, + "dependsOnFetchIds": [ + 0, + 1 + ], + "representations": [ { - "fetchId": 2, - "subgraph": "mood", - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Consultancy", + "fieldName": "isLeadAvailable", + "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" }, { - "fetchId": 0, - "subgraph": "employees", + "kind": "@key", + "typeName": "Consultancy", + "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", + "dependencies": [ + { "coordinate": { - "typeName": "Employee", - "fieldName": "id" + "typeName": "Consultancy", + "fieldName": "isLeadAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 3, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Employee", + "fieldName": "isAvailable" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "upc" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 4, - "dependsOnFetchIds": [ - 0, - 1 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Consultancy", - "fieldName": "isLeadAvailable", - "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" - }, - { - "kind": "@key", - "typeName": "Consultancy", - "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Consultancy", - "fieldName": "isLeadAvailable" - }, - "isUserRequested": true, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "mood", + "subgraphId": "6", + "fetchId": 2, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 3, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 2, - "subgraph": "mood", "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" + "typeName": "Employee", + "fieldName": "currentMood" }, - "isKey": false, - "isRequires": true - }, + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] + } + ] + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 3, + "dependsOnFetchIds": [ + 0, + 2 + ], + "representations": [ { - "fetchId": 1, - "subgraph": "availability", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Employee", + "fieldName": "derivedMood", + "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" }, { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 1, - "subgraph": "availability", "coordinate": { "typeName": "Employee", - "fieldName": "isAvailable" + "fieldName": "derivedMood" }, - "isKey": false, - "isRequires": true - }, - { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "upc" - }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Employee", + "fieldName": "currentMood" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] } ] } @@ -316,45 +321,50 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "5", - "source_name": "availability" - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "6", - "source_name": "mood" - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "0", - "source_name": "employees" - } + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "5", + "source_name": "availability" + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "source_id": "0", + "source_name": "employees" + } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "source_id": "0", - "source_name": "employees" - } + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "6", + "source_name": "mood" + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "0", + "source_name": "employees" + } + } + ] } ] } diff --git a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan.json b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan.json index 65d638a291..ad9ceb981d 100644 --- a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan.json +++ b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan.json @@ -37,251 +37,256 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "availability", - "subgraphId": "5", - "fetchId": 1, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isUserRequested": false, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "availability", + "subgraphId": "5", + "fetchId": 1, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Employee", - "fieldName": "id" - }, - "isKey": true, - "isRequires": false + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" } - ] - } - ] - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "mood", - "subgraphId": "6", - "fetchId": 2, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isUserRequested": false, - "dependsOn": [ + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", + "dependencies": [ { - "fetchId": 0, - "subgraph": "employees", "coordinate": { "typeName": "Employee", - "fieldName": "id" + "fieldName": "isAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 3, - "dependsOnFetchIds": [ - 0, - 2 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Employee", - "fieldName": "derivedMood", - "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" - }, - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "derivedMood" - }, - "isUserRequested": true, - "dependsOn": [ + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 4, + "dependsOnFetchIds": [ + 0, + 1 + ], + "representations": [ { - "fetchId": 2, - "subgraph": "mood", - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Consultancy", + "fieldName": "isLeadAvailable", + "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" }, { - "fetchId": 0, - "subgraph": "employees", + "kind": "@key", + "typeName": "Consultancy", + "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", + "dependencies": [ + { "coordinate": { - "typeName": "Employee", - "fieldName": "id" + "typeName": "Consultancy", + "fieldName": "isLeadAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 3, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Employee", + "fieldName": "isAvailable" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "upc" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 4, - "dependsOnFetchIds": [ - 0, - 1 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Consultancy", - "fieldName": "isLeadAvailable", - "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" - }, - { - "kind": "@key", - "typeName": "Consultancy", - "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" - } - ], - "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Consultancy", - "fieldName": "isLeadAvailable" - }, - "isUserRequested": true, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "mood", + "subgraphId": "6", + "fetchId": 2, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 3, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 2, - "subgraph": "mood", "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" + "typeName": "Employee", + "fieldName": "currentMood" }, - "isKey": false, - "isRequires": true - }, + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] + } + ] + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 3, + "dependsOnFetchIds": [ + 0, + 2 + ], + "representations": [ { - "fetchId": 1, - "subgraph": "availability", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Employee", + "fieldName": "derivedMood", + "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" }, { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 1, - "subgraph": "availability", "coordinate": { "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isKey": false, - "isRequires": true - }, - { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "upc" + "fieldName": "derivedMood" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Employee", + "fieldName": "currentMood" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] } ] } diff --git a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json index 87f03620b5..8303c0d3c4 100644 --- a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json +++ b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json @@ -37,251 +37,256 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "availability", - "subgraphId": "5", - "fetchId": 1, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__availability__1($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isUserRequested": false, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "availability", + "subgraphId": "5", + "fetchId": 1, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Employee", - "fieldName": "id" - }, - "isKey": true, - "isRequires": false + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" } - ] - } - ] - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "mood", - "subgraphId": "6", - "fetchId": 2, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__mood__2($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isUserRequested": false, - "dependsOn": [ + ], + "query": "query Requires__availability__1($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", + "dependencies": [ { - "fetchId": 0, - "subgraph": "employees", "coordinate": { "typeName": "Employee", - "fieldName": "id" + "fieldName": "isAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 3, - "dependsOnFetchIds": [ - 0, - 2 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Employee", - "fieldName": "derivedMood", - "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" - }, - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__employees__3($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "derivedMood" - }, - "isUserRequested": true, - "dependsOn": [ + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 4, + "dependsOnFetchIds": [ + 0, + 1 + ], + "representations": [ { - "fetchId": 2, - "subgraph": "mood", - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Consultancy", + "fieldName": "isLeadAvailable", + "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" }, { - "fetchId": 0, - "subgraph": "employees", + "kind": "@key", + "typeName": "Consultancy", + "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" + } + ], + "query": "query Requires__employees__4($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", + "dependencies": [ + { "coordinate": { - "typeName": "Employee", - "fieldName": "id" + "typeName": "Consultancy", + "fieldName": "isLeadAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 3, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "availability", + "coordinate": { + "typeName": "Employee", + "fieldName": "isAvailable" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "upc" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 4, - "dependsOnFetchIds": [ - 0, - 1 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Consultancy", - "fieldName": "isLeadAvailable", - "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" - }, - { - "kind": "@key", - "typeName": "Consultancy", - "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" - } - ], - "query": "query Requires__employees__4($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Consultancy", - "fieldName": "isLeadAvailable" - }, - "isUserRequested": true, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "mood", + "subgraphId": "6", + "fetchId": 2, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 3, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query Requires__mood__2($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 2, - "subgraph": "mood", "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" + "typeName": "Employee", + "fieldName": "currentMood" }, - "isKey": false, - "isRequires": true - }, + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] + } + ] + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 3, + "dependsOnFetchIds": [ + 0, + 2 + ], + "representations": [ { - "fetchId": 1, - "subgraph": "availability", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Employee", + "fieldName": "derivedMood", + "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" }, { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query Requires__employees__3($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 1, - "subgraph": "availability", "coordinate": { "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isKey": false, - "isRequires": true - }, - { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "upc" + "fieldName": "derivedMood" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 2, + "subgraph": "mood", + "coordinate": { + "typeName": "Employee", + "fieldName": "currentMood" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] } ] } diff --git a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json index fd84f0fc15..499082d139 100644 --- a/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json +++ b/router-tests/operations/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json @@ -19,251 +19,256 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "--_$av_ai-la%bi$lit-y_-$-_-", - "subgraphId": "5", - "fetchId": 1, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__av_ai_la_bi_lit_y__1($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "isAvailable" - }, - "isUserRequested": false, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "--_$av_ai-la%bi$lit-y_-$-_-", + "subgraphId": "5", + "fetchId": 1, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Employee", - "fieldName": "id" - }, - "isKey": true, - "isRequires": false + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" } - ] - } - ] - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "--_$mo\u0026o-d_-$-_-", - "subgraphId": "6", - "fetchId": 2, - "dependsOnFetchIds": [ - 0 - ], - "representations": [ - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__mo_o_d__2($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isUserRequested": false, - "dependsOn": [ + ], + "query": "query Requires__av_ai_la_bi_lit_y__1($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}", + "dependencies": [ { - "fetchId": 0, - "subgraph": "employees", "coordinate": { "typeName": "Employee", - "fieldName": "id" + "fieldName": "isAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 3, - "dependsOnFetchIds": [ - 0, - 2 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Employee", - "fieldName": "derivedMood", - "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" - }, - { - "kind": "@key", - "typeName": "Employee", - "fragment": "fragment Key on Employee {\n __typename\n id\n}" - } - ], - "query": "query Requires__employees__3($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Employee", - "fieldName": "derivedMood" - }, - "isUserRequested": true, - "dependsOn": [ + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 4, + "dependsOnFetchIds": [ + 0, + 1 + ], + "representations": [ { - "fetchId": 2, - "subgraph": "--_$mo\u0026o-d_-$-_-", - "coordinate": { - "typeName": "Employee", - "fieldName": "currentMood" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Consultancy", + "fieldName": "isLeadAvailable", + "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" }, { - "fetchId": 0, - "subgraph": "employees", + "kind": "@key", + "typeName": "Consultancy", + "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" + } + ], + "query": "query Requires__employees__4($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", + "dependencies": [ + { "coordinate": { - "typeName": "Employee", - "fieldName": "id" + "typeName": "Consultancy", + "fieldName": "isLeadAvailable" }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 3, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 2, + "subgraph": "--_$mo\u0026o-d_-$-_-", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "--_$av_ai-la%bi$lit-y_-$-_-", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "lead" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 1, + "subgraph": "--_$av_ai-la%bi$lit-y_-$-_-", + "coordinate": { + "typeName": "Employee", + "fieldName": "isAvailable" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Consultancy", + "fieldName": "upc" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "subgraphName": "employees", - "subgraphId": "0", - "fetchId": 4, - "dependsOnFetchIds": [ - 0, - 1 - ], - "representations": [ - { - "kind": "@requires", - "typeName": "Consultancy", - "fieldName": "isLeadAvailable", - "fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" - }, - { - "kind": "@key", - "typeName": "Consultancy", - "fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" - } - ], - "query": "query Requires__employees__4($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}", - "dependencies": [ - { - "coordinate": { - "typeName": "Consultancy", - "fieldName": "isLeadAvailable" - }, - "isUserRequested": true, - "dependsOn": [ + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "--_$mo\u0026o-d_-$-_-", + "subgraphId": "6", + "fetchId": 2, + "dependsOnFetchIds": [ + 0 + ], + "representations": [ { - "fetchId": 3, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query Requires__mo_o_d__2($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 2, - "subgraph": "--_$mo\u0026o-d_-$-_-", "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" + "typeName": "Employee", + "fieldName": "currentMood" }, - "isKey": false, - "isRequires": true - }, + "isUserRequested": false, + "dependsOn": [ + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] + } + ] + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "subgraphName": "employees", + "subgraphId": "0", + "fetchId": 3, + "dependsOnFetchIds": [ + 0, + 2 + ], + "representations": [ { - "fetchId": 1, - "subgraph": "--_$av_ai-la%bi$lit-y_-$-_-", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true + "kind": "@requires", + "typeName": "Employee", + "fieldName": "derivedMood", + "fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" }, { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "lead" - }, - "isKey": false, - "isRequires": true - }, + "kind": "@key", + "typeName": "Employee", + "fragment": "fragment Key on Employee {\n __typename\n id\n}" + } + ], + "query": "query Requires__employees__3($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}", + "dependencies": [ { - "fetchId": 1, - "subgraph": "--_$av_ai-la%bi$lit-y_-$-_-", "coordinate": { "typeName": "Employee", - "fieldName": "isAvailable" + "fieldName": "derivedMood" }, - "isKey": false, - "isRequires": true - }, - { - "fetchId": 0, - "subgraph": "employees", - "coordinate": { - "typeName": "Consultancy", - "fieldName": "upc" - }, - "isKey": true, - "isRequires": false + "isUserRequested": true, + "dependsOn": [ + { + "fetchId": 2, + "subgraph": "--_$mo\u0026o-d_-$-_-", + "coordinate": { + "typeName": "Employee", + "fieldName": "currentMood" + }, + "isKey": false, + "isRequires": true + }, + { + "fetchId": 0, + "subgraph": "employees", + "coordinate": { + "typeName": "Employee", + "fieldName": "id" + }, + "isKey": true, + "isRequires": false + } + ] } ] } - ] - } + } + ] } ] } @@ -316,45 +321,50 @@ "kind": "Parallel", "children": [ { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "5", - "source_name": "--_$av_ai-la%bi$lit-y_-$-_-" - } - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "6", - "source_name": "--_$mo\u0026o-d_-$-_-" - } - } - ] - }, - { - "kind": "Parallel", - "children": [ - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products.@.lead", - "source_id": "0", - "source_name": "employees" - } + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "5", + "source_name": "--_$av_ai-la%bi$lit-y_-$-_-" + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products", + "source_id": "0", + "source_name": "employees" + } + } + ] }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "products", - "source_id": "0", - "source_name": "employees" - } + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "6", + "source_name": "--_$mo\u0026o-d_-$-_-" + } + }, + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "products.@.lead", + "source_id": "0", + "source_name": "employees" + } + } + ] } ] } diff --git a/router-tests/protocol/testdata/tracing.json b/router-tests/protocol/testdata/tracing.json index 9ed50a6587..a7af41a876 100644 --- a/router-tests/protocol/testdata/tracing.json +++ b/router-tests/protocol/testdata/tracing.json @@ -1075,969 +1075,974 @@ } }, { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "employees", - "source_id": "2", - "source_name": "hobbies", - "trace": { - "raw_input_data": [ - { - "id": 1, - "role": { - "__typename": "Engineer", - "title": [ - "Founder", - "CEO" - ], - "departments": [ - "ENGINEERING", - "MARKETING" - ] - }, - "__typename": "Employee" - }, - { - "id": 2, - "role": { - "__typename": "Engineer", - "title": [ - "Co-founder", - "Tech Lead" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - }, - { - "id": 3, - "role": { - "__typename": "Marketer", - "title": [ - "Co-founder", - "Head of Growth" - ], - "departments": [ - "MARKETING" - ] - }, - "__typename": "Employee" - }, - { - "id": 4, - "role": { - "__typename": "Operator", - "title": [ - "Co-founder", - "COO" - ], - "departments": [ - "OPERATIONS", - "MARKETING" - ] - }, - "__typename": "Employee" - }, - { - "id": 5, - "role": { - "__typename": "Engineer", - "title": [ - "Senior GO Engineer" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - }, - { - "id": 7, - "role": { - "__typename": "Engineer", - "title": [ - "Software Engineer" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - }, - { - "id": 8, - "role": { - "__typename": "Engineer", - "title": [ - "Software Engineer" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - }, - { - "id": 10, - "role": { - "__typename": "Engineer", - "title": [ - "Senior Frontend Engineer" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - }, - { - "id": 11, - "role": { - "__typename": "Operator", - "title": [ - "Accounting \u0026 Finance" - ], - "departments": [ - "OPERATIONS" - ] - }, - "__typename": "Employee" - }, - { - "id": 12, - "role": { - "__typename": "Engineer", - "title": [ - "Software Engineer" - ], - "departments": [ - "ENGINEERING" - ] - }, - "__typename": "Employee" - } - ], - "input": { - "body": { - "query": "query($representations: [_Any!]!){_entities(representations: $representations){... on Employee {__typename hobbies {__typename ... on Exercise {category} ... on Flying {planeModels yearsOfExperience} ... on Gaming {name genres yearsOfExperience} ... on Programming {languages} ... on Travelling {countriesLived {__typename key {name}}} ... on Other {name}}}}}", - "variables": { - "representations": [ - { - "__typename": "Employee", - "id": 1 + "kind": "Sequence", + "children": [ + { + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "employees", + "source_id": "2", + "source_name": "hobbies", + "trace": { + "raw_input_data": [ + { + "id": 1, + "role": { + "__typename": "Engineer", + "title": [ + "Founder", + "CEO" + ], + "departments": [ + "ENGINEERING", + "MARKETING" + ] }, - { - "__typename": "Employee", - "id": 2 + "__typename": "Employee" + }, + { + "id": 2, + "role": { + "__typename": "Engineer", + "title": [ + "Co-founder", + "Tech Lead" + ], + "departments": [ + "ENGINEERING" + ] }, - { - "__typename": "Employee", - "id": 3 + "__typename": "Employee" + }, + { + "id": 3, + "role": { + "__typename": "Marketer", + "title": [ + "Co-founder", + "Head of Growth" + ], + "departments": [ + "MARKETING" + ] }, - { - "__typename": "Employee", - "id": 4 + "__typename": "Employee" + }, + { + "id": 4, + "role": { + "__typename": "Operator", + "title": [ + "Co-founder", + "COO" + ], + "departments": [ + "OPERATIONS", + "MARKETING" + ] }, - { - "__typename": "Employee", - "id": 5 + "__typename": "Employee" + }, + { + "id": 5, + "role": { + "__typename": "Engineer", + "title": [ + "Senior GO Engineer" + ], + "departments": [ + "ENGINEERING" + ] }, - { - "__typename": "Employee", - "id": 7 + "__typename": "Employee" + }, + { + "id": 7, + "role": { + "__typename": "Engineer", + "title": [ + "Software Engineer" + ], + "departments": [ + "ENGINEERING" + ] }, - { - "__typename": "Employee", - "id": 8 + "__typename": "Employee" + }, + { + "id": 8, + "role": { + "__typename": "Engineer", + "title": [ + "Software Engineer" + ], + "departments": [ + "ENGINEERING" + ] }, - { - "__typename": "Employee", - "id": 10 + "__typename": "Employee" + }, + { + "id": 10, + "role": { + "__typename": "Engineer", + "title": [ + "Senior Frontend Engineer" + ], + "departments": [ + "ENGINEERING" + ] }, - { - "__typename": "Employee", - "id": 11 + "__typename": "Employee" + }, + { + "id": 11, + "role": { + "__typename": "Operator", + "title": [ + "Accounting \u0026 Finance" + ], + "departments": [ + "OPERATIONS" + ] }, - { - "__typename": "Employee", - "id": 12 - } - ] - } - }, - "header": {}, - "method": "POST", - "url": "http://localhost/graphql" - }, - "output": { - "data": { - "_entities": [ + "__typename": "Employee" + }, { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Exercise", - "category": "SPORT" - }, - { - "__typename": "Gaming", - "name": "Counter Strike", - "genres": [ - "FPS" - ], - "yearsOfExperience": 20 - }, - { - "__typename": "Other", - "name": "WunderGraph" - }, + "id": 12, + "role": { + "__typename": "Engineer", + "title": [ + "Software Engineer" + ], + "departments": [ + "ENGINEERING" + ] + }, + "__typename": "Employee" + } + ], + "input": { + "body": { + "query": "query($representations: [_Any!]!){_entities(representations: $representations){... on Employee {__typename hobbies {__typename ... on Exercise {category} ... on Flying {planeModels yearsOfExperience} ... on Gaming {name genres yearsOfExperience} ... on Programming {languages} ... on Travelling {countriesLived {__typename key {name}}} ... on Other {name}}}}}", + "variables": { + "representations": [ + { + "__typename": "Employee", + "id": 1 + }, + { + "__typename": "Employee", + "id": 2 + }, + { + "__typename": "Employee", + "id": 3 + }, + { + "__typename": "Employee", + "id": 4 + }, + { + "__typename": "Employee", + "id": 5 + }, + { + "__typename": "Employee", + "id": 7 + }, + { + "__typename": "Employee", + "id": 8 + }, + { + "__typename": "Employee", + "id": 10 + }, + { + "__typename": "Employee", + "id": 11 + }, + { + "__typename": "Employee", + "id": 12 + } + ] + } + }, + "header": {}, + "method": "POST", + "url": "http://localhost/graphql" + }, + "output": { + "data": { + "_entities": [ { - "__typename": "Programming", - "languages": [ - "GO", - "TYPESCRIPT" + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Exercise", + "category": "SPORT" + }, + { + "__typename": "Gaming", + "name": "Counter Strike", + "genres": [ + "FPS" + ], + "yearsOfExperience": 20 + }, + { + "__typename": "Other", + "name": "WunderGraph" + }, + { + "__typename": "Programming", + "languages": [ + "GO", + "TYPESCRIPT" + ] + }, + { + "__typename": "Travelling", + "countriesLived": [ + { + "__typename": "Country", + "key": { + "name": "England" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + } + ] + } ] }, { - "__typename": "Travelling", - "countriesLived": [ + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Exercise", + "category": "STRENGTH_TRAINING" + }, { - "__typename": "Country", - "key": { - "name": "England" - } + "__typename": "Gaming", + "name": "Counter Strike", + "genres": [ + "FPS" + ], + "yearsOfExperience": 0.5 }, { - "__typename": "Country", - "key": { - "name": "Germany" - } + "__typename": "Programming", + "languages": [ + "GO", + "RUST" + ] } ] - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Exercise", - "category": "STRENGTH_TRAINING" - }, - { - "__typename": "Gaming", - "name": "Counter Strike", - "genres": [ - "FPS" - ], - "yearsOfExperience": 0.5 }, { - "__typename": "Programming", - "languages": [ - "GO", - "RUST" + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Exercise", + "category": "HIKING" + }, + { + "__typename": "Exercise", + "category": "SPORT" + }, + { + "__typename": "Other", + "name": "Reading" + }, + { + "__typename": "Travelling", + "countriesLived": [ + { + "__typename": "Country", + "key": { + "name": "America" + } + }, + { + "__typename": "Country", + "key": { + "name": "Serbia" + } + } + ] + } ] - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Exercise", - "category": "HIKING" - }, - { - "__typename": "Exercise", - "category": "SPORT" }, { - "__typename": "Other", - "name": "Reading" - }, - { - "__typename": "Travelling", - "countriesLived": [ + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Exercise", + "category": "HIKING" + }, { - "__typename": "Country", - "key": { - "name": "America" - } + "__typename": "Flying", + "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 }, { - "__typename": "Country", - "key": { - "name": "Serbia" - } + "__typename": "Travelling", + "countriesLived": [ + { + "__typename": "Country", + "key": { + "name": "America" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + } + ] } ] - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Exercise", - "category": "HIKING" - }, - { - "__typename": "Flying", - "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 }, { - "__typename": "Travelling", - "countriesLived": [ + "__typename": "Employee", + "hobbies": [ { - "__typename": "Country", - "key": { - "name": "America" - } + "__typename": "Other", + "name": "Building a house" }, { - "__typename": "Country", - "key": { - "name": "Germany" - } + "__typename": "Other", + "name": "Forumla 1" + }, + { + "__typename": "Other", + "name": "Raising cats" } ] - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Other", - "name": "Building a house" }, { - "__typename": "Other", - "name": "Forumla 1" - }, - { - "__typename": "Other", - "name": "Raising cats" - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Gaming", - "name": "Chess", - "genres": [ - "BOARD" - ], - "yearsOfExperience": 9.5 - }, - { - "__typename": "Other", - "name": "Watching anime" - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Exercise", - "category": "STRENGTH_TRAINING" - }, - { - "__typename": "Gaming", - "name": "Miscellaneous", - "genres": [ - "ADVENTURE", - "RPG", - "SIMULATION", - "STRATEGY" - ], - "yearsOfExperience": 17 - }, - { - "__typename": "Other", - "name": "Watching anime" - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Programming", - "languages": [ - "TYPESCRIPT" + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Gaming", + "name": "Chess", + "genres": [ + "BOARD" + ], + "yearsOfExperience": 9.5 + }, + { + "__typename": "Other", + "name": "Watching anime" + } ] }, { - "__typename": "Exercise", - "category": "CALISTHENICS" - }, - { - "__typename": "Exercise", - "category": "HIKING" - }, - { - "__typename": "Exercise", - "category": "STRENGTH_TRAINING" - }, - { - "__typename": "Other", - "name": "saas-ui" + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Exercise", + "category": "STRENGTH_TRAINING" + }, + { + "__typename": "Gaming", + "name": "Miscellaneous", + "genres": [ + "ADVENTURE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "yearsOfExperience": 17 + }, + { + "__typename": "Other", + "name": "Watching anime" + } + ] }, { - "__typename": "Travelling", - "countriesLived": [ + "__typename": "Employee", + "hobbies": [ { - "__typename": "Country", - "key": { - "name": "Germany" - } + "__typename": "Programming", + "languages": [ + "TYPESCRIPT" + ] }, { - "__typename": "Country", - "key": { - "name": "Indonesia" - } + "__typename": "Exercise", + "category": "CALISTHENICS" }, { - "__typename": "Country", - "key": { - "name": "Netherlands" - } + "__typename": "Exercise", + "category": "HIKING" }, { - "__typename": "Country", - "key": { - "name": "Portugal" - } + "__typename": "Exercise", + "category": "STRENGTH_TRAINING" }, { - "__typename": "Country", - "key": { - "name": "Spain" - } + "__typename": "Other", + "name": "saas-ui" }, { - "__typename": "Country", - "key": { - "name": "Thailand" - } + "__typename": "Travelling", + "countriesLived": [ + { + "__typename": "Country", + "key": { + "name": "Germany" + } + }, + { + "__typename": "Country", + "key": { + "name": "Indonesia" + } + }, + { + "__typename": "Country", + "key": { + "name": "Netherlands" + } + }, + { + "__typename": "Country", + "key": { + "name": "Portugal" + } + }, + { + "__typename": "Country", + "key": { + "name": "Spain" + } + }, + { + "__typename": "Country", + "key": { + "name": "Thailand" + } + } + ] } ] - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Other", - "name": "Spending time with the family" - } - ] - }, - { - "__typename": "Employee", - "hobbies": [ - { - "__typename": "Programming", - "languages": [ - "CSHARP", - "GO", - "RUST", - "TYPESCRIPT" - ] - }, - { - "__typename": "Exercise", - "category": "STRENGTH_TRAINING" }, { - "__typename": "Gaming", - "name": "Miscellaneous", - "genres": [ - "ADVENTURE", - "BOARD", - "CARD", - "ROGUELITE", - "RPG", - "SIMULATION", - "STRATEGY" - ], - "yearsOfExperience": 25.5 + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Other", + "name": "Spending time with the family" + } + ] }, { - "__typename": "Travelling", - "countriesLived": [ + "__typename": "Employee", + "hobbies": [ + { + "__typename": "Programming", + "languages": [ + "CSHARP", + "GO", + "RUST", + "TYPESCRIPT" + ] + }, { - "__typename": "Country", - "key": { - "name": "England" - } + "__typename": "Exercise", + "category": "STRENGTH_TRAINING" }, { - "__typename": "Country", - "key": { - "name": "Korea" - } + "__typename": "Gaming", + "name": "Miscellaneous", + "genres": [ + "ADVENTURE", + "BOARD", + "CARD", + "ROGUELITE", + "RPG", + "SIMULATION", + "STRATEGY" + ], + "yearsOfExperience": 25.5 }, { - "__typename": "Country", - "key": { - "name": "Taiwan" - } + "__typename": "Travelling", + "countriesLived": [ + { + "__typename": "Country", + "key": { + "name": "England" + } + }, + { + "__typename": "Country", + "key": { + "name": "Korea" + } + }, + { + "__typename": "Country", + "key": { + "name": "Taiwan" + } + } + ] } ] } ] - } - ] - }, - "extensions": { - "trace": { - "request": { - "method": "POST", - "url": "http://localhost/graphql", - "headers": { - "Accept": [ - "application/json" - ], - "Accept-Encoding": [ - "gzip", - "deflate" - ], - "Content-Type": [ - "application/json" - ] - } }, - "response": { - "status_code": 200, - "status": "200 OK", - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "body_size": 3318 + "extensions": { + "trace": { + "request": { + "method": "POST", + "url": "http://localhost/graphql", + "headers": { + "Accept": [ + "application/json" + ], + "Accept-Encoding": [ + "gzip", + "deflate" + ], + "Content-Type": [ + "application/json" + ] + } + }, + "response": { + "status_code": 200, + "status": "200 OK", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "body_size": 3318 + } + } } - } - } - }, - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "duration_load_nanoseconds": 1, - "duration_load_pretty": "1ns", - "single_flight_used": true, - "single_flight_shared_response": false, - "load_skipped": false, - "load_stats": { - "get_conn": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "host_port": "" - }, - "got_conn": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "reused": false, - "was_idle": false, - "idle_time_nanoseconds": 0, - "idle_time_pretty": "" - }, - "got_first_response_byte": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" - }, - "dns_start": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "", - "host": "" - }, - "dns_done": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "connect_start": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "network": "", - "addr": "" - }, - "connect_done": { + }, "duration_since_start_nanoseconds": 1, "duration_since_start_pretty": "1ns", - "network": "", - "addr": "" - }, - "tls_handshake_start": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "tls_handshake_done": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "wrote_headers": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" - }, - "wrote_request": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" + "duration_load_nanoseconds": 1, + "duration_load_pretty": "1ns", + "single_flight_used": true, + "single_flight_shared_response": false, + "load_skipped": false, + "load_stats": { + "get_conn": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "host_port": "" + }, + "got_conn": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "reused": false, + "was_idle": false, + "idle_time_nanoseconds": 0, + "idle_time_pretty": "" + }, + "got_first_response_byte": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" + }, + "dns_start": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "", + "host": "" + }, + "dns_done": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "connect_start": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "network": "", + "addr": "" + }, + "connect_done": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "network": "", + "addr": "" + }, + "tls_handshake_start": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "tls_handshake_done": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "wrote_headers": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" + }, + "wrote_request": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" + } + } } } - } - } - } - ] - }, - { - "kind": "Single", - "fetch": { - "kind": "BatchEntity", - "path": "employees.@.hobbies.@.countriesLived", - "source_id": "7", - "source_name": "countries", - "trace": { - "raw_input_data": [ - { - "__typename": "Country", - "key": { - "name": "England" - } - }, - { - "__typename": "Country", - "key": { - "name": "Germany" - } - }, - { - "__typename": "Country", - "key": { - "name": "America" - } - }, - { - "__typename": "Country", - "key": { - "name": "Serbia" - } - }, - { - "__typename": "Country", - "key": { - "name": "America" - } - }, - { - "__typename": "Country", - "key": { - "name": "Germany" - } - }, - { - "__typename": "Country", - "key": { - "name": "Germany" - } - }, - { - "__typename": "Country", - "key": { - "name": "Indonesia" - } - }, - { - "__typename": "Country", - "key": { - "name": "Netherlands" - } - }, - { - "__typename": "Country", - "key": { - "name": "Portugal" - } - }, - { - "__typename": "Country", - "key": { - "name": "Spain" - } - }, - { - "__typename": "Country", - "key": { - "name": "Thailand" - } - }, - { - "__typename": "Country", - "key": { - "name": "England" - } - }, - { - "__typename": "Country", - "key": { - "name": "Korea" - } }, { - "__typename": "Country", - "key": { - "name": "Taiwan" - } - } - ], - "input": { - "body": { - "query": "query($representations: [_Any!]!){_entities(representations: $representations){... on Country {__typename language}}}", - "variables": { - "representations": [ - { - "__typename": "Country", - "key": { - "name": "England" - } - }, - { - "__typename": "Country", - "key": { - "name": "Germany" - } - }, - { - "__typename": "Country", - "key": { - "name": "America" - } - }, - { - "__typename": "Country", - "key": { - "name": "Serbia" - } - }, - { - "__typename": "Country", - "key": { - "name": "Indonesia" - } - }, - { - "__typename": "Country", - "key": { - "name": "Netherlands" - } - }, - { - "__typename": "Country", - "key": { - "name": "Portugal" - } - }, - { - "__typename": "Country", - "key": { - "name": "Spain" - } - }, - { - "__typename": "Country", - "key": { - "name": "Thailand" + "kind": "Single", + "fetch": { + "kind": "BatchEntity", + "path": "employees.@.hobbies.@.countriesLived", + "source_id": "7", + "source_name": "countries", + "trace": { + "raw_input_data": [ + { + "__typename": "Country", + "key": { + "name": "England" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + }, + { + "__typename": "Country", + "key": { + "name": "America" + } + }, + { + "__typename": "Country", + "key": { + "name": "Serbia" + } + }, + { + "__typename": "Country", + "key": { + "name": "America" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + }, + { + "__typename": "Country", + "key": { + "name": "Indonesia" + } + }, + { + "__typename": "Country", + "key": { + "name": "Netherlands" + } + }, + { + "__typename": "Country", + "key": { + "name": "Portugal" + } + }, + { + "__typename": "Country", + "key": { + "name": "Spain" + } + }, + { + "__typename": "Country", + "key": { + "name": "Thailand" + } + }, + { + "__typename": "Country", + "key": { + "name": "England" + } + }, + { + "__typename": "Country", + "key": { + "name": "Korea" + } + }, + { + "__typename": "Country", + "key": { + "name": "Taiwan" + } } + ], + "input": { + "body": { + "query": "query($representations: [_Any!]!){_entities(representations: $representations){... on Country {__typename language}}}", + "variables": { + "representations": [ + { + "__typename": "Country", + "key": { + "name": "England" + } + }, + { + "__typename": "Country", + "key": { + "name": "Germany" + } + }, + { + "__typename": "Country", + "key": { + "name": "America" + } + }, + { + "__typename": "Country", + "key": { + "name": "Serbia" + } + }, + { + "__typename": "Country", + "key": { + "name": "Indonesia" + } + }, + { + "__typename": "Country", + "key": { + "name": "Netherlands" + } + }, + { + "__typename": "Country", + "key": { + "name": "Portugal" + } + }, + { + "__typename": "Country", + "key": { + "name": "Spain" + } + }, + { + "__typename": "Country", + "key": { + "name": "Thailand" + } + }, + { + "__typename": "Country", + "key": { + "name": "Korea" + } + }, + { + "__typename": "Country", + "key": { + "name": "Taiwan" + } + } + ] + } + }, + "header": {}, + "method": "POST", + "url": "http://localhost/graphql" }, - { - "__typename": "Country", - "key": { - "name": "Korea" + "output": { + "data": { + "_entities": [ + { + "__typename": "Country", + "language": "English" + }, + { + "__typename": "Country", + "language": "German" + }, + { + "__typename": "Country", + "language": "English" + }, + { + "__typename": "Country", + "language": "Serbian" + }, + { + "__typename": "Country", + "language": "Indonesian" + }, + { + "__typename": "Country", + "language": "Dutch" + }, + { + "__typename": "Country", + "language": "Portuguese" + }, + { + "__typename": "Country", + "language": "Spanish" + }, + { + "__typename": "Country", + "language": "Thai" + }, + { + "__typename": "Country", + "language": "Korean" + }, + { + "__typename": "Country", + "language": "Taiwanese" + } + ] + }, + "extensions": { + "trace": { + "request": { + "method": "POST", + "url": "http://localhost/graphql", + "headers": { + "Accept": [ + "application/json" + ], + "Accept-Encoding": [ + "gzip", + "deflate" + ], + "Content-Type": [ + "application/json" + ] + } + }, + "response": { + "status_code": 200, + "status": "200 OK", + "headers": { + "Content-Length": [ + "531" + ], + "Content-Type": [ + "application/json" + ] + }, + "body_size": 531 + } + } } }, - { - "__typename": "Country", - "key": { - "name": "Taiwan" + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "duration_load_nanoseconds": 1, + "duration_load_pretty": "1ns", + "single_flight_used": true, + "single_flight_shared_response": false, + "load_skipped": false, + "load_stats": { + "get_conn": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "host_port": "" + }, + "got_conn": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "reused": false, + "was_idle": false, + "idle_time_nanoseconds": 0, + "idle_time_pretty": "" + }, + "got_first_response_byte": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" + }, + "dns_start": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "", + "host": "" + }, + "dns_done": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "connect_start": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "network": "", + "addr": "" + }, + "connect_done": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns", + "network": "", + "addr": "" + }, + "tls_handshake_start": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "tls_handshake_done": { + "duration_since_start_nanoseconds": 0, + "duration_since_start_pretty": "" + }, + "wrote_headers": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" + }, + "wrote_request": { + "duration_since_start_nanoseconds": 1, + "duration_since_start_pretty": "1ns" } } - ] - } - }, - "header": {}, - "method": "POST", - "url": "http://localhost/graphql" - }, - "output": { - "data": { - "_entities": [ - { - "__typename": "Country", - "language": "English" - }, - { - "__typename": "Country", - "language": "German" - }, - { - "__typename": "Country", - "language": "English" - }, - { - "__typename": "Country", - "language": "Serbian" - }, - { - "__typename": "Country", - "language": "Indonesian" - }, - { - "__typename": "Country", - "language": "Dutch" - }, - { - "__typename": "Country", - "language": "Portuguese" - }, - { - "__typename": "Country", - "language": "Spanish" - }, - { - "__typename": "Country", - "language": "Thai" - }, - { - "__typename": "Country", - "language": "Korean" - }, - { - "__typename": "Country", - "language": "Taiwanese" - } - ] - }, - "extensions": { - "trace": { - "request": { - "method": "POST", - "url": "http://localhost/graphql", - "headers": { - "Accept": [ - "application/json" - ], - "Accept-Encoding": [ - "gzip", - "deflate" - ], - "Content-Type": [ - "application/json" - ] - } - }, - "response": { - "status_code": 200, - "status": "200 OK", - "headers": { - "Content-Length": [ - "531" - ], - "Content-Type": [ - "application/json" - ] - }, - "body_size": 531 } } } - }, - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "duration_load_nanoseconds": 1, - "duration_load_pretty": "1ns", - "single_flight_used": true, - "single_flight_shared_response": false, - "load_skipped": false, - "load_stats": { - "get_conn": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "host_port": "" - }, - "got_conn": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "reused": false, - "was_idle": false, - "idle_time_nanoseconds": 0, - "idle_time_pretty": "" - }, - "got_first_response_byte": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" - }, - "dns_start": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "", - "host": "" - }, - "dns_done": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "connect_start": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "network": "", - "addr": "" - }, - "connect_done": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns", - "network": "", - "addr": "" - }, - "tls_handshake_start": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "tls_handshake_done": { - "duration_since_start_nanoseconds": 0, - "duration_since_start_pretty": "" - }, - "wrote_headers": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" - }, - "wrote_request": { - "duration_since_start_nanoseconds": 1, - "duration_since_start_pretty": "1ns" - } - } + ] } - } + ] } ] }, diff --git a/router/go.mod b/router/go.mod index 0a51e0aa82..20e4a8cf15 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.14.1 + github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190 // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0 go.opentelemetry.io/contrib/propagators/b3 v1.44.0 diff --git a/router/go.sum b/router/go.sum index f9cb5d5237..ff10949e9a 100644 --- a/router/go.sum +++ b/router/go.sum @@ -334,8 +334,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.3.0 h1:n0ng5a1vbd8YGq1u3rMr0vPU5f6AZ1BXIiUhL1UIok8= github.com/wundergraph/go-arena v1.3.0/go.mod h1:ROOysEHWJjLQ8FSfNxZCziagb7Qw2nXY3/vgKRh7eWw= -github.com/wundergraph/graphql-go-tools/v2 v2.14.1 h1:TecnvTyhskoeiqo6W+1xh7HqAPL/RG5vfbFhezu7RLs= -github.com/wundergraph/graphql-go-tools/v2 v2.14.1/go.mod h1:zREIKLmpjfNcGSubndaW/913r0Y8XbbYOXQeZFkwHdo= +github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190 h1:V0d3bNpOZiA8Ft58zCA5Uobqa3lgx6927z8BKGUDD5E= +github.com/wundergraph/graphql-go-tools/v2 v2.14.2-0.20260724105457-015663efb190/go.mod h1:zREIKLmpjfNcGSubndaW/913r0Y8XbbYOXQeZFkwHdo= 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=