-
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: input types loose out on provided graphQL documentation (#2015)
Co-authored-by: Tushar Mathur <[email protected]>
- Loading branch information
1 parent
0fa7e10
commit 27ea39a
Showing
7 changed files
with
164 additions
and
12 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
48 changes: 48 additions & 0 deletions
48
tests/core/snapshots/test-input-documentation.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,48 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
assertion_line: 278 | ||
expression: formatted | ||
--- | ||
scalar Date | ||
|
||
scalar Email | ||
|
||
scalar Empty | ||
|
||
""" | ||
Test input documentation | ||
""" | ||
input Foo { | ||
""" | ||
Test input field documentation | ||
""" | ||
id: Int | ||
} | ||
|
||
scalar JSON | ||
|
||
type Mutation { | ||
testDocumentation(input: Foo!): Post | ||
} | ||
|
||
scalar PhoneNumber | ||
|
||
type Post { | ||
body: String | ||
id: Int! | ||
} | ||
|
||
""" | ||
Some Documentation | ||
""" | ||
type Query { | ||
foo: String | ||
postFromFoo(id: Int!): Post | ||
} | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
mutation: Mutation | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/core/snapshots/test-input-documentation.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,36 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
assertion_line: 235 | ||
expression: formatter | ||
--- | ||
schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
""" | ||
Test input documentation | ||
""" | ||
input Foo { | ||
""" | ||
Test input field documentation | ||
""" | ||
id: Int | ||
} | ||
|
||
type Mutation { | ||
testDocumentation(input: Foo!): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") | ||
} | ||
|
||
type Post { | ||
body: String | ||
id: Int! | ||
} | ||
|
||
""" | ||
Some Documentation | ||
""" | ||
type Query { | ||
foo: String @http(path: "/foo") | ||
postFromFoo(id: Int!): Post @http(path: "/posts?id={{.args.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,39 @@ | ||
--- | ||
identity: true | ||
--- | ||
|
||
# test-input-type-documentation | ||
|
||
```graphql @config | ||
schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
""" | ||
Test input documentation | ||
""" | ||
input Foo { | ||
""" | ||
Test input field documentation | ||
""" | ||
id: Int | ||
} | ||
|
||
type Mutation { | ||
testDocumentation(input: Foo!): Post @http(body: "{{.args.input}}", method: "POST", path: "/posts") | ||
} | ||
|
||
type Post { | ||
body: String | ||
id: Int! | ||
} | ||
|
||
""" | ||
Some Documentation | ||
""" | ||
type Query { | ||
foo: String @http(path: "/foo") | ||
postFromFoo(id: Int!): Post @http(path: "/posts?id={{.args.id}}") | ||
} | ||
``` |
27ea39a
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
458783 requests in 30.02s, 2.30GB read
Requests/sec: 15283.14
Transfer/sec: 78.44MB