-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: null handling in the resolvers (#1760)
- Loading branch information
1 parent
ed7bdc6
commit d5cb75d
Showing
11 changed files
with
191 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Empty Array Response | ||
|
||
```graphql @server | ||
schema @server { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
hi(id: ID!): [Company] @http(baseURL: "http://localhost:3000", path: "/hi") | ||
} | ||
type Company { | ||
name: String | ||
id: ID | ||
} | ||
``` | ||
|
||
```yml @mock | ||
- request: | ||
method: GET | ||
url: http://localhost:3000/hi | ||
response: | ||
status: 200 | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8080/graphql | ||
body: | ||
query: "query { hi (id: 1) { name id } }" | ||
``` |
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,30 @@ | ||
# Empty Object Response | ||
|
||
```graphql @server | ||
schema @server { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
hi(id: ID!): Company @http(baseURL: "http://localhost:3000", path: "/hi") | ||
} | ||
type Company { | ||
name: String | ||
id: ID | ||
} | ||
``` | ||
|
||
```yml @mock | ||
- request: | ||
method: GET | ||
url: http://localhost:3000/hi | ||
response: | ||
status: 200 | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8080/graphql | ||
body: | ||
query: "query { hi (id: 1) { name id } }" | ||
``` |
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 |
---|---|---|
|
@@ -9,9 +9,7 @@ expression: response | |
}, | ||
"body": { | ||
"data": { | ||
"user": { | ||
"name": null | ||
} | ||
"user": null | ||
}, | ||
"errors": [ | ||
{ | ||
|
28 changes: 28 additions & 0 deletions
28
tests/snapshots/execution_spec__test-null-in-array.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,28 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: client | ||
--- | ||
type Company { | ||
id: ID | ||
name: String | ||
} | ||
|
||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar JSON | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
hi(id: ID!): [Company] | ||
} | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/snapshots/execution_spec__test-null-in-array.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,16 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: merged | ||
--- | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
type Company { | ||
id: ID | ||
name: String | ||
} | ||
|
||
type Query { | ||
hi(id: ID!): [Company] @http(baseURL: "http://localhost:3000", path: "/hi") | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/snapshots/execution_spec__test-null-in-array.md_test_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,15 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"hi": null | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/snapshots/execution_spec__test-null-in-object.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,28 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: client | ||
--- | ||
type Company { | ||
id: ID | ||
name: String | ||
} | ||
|
||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar JSON | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
hi(id: ID!): Company | ||
} | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/snapshots/execution_spec__test-null-in-object.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,16 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: merged | ||
--- | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
type Company { | ||
id: ID | ||
name: String | ||
} | ||
|
||
type Query { | ||
hi(id: ID!): Company @http(baseURL: "http://localhost:3000", path: "/hi") | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/snapshots/execution_spec__test-null-in-object.md_test_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,15 @@ | ||
--- | ||
source: tests/execution_spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"hi": null | ||
} | ||
} | ||
} |
d5cb75d
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
395550 requests in 30.02s, 1.98GB read
Requests/sec: 13177.21
Transfer/sec: 67.63MB