Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2976b5e
feat: send subgraphs who requested fields
ysmolski Aug 22, 2025
a8b0596
rename extension
ysmolski Aug 26, 2025
3e83436
feat: implement openfed__protected
Aenimus Aug 26, 2025
10b8202
draft reading of protected fields
ysmolski Aug 27, 2025
d2a1701
Merge branch 'david/eng-7769-implement-oopenfed__protected' into yury…
ysmolski Aug 27, 2025
60d634d
rename fields after merge
ysmolski Aug 27, 2025
819d1c9
update based on the composition change
ysmolski Aug 27, 2025
8438d39
bump the engine
ysmolski Aug 27, 2025
c1a2456
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Aug 27, 2025
3c222b2
Merge branch 'main' into david/eng-7769-implement-oopenfed__protected
ysmolski Aug 27, 2025
1d33752
chore: avoid potential duplicate definitions
Aenimus Aug 27, 2025
ee482e3
chore: fix typo in comment
Aenimus Aug 27, 2025
9495e2d
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Aug 28, 2025
3ba193f
start renaming things
ysmolski Sep 1, 2025
4315610
bump engine to 20250827132225-23526ad02aa8
ysmolski Sep 1, 2025
410c6e8
chore: rename directive
Aenimus Sep 1, 2025
69005f3
Merge branch 'david/eng-7769-implement-oopenfed__protected' into yury…
ysmolski Sep 1, 2025
4d10430
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 1, 2025
03bb114
rename things for the new directive name
ysmolski Sep 1, 2025
edd54c9
generate stuff for connect
ysmolski Sep 1, 2025
65f1326
rename the config option
ysmolski Sep 1, 2025
8ce278b
renamed leftovers
ysmolski Sep 1, 2025
afafa6e
put back newlines in the golden jsons
ysmolski Sep 1, 2025
e4a62fe
remove newlines
ysmolski Sep 1, 2025
dfb43c9
remove newlines #2
ysmolski Sep 1, 2025
e83349a
use the fixed engine
ysmolski Sep 9, 2025
137706d
preallocate all fields of FederationMetaData
ysmolski Sep 9, 2025
1040bd9
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 9, 2025
ba008a5
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 10, 2025
10e8178
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 10, 2025
a8e6b50
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 11, 2025
55590fc
Update router/pkg/config/config.schema.json
ysmolski Sep 11, 2025
3a78c20
Merge branch 'main' into yury/eng-7769-fields-authorization-for-subgr…
ysmolski Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion router-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e
github.com/wundergraph/cosmo/router v0.0.0-20250820135159-bf8852195d3f
github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.224
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.225
go.opentelemetry.io/otel v1.36.0
go.opentelemetry.io/otel/sdk v1.36.0
go.opentelemetry.io/otel/sdk/metric v1.36.0
Expand Down
4 changes: 2 additions & 2 deletions router-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTB
github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE=
github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301 h1:EzfKHQoTjFDDcgaECCCR2aTePqMu9QBmPbyhqIYOhV0=
github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301/go.mod h1:wxI0Nak5dI5RvJuzGyiEK4nZj0O9X+Aw6U0tC1wPKq0=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.224 h1:HWxOmN7GK3iccm1JhMLlhDNVbG42EJw6QI8Qx857hhQ=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.224/go.mod h1:DnYY1alnsgzkanSwbFiFIdXKOuf8dHQWQ2P4BzTc6aI=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.225 h1:D7VbIl1P6/6Zj86HNiO7UmH05DDFnFLVA/ig31+Uy5c=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.225/go.mod h1:g1IFIylu5Fd9pKjzq0mDvpaKhEB/vkwLAIbGdX2djXU=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
Expand Down
36 changes: 36 additions & 0 deletions router-tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,42 @@ func TestVariablesRemapping(t *testing.T) {
})
}

func TestEnableRequireFetchReasons(t *testing.T) {
t.Parallel()

// Simple test to verify that the configuration switch works.
// Multi subgraphs calls are tested in the engine.
testenv.Run(t, &testenv.Config{
RouterConfigJSONTemplate: testenv.ConfigWithRequireFetchReasonsJSONTemplate,
ModifyEngineExecutionConfiguration: func(cfg *config.EngineExecutionConfiguration) {
cfg.EnableRequireFetchReasons = true
},
Subgraphs: testenv.SubgraphsConfig{
Employees: testenv.SubgraphConfig{
Middleware: func(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, _ := io.ReadAll(r.Body)
var req core.GraphQLRequest
require.NoError(t, json.Unmarshal(body, &req))

require.Equal(t, `query($a: Int!){employee(id: $a){id}}`, req.Query)
require.Equal(t, `{"fetch_reasons":[{"typename":"Employee","field":"id","by_user":true},{"typename":"Query","field":"employee","by_user":true}]}`, string(req.Extensions))

w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte(`{"data":{"employee":{"id":1}}}`))
})
},
},
},
}, func(t *testing.T, xEnv *testenv.Environment) {
res := xEnv.MakeGraphQLRequestOK(testenv.GraphQLRequest{
Query: `query ($count:Int!) { employee(id:$count) { id } }`,
Variables: json.RawMessage(`{"count":1}`),
})
require.JSONEq(t, `{"data":{"employee":{"id":1}}}`, res.Body)
})
}

func TestAnonymousQuery(t *testing.T) {
t.Parallel()

Expand Down
Loading