Skip to content

Commit

Permalink
fix: interface objects typename checks (#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsergiy authored Feb 12, 2025
1 parent 5361a94 commit 07b6464
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 8 deletions.
4 changes: 4 additions & 0 deletions demo/pkg/subgraphs/family/subgraph/schema.resolvers.go

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

6 changes: 3 additions & 3 deletions router-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ require (
github.com/tidwall/gjson v1.18.0
github.com/twmb/franz-go v1.16.1
github.com/twmb/franz-go/pkg/kadm v1.11.0
github.com/wundergraph/cosmo/demo v0.0.0-20250207160837-a05ecd594e71
github.com/wundergraph/cosmo/router v0.0.0-20250207160837-a05ecd594e71
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.149
github.com/wundergraph/cosmo/demo v0.0.0-20250211143622-16d1619986e4
github.com/wundergraph/cosmo/router v0.0.0-20250211143622-16d1619986e4
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/sdk v1.28.0
go.opentelemetry.io/otel/sdk/metric v1.28.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 @@ -365,8 +365,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.149 h1:2eTV7h0dogUD8zPVnVaVC26s5kyi3BNl1f+eWcAltGM=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.149/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151 h1:gLE6iYQyPO1ib53nLjlo5s/9g8pTgenCPmF5bSvF7zE=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
7 changes: 7 additions & 0 deletions router-tests/testdata/queries/findEmployeesNoCriteria.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query {
findEmployees {
details {
forename
}
}
}
56 changes: 56 additions & 0 deletions router-tests/testdata/queries/findEmployeesNoCriteria.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"data": {
"findEmployees": [
{
"details": {
"forename": "Jens"
}
},
{
"details": {
"forename": "Dustin"
}
},
{
"details": {
"forename": "Stefan"
}
},
{
"details": {
"forename": "Björn"
}
},
{
"details": {
"forename": "Sergiy"
}
},
{
"details": {
"forename": "Suvij"
}
},
{
"details": {
"forename": "Nithin"
}
},
{
"details": {
"forename": "Eelco"
}
},
{
"details": {
"forename": "Alexandra"
}
},
{
"details": {
"forename": "David"
}
}
]
}
}
4 changes: 4 additions & 0 deletions router/core/plan_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"

log "github.com/jensneuse/abstractlogger"

"github.com/wundergraph/graphql-go-tools/v2/pkg/ast"
"github.com/wundergraph/graphql-go-tools/v2/pkg/astnormalization"
"github.com/wundergraph/graphql-go-tools/v2/pkg/astparser"
Expand All @@ -18,6 +19,8 @@ import (
"github.com/wundergraph/graphql-go-tools/v2/pkg/engine/resolve"
"github.com/wundergraph/graphql-go-tools/v2/pkg/operationreport"

"github.com/wundergraph/cosmo/router/pkg/config"

"github.com/wundergraph/cosmo/router/pkg/execution_config"
)

Expand Down Expand Up @@ -125,6 +128,7 @@ func (pg *PlanGenerator) loadConfiguration(configFilePath string) error {
httpClient: http.DefaultClient,
streamingClient: http.DefaultClient,
subscriptionClient: subscriptionClient,
transportOptions: &TransportOptions{SubgraphTransportOptions: NewSubgraphTransportOptions(config.TrafficShapingRules{})},
})

// this generates the plan configuration using the data source factories from the config package
Expand Down
2 changes: 1 addition & 1 deletion router/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.149
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151
// 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
Expand Down
4 changes: 2 additions & 2 deletions router/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.149 h1:2eTV7h0dogUD8zPVnVaVC26s5kyi3BNl1f+eWcAltGM=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.149/go.mod h1:B7eV0Qh8Lop9QzIOQcsvKp3S0ejfC6mgyWoJnI917yQ=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151 h1:gLE6iYQyPO1ib53nLjlo5s/9g8pTgenCPmF5bSvF7zE=
github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.151/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=
Expand Down

0 comments on commit 07b6464

Please sign in to comment.