diff --git a/demo/go.mod b/demo/go.mod index 42b44eb3b3..d9d3c16fbd 100644 --- a/demo/go.mod +++ b/demo/go.mod @@ -13,7 +13,7 @@ require ( github.com/wundergraph/cosmo/composition-go v0.0.0-20240124120900-5effe48a4a1d github.com/wundergraph/cosmo/router v0.0.0-20250218093943-e5b2167f65c7 github.com/wundergraph/cosmo/router-tests v0.0.0-20250218093943-e5b2167f65c7 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.155 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.1 diff --git a/demo/go.sum b/demo/go.sum index b57e183ced..5caa4cf2da 100644 --- a/demo/go.sum +++ b/demo/go.sum @@ -357,12 +357,12 @@ 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/cosmo/composition-go v0.0.0-20240124120900-5effe48a4a1d h1:NEUrhuqOaTO1dpW8pz2tu6dKbQAqFvgiF/m4NXdzZm0= github.com/wundergraph/cosmo/composition-go v0.0.0-20240124120900-5effe48a4a1d/go.mod h1:9I3gPMAlAY+m1/cFL20iN7XHTyuZd3VT5ijccdU/FsI= -github.com/wundergraph/cosmo/router v0.0.0-20250218093943-e5b2167f65c7 h1:+kwYDe0/Tm10VTTAgGFXoeVHCnQVwPuKsHijtZKMD4Q= github.com/wundergraph/cosmo/router v0.0.0-20250218093943-e5b2167f65c7/go.mod h1:fegv/vONTxD6SRweTJyQSBALVvyst1zI6DOhPj1vJsQ= github.com/wundergraph/cosmo/router-tests v0.0.0-20250218093943-e5b2167f65c7 h1:xWDcFs4dCLKgu6ZxW8ADeywL5B8vSLLdZEM8htitzDY= github.com/wundergraph/cosmo/router-tests v0.0.0-20250218093943-e5b2167f65c7/go.mod h1:M9w5UOrQkB86E4ZYoLFhvl+04U83B4zm5r2TFtobHxc= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.155 h1:+ygDhCfLCwDE1aL+2wjtU0PfrMJ9f9ZLb0Lm0w5W7Is= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.155/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156 h1:OFc0aBKNYav0uZb72WjLNkHaE/onc+joeSTxCnZKdlI= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/router-tests/go.mod b/router-tests/go.mod index 669ded73d8..631c77b285 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -25,7 +25,7 @@ require ( github.com/twmb/franz-go/pkg/kadm v1.11.0 github.com/wundergraph/cosmo/demo v0.0.0-20250218124445-6709220e2efe github.com/wundergraph/cosmo/router v0.0.0-20250218124445-6709220e2efe - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157 go.opentelemetry.io/otel v1.28.0 go.opentelemetry.io/otel/sdk v1.28.0 go.opentelemetry.io/otel/sdk/metric v1.28.0 @@ -178,7 +178,7 @@ require ( replace ( github.com/wundergraph/cosmo/demo => ../demo github.com/wundergraph/cosmo/router => ../router -// github.com/wundergraph/graphql-go-tools/v2 => ../../graphql-go-tools/v2 + // github.com/wundergraph/graphql-go-tools/v2 => ../../graphql-go-tools/v2 ) replace github.com/hashicorp/consul/sdk => github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301 diff --git a/router-tests/go.sum b/router-tests/go.sum index 046aff5cdb..8948a401e5 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -335,8 +335,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.156 h1:OFc0aBKNYav0uZb72WjLNkHaE/onc+joeSTxCnZKdlI= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157 h1:2Fc99E76AKChyJke2FyJYcRJyaTaChr9wnSeybia/FY= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= diff --git a/router/core/executor.go b/router/core/executor.go index 34b55de7c5..3344caa83a 100644 --- a/router/core/executor.go +++ b/router/core/executor.go @@ -79,6 +79,7 @@ func (b *ExecutorConfigurationBuilder) Build(ctx context.Context, opts *Executor AllowedSubgraphErrorFields: opts.RouterEngineConfig.SubgraphErrorPropagation.AllowedFields, MaxRecyclableParserSize: opts.RouterEngineConfig.Execution.ResolverMaxRecyclableParserSize, MultipartSubHeartbeatInterval: opts.HeartbeatInterval, + MaxSubscriptionFetchTimeout: opts.RouterEngineConfig.Execution.SubscriptionFetchTimeout, } if opts.ApolloCompatibilityFlags.ValueCompletion.Enabled { diff --git a/router/go.mod b/router/go.mod index 07ff794f58..94aa55b768 100644 --- a/router/go.mod +++ b/router/go.mod @@ -31,7 +31,7 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 github.com/twmb/franz-go v1.16.1 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157 // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 go.opentelemetry.io/contrib/propagators/b3 v1.23.0 diff --git a/router/go.sum b/router/go.sum index 3d7a014899..0d1e829ccf 100644 --- a/router/go.sum +++ b/router/go.sum @@ -279,8 +279,8 @@ github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0 github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTBjW+SZK4mhxTTBVpxcqeBgWF1Rfmltbfk= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156 h1:OFc0aBKNYav0uZb72WjLNkHaE/onc+joeSTxCnZKdlI= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.156/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157 h1:2Fc99E76AKChyJke2FyJYcRJyaTaChr9wnSeybia/FY= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.157/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= diff --git a/router/pkg/config/config.go b/router/pkg/config/config.go index 2130e7e952..1e83705dbb 100644 --- a/router/pkg/config/config.go +++ b/router/pkg/config/config.go @@ -347,6 +347,7 @@ type EngineExecutionConfiguration struct { ResolverMaxRecyclableParserSize int `envDefault:"32768" env:"ENGINE_RESOLVER_MAX_RECYCLABLE_PARSER_SIZE" yaml:"resolver_max_recyclable_parser_size,omitempty"` EnableSubgraphFetchOperationName bool `envDefault:"false" env:"ENGINE_ENABLE_SUBGRAPH_FETCH_OPERATION_NAME" yaml:"enable_subgraph_fetch_operation_name"` DisableVariablesRemapping bool `envDefault:"false" env:"ENGINE_DISABLE_VARIABLES_REMAPPING" yaml:"disable_variables_remapping"` + SubscriptionFetchTimeout time.Duration `envDefault:"30s" env:"ENGINE_SUBSCRIPTION_FETCH_TIMEOUT" yaml:"subscription_fetch_timeout,omitempty"` } type BlockOperationConfiguration struct { diff --git a/router/pkg/config/config.schema.json b/router/pkg/config/config.schema.json index 4da62c3fa6..62bd32f243 100644 --- a/router/pkg/config/config.schema.json +++ b/router/pkg/config/config.schema.json @@ -2257,6 +2257,12 @@ "type": "boolean", "default": false, "description": "Disables variables renaming during normalization. This option could have a negative impact on planner cache hits." + }, + "subscription_fetch_timeout": { + "type": "string", + "format": "go-duration", + "default": "30s", + "description": "The maximum time a subscription fetch can take before it is considered timed out. The period is specified as a string with a number and a unit, e.g. 10ms, 1s, 1m, 1h. The supported units are 'ms', 's', 'm', 'h'." } } }, diff --git a/router/pkg/config/testdata/config_defaults.json b/router/pkg/config/testdata/config_defaults.json index 62c4c0bfa7..1c4d0d624e 100644 --- a/router/pkg/config/testdata/config_defaults.json +++ b/router/pkg/config/testdata/config_defaults.json @@ -303,7 +303,8 @@ "ValidationCacheSize": 1024, "ResolverMaxRecyclableParserSize": 32768, "EnableSubgraphFetchOperationName": false, - "DisableVariablesRemapping": false + "DisableVariablesRemapping": false, + "SubscriptionFetchTimeout": 30000000000 }, "WebSocket": { "Enabled": true, diff --git a/router/pkg/config/testdata/config_full.json b/router/pkg/config/testdata/config_full.json index 4bff9dac6c..6f7b47d83b 100644 --- a/router/pkg/config/testdata/config_full.json +++ b/router/pkg/config/testdata/config_full.json @@ -574,7 +574,8 @@ "ValidationCacheSize": 1024, "ResolverMaxRecyclableParserSize": 4096, "EnableSubgraphFetchOperationName": true, - "DisableVariablesRemapping": false + "DisableVariablesRemapping": false, + "SubscriptionFetchTimeout": 30000000000 }, "WebSocket": { "Enabled": true,