forked from tailcallhq/tailcall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(2892): consider entity resolvers in n + 1 check (tailcallhq#2978)
- Loading branch information
Showing
15 changed files
with
304 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
type T1 @http(url: "") { | ||
t1: Int | ||
} | ||
|
||
type T2 @http(url: "") { | ||
t2: [N] @http(url: "") | ||
} | ||
|
||
type T3 @http(url: "", batchKey: ["id"]) { | ||
t3: [N] @http(url: "") | ||
} | ||
|
||
type T4 @http(url: "", batchKey: ["id"]) { | ||
t4: [N] @http(url: "", batchKey: ["id"]) | ||
} | ||
|
||
type T5 @http(url: "", batchKey: ["id"]) { | ||
t5: [String] @http(url: "", batchKey: ["id"]) | ||
} | ||
|
||
type T6 @http(url: "", batchKey: ["id"]) { | ||
t6: [Int] | ||
} | ||
|
||
type N { | ||
n: [Int] @http(url: "") | ||
} | ||
|
||
type Query { | ||
x: String | ||
t1: T1 @http(url: "") | ||
t2: T2 @http(url: "") | ||
t3: T3 @http(url: "") | ||
t4: T4 @http(url: "") | ||
t5: T5 @http(url: "") | ||
t6: T6 @http(url: "") | ||
t1_ls: [T1] @http(url: "") | ||
t2_ls: [T2] @http(url: "") | ||
t3_ls: [T3] @http(url: "") | ||
t4_ls: [T4] @http(url: "") | ||
t5_ls: [T5] @http(url: "") | ||
t6_ls: [T6] @http(url: "") | ||
} |
23 changes: 23 additions & 0 deletions
23
src/core/config/npo/fixtures/multiple-deeply-nested.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
type Root { | ||
nested: Nested1 | ||
nested_list: [Nested1] | ||
} | ||
|
||
type Nested1 { | ||
a: DeepNested @http(url: "") | ||
b: DeepNested @http(url: "", batchKey: ["id"]) | ||
c: DeepNested @http(url: "") | ||
d: [DeepNested] @http(url: "") | ||
} | ||
|
||
type DeepNested { | ||
test: [String] @http(url: "") | ||
} | ||
|
||
type Query { | ||
root: Root @http(url: "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
type T1 { | ||
t1: Int | ||
} | ||
|
||
type T2 { | ||
t2: [N] @http(url: "") | ||
} | ||
|
||
type T3 { | ||
t3: [N] @http(url: "", batchKey: ["id"]) | ||
} | ||
|
||
type N { | ||
n: Int @http(url: "") | ||
} | ||
|
||
type Query { | ||
x: String | ||
t1: T1 @http(url: "") | ||
t2: T2 @http(url: "") | ||
t3: T3 @http(url: "") | ||
t1_ls: [T1] @http(url: "") | ||
t2_ls: [T2] @http(url: "") | ||
t3_ls: [T3] @http(url: "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
schema @server(port: 8030) { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
version: Int! @expr(body: 1) | ||
foo: [Foo!]! @expr(body: [{fizz: "buzz"}]) | ||
bar: [Foo!]! @expr(body: [{fizz: "buzz"}]) | ||
buzz: [Foo!]! @expr(body: [{fizz: "buzz"}]) | ||
} | ||
|
||
type Foo { | ||
fizz: String! | ||
c: Int | ||
} | ||
|
||
type Foo { | ||
fizz: String! | ||
c: Int | ||
spam: [String!]! @http(url: "https://example.com/spam", query: [{key: "id", value: "{{.value.fizz}}"}]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
--- | ||
query { f1 { f1 { f2 } } } | ||
query { f1 { f2 } } |
15 changes: 15 additions & 0 deletions
15
...re/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__entity_resolver.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
snapshot_kind: text | ||
--- | ||
query { t2 { t2 { n } } } | ||
query { t2_ls { t2 } } | ||
query { t3 { t3 { n } } } | ||
query { t3_ls { t3 } } | ||
query { t4 { t4 { n } } } | ||
query { t4_ls { t4 { n } } } | ||
query { __entities(representations: [{ __typename: "T1"}]) } | ||
query { __entities(representations: [{ __typename: "T2"}]) } | ||
query { __entities(representations: [{ __typename: "T3"}]) { t3 } } | ||
query { __entities(representations: [{ __typename: "T4"}]) { t4 { n } } } |
10 changes: 10 additions & 0 deletions
10
...ig/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_deeply_nested.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
snapshot_kind: text | ||
--- | ||
query { root { nested { d { test } } } } | ||
query { root { nested_list { a } } } | ||
query { root { nested_list { b { test } } } } | ||
query { root { nested_list { c } } } | ||
query { root { nested_list { d } } } |
1 change: 1 addition & 0 deletions
1
...core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_keys.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
snapshot_kind: text | ||
--- | ||
query { f1 { f2 } } | ||
query { f1 { f3 } } |
8 changes: 8 additions & 0 deletions
8
...onfig/npo/snapshots/tailcall__core__config__npo__tracker__tests__multiple_type_usage.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
--- | ||
query { t2 { t2 { n } } } | ||
query { t2_ls { t2 } } | ||
query { t3 { t3 { n } } } | ||
query { t3_ls { t3 { n } } } |
7 changes: 7 additions & 0 deletions
7
...core/config/npo/snapshots/tailcall__core__config__npo__tracker__tests__nested_config.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
source: src/core/config/npo/tracker.rs | ||
expression: actual | ||
--- | ||
query { bar { spam } } | ||
query { buzz { spam } } | ||
query { foo { spam } } |
Oops, something went wrong.