-
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.
- Loading branch information
Showing
5 changed files
with
74 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,54 @@ | ||
schema | ||
@server(port: 8000, hostname: "0.0.0.0") | ||
@upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: 42) { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
posts: [Post] @http(path: "/posts?_limit=11", dedupe: true) | ||
users: [User] @http(path: "/users") | ||
user(id: Int!): User @http(path: "/users/{{.args.id}}") | ||
post(id: Int! = 1): Post @http(path: "/posts/{{.args.id}}") | ||
} | ||
|
||
type User { | ||
id: Int! | ||
name: String! | ||
username: String! | ||
email: String! | ||
phone: String | ||
blog: String @expr(body: "https://test.blog/users/website/{{.value.username}}") | ||
albums: [Album] @http(path: "/users/{{.value.id}}/albums?_limit=2") | ||
} | ||
|
||
type Post { | ||
id: Int! | ||
userId: Int! | ||
title: String! | ||
body: String! | ||
user: User @http(path: "/users/{{.value.userId}}") | ||
users: [User] @http(path: "/users") | ||
comments: [Comment] @http(path: "/posts/{{.value.id}}/comments") | ||
} | ||
|
||
type Comment { | ||
id: Int! | ||
name: String! | ||
email: String! | ||
body: String! | ||
title: String! @expr(body: "{{.value.email}}: {{.value.name}}") | ||
} | ||
|
||
type Photo { | ||
albumId: Int! | ||
id: Int! | ||
title: String! | ||
combinedId: String! @expr(body: "Album: {{.value.albumId}}, photo: {{.value.id}}") | ||
} | ||
|
||
type Album { | ||
userId: Int! | ||
id: Int! | ||
title: Int | ||
photos: [Photo] @http(path: "/albums/{{.value.id}}/photos?_limit=3") | ||
} |
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
99854c2
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
911242 requests in 30.09s, 187.71MB read
Requests/sec: 30284.58
Transfer/sec: 6.24MB