Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions demo/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/expr-lang/expr v1.17.6 h1:1h6i8ONk9cexhDmowO/A64VPxHScu7qfSl2k8OlINec=
github.com/expr-lang/expr v1.17.6/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
github.com/expr-lang/expr v1.17.7 h1:Q0xY/e/2aCIp8g9s/LGvMDCC5PxYlvHgDZRQ4y16JX8=
github.com/expr-lang/expr v1.17.7/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
Expand Down
37 changes: 32 additions & 5 deletions demo/graph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,69 @@ version: 1
feature_flags:
- name: myff
feature_graphs:
- name: products_fg
subgraph_name: products
routing_url: http://localhost:4010/graphql
schema:
file: ./pkg/subgraphs/products_fg/subgraph/schema.graphqls
- name: products_fg
subgraph_name: products
routing_url: http://localhost:4010/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/products_fg/subgraph/schema.graphqls
subgraphs:
- name: employees
routing_url: http://localhost:4001/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/employees/subgraph/schema.graphqls
- name: family
routing_url: http://localhost:4002/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/family/subgraph/schema.graphqls
- name: hobbies
routing_url: http://localhost:4003/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/hobbies/subgraph/schema.graphqls
- name: products
routing_url: http://localhost:4004/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/products/subgraph/schema.graphqls
- name: test1
routing_url: http://localhost:4006/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/test1/subgraph/schema.graphqls
- name: availability
routing_url: http://localhost:4007/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/availability/subgraph/schema.graphqls
- name: mood
routing_url: http://localhost:4008/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/mood/subgraph/schema.graphqls
- name: countries
routing_url: http://localhost:4009/graphql
subscription:
protocol: 'ws'
websocketSubprotocol: 'graphql-transport-ws'
schema:
file: ./pkg/subgraphs/countries/subgraph/schema.graphqls
- name: employeeupdated
Expand Down
6 changes: 3 additions & 3 deletions demo/pkg/subgraphs/projects/generated/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/pkg/subgraphs/projects/generated/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ message ResolveProjectCriticalDeadlineArgs {
message ResolveProjectCriticalDeadlineContext {
string id = 1;
ProjectStatus status = 2;
repeated Milestone milestones = 3;
Milestone milestones = 3;
}

message ResolveProjectCriticalDeadlineRequest {
Expand Down
6 changes: 3 additions & 3 deletions router-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e
github.com/wundergraph/cosmo/router v0.0.0-20251126113850-ce5751591be9
github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.241.0.20251217104010-258377327dcd
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.242.0.20260204110453-ac812888ac75
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 Expand Up @@ -57,7 +57,7 @@ require (
github.com/cep21/circuit/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cilium/ebpf v0.16.0 // indirect
github.com/coder/websocket v1.8.13 // indirect
github.com/coder/websocket v1.8.14 // indirect
github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
Expand Down Expand Up @@ -129,7 +129,7 @@ require (
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/r3labs/sse/v2 v2.8.1 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
Expand Down
15 changes: 8 additions & 7 deletions router-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ github.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok=
github.com/cilium/ebpf v0.16.0/go.mod h1:L7u2Blt2jMM/vLAVgjxluxtBKlz3/GWjB0dMOEngfwE=
github.com/cloudflare/backoff v0.0.0-20240920015135-e46b80a3a7d0 h1:pRcxfaAlK0vR6nOeQs7eAEvjJzdGXl8+KaBlcvpQTyQ=
github.com/cloudflare/backoff v0.0.0-20240920015135-e46b80a3a7d0/go.mod h1:rzgs2ZOiguV6/NpiDgADjRLPNyZlApIWxKpkT+X8SdY=
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0=
github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE=
github.com/containerd/stargz-snapshotter/estargz v0.16.3 h1:7evrXtoh1mSbGj/pfRccTampEyKpjpOnS3CyiV1Ebr8=
Expand Down Expand Up @@ -132,8 +132,9 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-containerregistry v0.20.3 h1:oNx7IdTI936V8CQRveCjaxOiegWwvM7kqkbXTpyiovI=
github.com/google/go-containerregistry v0.20.3/go.mod h1:w00pIgBRDVUDFM6bq+Qx8lwNWK+cxgCuX1vd3PIBDNI=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
Expand Down Expand Up @@ -276,8 +277,8 @@ github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRl
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
Expand Down Expand Up @@ -354,8 +355,8 @@ github.com/wundergraph/astjson v1.0.0 h1:rETLJuQkMWWW03HCF6WBttEBOu8gi5vznj5KEUP
github.com/wundergraph/astjson v1.0.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.241.0.20251217104010-258377327dcd h1:K6TxOSXqbnyo6Yeeme0/ysrg696jpxG50tCly5R6SL0=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.241.0.20251217104010-258377327dcd/go.mod h1:MFbY0QI8ncF60DHs7yyyiyyhWyld0WE1JokiyTVY8j4=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.242.0.20260204110453-ac812888ac75 h1:w389fJMhiiiYi9TAWzz0AxIhX5zUEJS8JdCsb3jHMyg=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.242.0.20260204110453-ac812888ac75/go.mod h1:qU+VqX2tNPWEXFbKvygmtDJmdiAKMAZWQ3O2DwIqDkA=
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=
Expand Down
18 changes: 10 additions & 8 deletions router-tests/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,12 +1314,12 @@ func configureRouter(listenerAddr string, testConfig *Config, routerConfig *node
}

engineExecutionConfig := config.EngineExecutionConfiguration{
EnableNetPoll: true,
EnableSingleFlight: true,
EnableInboundRequestDeduplication: false,
EnableRequestTracing: true,
EnableNormalizationCache: true,
NormalizationCacheSize: 1024,
EnableNetPoll: true,
EnableSingleFlight: true,
EnableInboundRequestDeduplication: false,
EnableRequestTracing: true,
EnableNormalizationCache: true,
NormalizationCacheSize: 1024,
Debug: config.EngineDebugConfiguration{
ReportWebSocketConnections: true,
PrintQueryPlans: false,
Expand Down Expand Up @@ -1737,10 +1737,10 @@ func grpcURL(endpoint string) string {
return "dns:///" + endpoint
}

func ReadAndCheckJSON(t testing.TB, conn *websocket.Conn, v interface{}) (err error) {
func ReadAndCheckJSON(t testing.TB, conn *websocket.Conn, v any) (err error) {
_, payload, err := conn.ReadMessage()
if err != nil {
return err
return fmt.Errorf("read message: %w", err)
}
if err := json.Unmarshal(payload, &v); err != nil {
t.Logf("Failed to decode WebSocket message. Raw payload: %s", string(payload))
Expand Down Expand Up @@ -2724,6 +2724,8 @@ func WSReadMessage(t testing.TB, conn *websocket.Conn) (messageType int, p []byt
}

func WSReadJSON(t testing.TB, conn *websocket.Conn, v interface{}) (err error) {
t.Helper()

b := backoff.New(5*time.Second, 100*time.Millisecond)

attempts := 0
Expand Down
Loading
Loading