-
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.
- Loading branch information
Showing
5 changed files
with
164 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,22 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
assertion_line: 200 | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"queryTest": [ | ||
{ | ||
"id": 1, | ||
"name": "foo", | ||
"num": 1 | ||
} | ||
] | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
tests/core/snapshots/test-input-with-arg-out.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,59 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatted | ||
--- | ||
scalar Bytes | ||
|
||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
scalar Int128 | ||
|
||
scalar Int16 | ||
|
||
scalar Int32 | ||
|
||
scalar Int64 | ||
|
||
scalar Int8 | ||
|
||
input IntFilter { | ||
i: Int | ||
} | ||
|
||
scalar JSON | ||
|
||
type MyType { | ||
id: String! | ||
name(sf: StringFilter): String | ||
num(if: IntFilter): Int | ||
} | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
queryTest(filter: StringFilter): [MyType] | ||
} | ||
|
||
input StringFilter { | ||
s: String | ||
} | ||
|
||
scalar UInt128 | ||
|
||
scalar UInt16 | ||
|
||
scalar UInt32 | ||
|
||
scalar UInt64 | ||
|
||
scalar UInt8 | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
31 changes: 31 additions & 0 deletions
31
tests/core/snapshots/test-input-with-arg-out.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,31 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
assertion_line: 235 | ||
expression: formatter | ||
--- | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
input IntFilter { | ||
i: Int | ||
} | ||
|
||
input StringFilter { | ||
s: String | ||
} | ||
|
||
type MyType { | ||
id: String! | ||
name(sf: StringFilter): String | ||
num(if: IntFilter): Int | ||
} | ||
|
||
type Query { | ||
queryTest(filter: StringFilter): [MyType] | ||
@graphQL( | ||
args: [{key: "filter", value: "{{.args.filter}}"}] | ||
baseURL: "http://localhost:8083/mesh" | ||
name: "getMyType" | ||
) | ||
} |
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,51 @@ | ||
# test-input-with-arg-type | ||
|
||
```graphql @config | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
queryTest(filter: StringFilter): [MyType] | ||
@graphQL( | ||
name: "getMyType" | ||
args: [{key: "filter", value: "{{.args.filter}}"}] | ||
baseURL: "http://localhost:8083/mesh" | ||
) | ||
} | ||
|
||
type StringFilter { | ||
s: String | ||
} | ||
type IntFilter { | ||
i: Int | ||
} | ||
|
||
type MyType { | ||
id: String! | ||
name(sf: StringFilter): String | ||
num(if: IntFilter): Int | ||
} | ||
``` | ||
|
||
```yml @mock | ||
- request: | ||
method: POST | ||
url: http://localhost:8083/mesh | ||
textBody: '{ "query": "query { getMyType(filter: {s: \\\"1\\\"}) { id name(sf: {s: \\\"f\\\"}) num(if: {i: 3}) } }" }' | ||
response: | ||
status: 200 | ||
body: | ||
data: | ||
getMyType: | ||
- id: 1 | ||
name: foo | ||
num: 1 | ||
``` | ||
|
||
```yml @test | ||
- method: POST | ||
url: http://localhost:8000/graphql | ||
body: | ||
query: 'query { queryTest(filter: {s: "1"}) { id name(sf: {s: "f"}) num(if: {i :3}) } }' | ||
``` |
cd21c54
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
453831 requests in 30.01s, 2.27GB read
Requests/sec: 15121.46
Transfer/sec: 77.61MB