Skip to content

Commit

Permalink
fix: inject a per-subgraph http.Client to fix timeout race issue (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
endigma authored Feb 5, 2025
1 parent 5d77c3e commit 6501202
Show file tree
Hide file tree
Showing 16 changed files with 481 additions and 146 deletions.
42 changes: 42 additions & 0 deletions demo/graph-no-edg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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
subgraphs:
- name: employees
routing_url: http://localhost:4001/graphql
schema:
file: ./pkg/subgraphs/employees/subgraph/schema.graphqls
- name: family
routing_url: http://localhost:4002/graphql
schema:
file: ./pkg/subgraphs/family/subgraph/schema.graphqls
- name: hobbies
routing_url: http://localhost:4003/graphql
schema:
file: ./pkg/subgraphs/hobbies/subgraph/schema.graphqls
- name: products
routing_url: http://localhost:4004/graphql
schema:
file: ./pkg/subgraphs/products/subgraph/schema.graphqls
- name: test1
routing_url: http://localhost:4006/graphql
schema:
file: ./pkg/subgraphs/test1/subgraph/schema.graphqls
- name: availability
routing_url: http://localhost:4007/graphql
schema:
file: ./pkg/subgraphs/availability/subgraph/schema.graphqls
- name: mood
routing_url: http://localhost:4008/graphql
schema:
file: ./pkg/subgraphs/mood/subgraph/schema.graphqls
- name: countries
routing_url: http://localhost:4009/graphql
schema:
file: ./pkg/subgraphs/countries/subgraph/schema.graphqls
138 changes: 138 additions & 0 deletions demo/pkg/subgraphs/test1/subgraph/generated/generated.go

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

2 changes: 2 additions & 0 deletions demo/pkg/subgraphs/test1/subgraph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type Query {
deeplyNestedObjects: Int! = 100
): [BigObject!]!

longResponse(artificialDelay: Int! = 0, bytes: Int!): String

bigAbstractResponse: BigAbstractResponse

rootFieldWithListArg(arg: [String!]!): [String!]!
Expand Down
32 changes: 30 additions & 2 deletions demo/pkg/subgraphs/test1/subgraph/schema.resolvers.go

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

2 changes: 1 addition & 1 deletion router-tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ clean-testcache:
go clean -testcache

update-test-config:
./update-config.sh
./update-config-no-edg.sh

.PHONY: test test-no-race lint test-stability clean-testcache update-test-config test-fresh

Expand Down
4 changes: 4 additions & 0 deletions router-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This directory contains integration tests for the router. It is a separate packa
to prevent dependencies of the tests and demos from becoming dependencies of
github.com/wundergraph/cosmo/router.

## Updating the demo subgraphs

Regenerate the router execution config with `./update-config-no-edg.sh`. This will propogate any changes from the SDLs.

## Running the tests

```bash
Expand Down
2 changes: 1 addition & 1 deletion router-tests/testdata/introspection/base-graph-schema.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

59 changes: 45 additions & 14 deletions router-tests/testenv/testdata/config.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6501202

Please sign in to comment.