-
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.
fix(modify): bug in modify for graphql (#2983)
Co-authored-by: Heikel Bouzayene <[email protected]>
- Loading branch information
1 parent
1679aea
commit 9b003f8
Showing
7 changed files
with
130 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"user": { | ||
"city": "Globe", | ||
"newName": "Tailcall" | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/core/snapshots/graphql-conformance-018.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,17 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatted | ||
--- | ||
type Query { | ||
user(id: ID!): User! | ||
} | ||
|
||
type User { | ||
city: String | ||
id: ID! | ||
newName: String! | ||
} | ||
|
||
schema { | ||
query: Query | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/core/snapshots/graphql-conformance-018.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,19 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema | ||
@server(hostname: "0.0.0.0", port: 8001, queryValidation: false) | ||
@upstream(baseURL: "http://upstream/graphql", httpCache: 42) { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
user(id: ID!): User! @graphQL(args: [{key: "id", value: "{{.args.id}}"}], name: "user") | ||
} | ||
|
||
type User { | ||
city: String | ||
id: ID! | ||
name: String! @modify(name: "newName") | ||
} |
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 @@ | ||
# Basic queries with field modify check | ||
|
||
```graphql @config | ||
schema | ||
@server(port: 8001, queryValidation: false, hostname: "0.0.0.0") | ||
@upstream(baseURL: "http://upstream/graphql", httpCache: 42) { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
user(id: ID!): User! @graphQL(name: "user", args: [{key: "id", value: "{{.args.id}}"}]) | ||
} | ||
|
||
type User { | ||
id: ID! | ||
name: String! @modify(name: "newName") | ||
city: String | ||
} | ||
``` | ||
|
||
```yml @mock | ||
- request: | ||
method: POST | ||
url: http://upstream/graphql | ||
textBody: '{ "query": "query { user(id: 4) { city name } }" }' | ||
expectedHits: 1 | ||
response: | ||
status: 200 | ||
body: | ||
data: | ||
user: | ||
city: Globe | ||
name: Tailcall | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8080/graphql | ||
body: | ||
query: | | ||
query getUser { | ||
user(id: 4) { | ||
city | ||
newName | ||
} | ||
} | ||
``` |
9b003f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running 30s test @ http://localhost:8000/graphql
4 threads and 100 connections
405064 requests in 30.02s, 787.53MB read
Requests/sec: 13491.87
Transfer/sec: 26.23MB