-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
dedupe
in Upstream (#1778)
Co-authored-by: Amit Singh <[email protected]> Co-authored-by: Tushar Mathur <[email protected]>
- Loading branch information
1 parent
ca0a8bb
commit b534fce
Showing
25 changed files
with
496 additions
and
20 deletions.
There are no files selected for viewing
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
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
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,19 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"posts": { | ||
"user": { | ||
"name": "Leanne Graham" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,36 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: client | ||
--- | ||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar JSON | ||
|
||
scalar PhoneNumber | ||
|
||
type Post { | ||
body: String | ||
id: Int | ||
title: String | ||
user: User | ||
userId: Int! | ||
} | ||
|
||
type Query { | ||
posts: Post | ||
} | ||
|
||
scalar Url | ||
|
||
type User { | ||
id: Int | ||
name: String | ||
} | ||
|
||
schema { | ||
query: Query | ||
} |
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,24 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: merged | ||
--- | ||
schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com") { | ||
query: Query | ||
} | ||
|
||
type Post { | ||
body: String | ||
id: Int | ||
title: String | ||
user: User @http(path: "/users/{{.value.userId}}") | ||
userId: Int! | ||
} | ||
|
||
type Query { | ||
posts: Post @http(path: "/post?id=1") | ||
} | ||
|
||
type User { | ||
id: Int | ||
name: String | ||
} |
34 changes: 34 additions & 0 deletions
34
tests/core/snapshots/async-cache-enable-multiple-resolvers.md_0.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,34 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"posts": [ | ||
{ | ||
"user": { | ||
"name": "Leanne Graham" | ||
}, | ||
"taggedUsers": [ | ||
{}, | ||
{} | ||
] | ||
}, | ||
{ | ||
"user": { | ||
"name": "Leanne Graham" | ||
}, | ||
"taggedUsers": [ | ||
{}, | ||
{} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
tests/core/snapshots/async-cache-enable-multiple-resolvers.md_client.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,37 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: client | ||
--- | ||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar JSON | ||
|
||
scalar PhoneNumber | ||
|
||
type Post { | ||
body: String | ||
id: Int! | ||
taggedUsers: [User] | ||
title: String | ||
user: User | ||
userId: Int! | ||
} | ||
|
||
type Query { | ||
posts: [Post] | ||
} | ||
|
||
scalar Url | ||
|
||
type User { | ||
id: Int | ||
name: String | ||
} | ||
|
||
schema { | ||
query: Query | ||
} |
25 changes: 25 additions & 0 deletions
25
tests/core/snapshots/async-cache-enable-multiple-resolvers.md_merged.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,25 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: merged | ||
--- | ||
schema @server(port: 8000, queryValidation: false) @upstream(baseURL: "http://jsonplaceholder.typicode.com", dedupe: true) { | ||
query: Query | ||
} | ||
|
||
type Post { | ||
body: String | ||
id: Int! | ||
taggedUsers: [User] @http(path: "/taggedUsers/{{.value.id}}") | ||
title: String | ||
user: User @http(path: "/users/{{.value.userId}}") | ||
userId: Int! | ||
} | ||
|
||
type Query { | ||
posts: [Post] @http(path: "/posts?id=1") | ||
} | ||
|
||
type User { | ||
id: Int | ||
name: String | ||
} |
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,26 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"posts": [ | ||
{ | ||
"user": { | ||
"name": "Leanne Graham" | ||
} | ||
}, | ||
{ | ||
"user": { | ||
"name": "Leanne Graham" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.