-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: types across multiple configs (#2234)
Co-authored-by: Tushar Mathur <[email protected]>
- Loading branch information
1 parent
2606a1f
commit ff14331
Showing
5 changed files
with
119 additions
and
1 deletion.
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
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": { | ||
"bar": { | ||
"name": "name", | ||
"id": 1 | ||
} | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
tests/core/snapshots/test-multiple-config-types.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,55 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatted | ||
--- | ||
scalar Bytes | ||
|
||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
input Input { | ||
id: Int | ||
name: String | ||
} | ||
|
||
scalar Int128 | ||
|
||
scalar Int16 | ||
|
||
scalar Int32 | ||
|
||
scalar Int64 | ||
|
||
scalar Int8 | ||
|
||
scalar JSON | ||
|
||
type Output { | ||
id: Int | ||
name: String | ||
} | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
bar(input: Input): Output | ||
} | ||
|
||
scalar UInt128 | ||
|
||
scalar UInt16 | ||
|
||
scalar UInt32 | ||
|
||
scalar UInt64 | ||
|
||
scalar UInt8 | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/core/snapshots/test-multiple-config-types.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,11 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema @server @upstream @link(id: "types", src: "types.graphql", type: Config) { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
bar(input: Input): Output @expr(body: {id: "{{.args.input.id}}", name: "{{.args.input.name}}"}) | ||
} |
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 @@ | ||
# Multiple Configs | ||
|
||
```graphql @config | ||
schema @server @link(id: "types", type: Config, src: "types.graphql") { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
bar(input: Input): Output @expr(body: {id: "{{.args.input.id}}", name: "{{.args.input.name}}"}) | ||
} | ||
``` | ||
|
||
```graphql @file:types.graphql | ||
input Input { | ||
id: Int | ||
name: String | ||
} | ||
|
||
type Output { | ||
id: Int | ||
name: String | ||
} | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8080/graphql | ||
body: | ||
query: 'query { bar(input: {id: 1, name: "name"}) { name id } }' | ||
``` |
ff14331
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
455715 requests in 30.01s, 2.28GB read
Requests/sec: 15185.38
Transfer/sec: 77.94MB