-
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(grpc): allow users to pass value along with mustache template (#2383
- Loading branch information
Showing
15 changed files
with
293 additions
and
27 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
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
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,17 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"newsById": { | ||
"id": 2 | ||
} | ||
} | ||
} | ||
} |
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,17 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"newsByIdMustache": { | ||
"id": 2 | ||
} | ||
} | ||
} | ||
} |
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,17 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"newsByIdMustacheAndJson": { | ||
"id": 2 | ||
} | ||
} | ||
} | ||
} |
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,58 @@ | ||
--- | ||
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 | ||
|
||
scalar JSON | ||
|
||
type News { | ||
body: String | ||
id: Int | ||
postImage: String | ||
title: String | ||
} | ||
|
||
input NewsInput { | ||
id: Int | ||
} | ||
|
||
scalar PhoneNumber | ||
|
||
type Query { | ||
newsById: News! | ||
newsByIdMustache(news: NewsInput!): News! | ||
newsByIdMustacheAndJson(news: NewsInput!): News! | ||
} | ||
|
||
scalar UInt128 | ||
|
||
scalar UInt16 | ||
|
||
scalar UInt32 | ||
|
||
scalar UInt64 | ||
|
||
scalar UInt8 | ||
|
||
scalar Url | ||
|
||
schema { | ||
query: Query | ||
} |
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/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema | ||
@server(port: 8000) | ||
@upstream(baseURL: "http://localhost:50051") | ||
@link(id: "news", src: "news.proto", type: Protobuf) { | ||
query: Query | ||
} | ||
|
||
input NewsInput { | ||
id: Int | ||
} | ||
|
||
type News { | ||
body: String | ||
id: Int | ||
postImage: String | ||
title: String | ||
} | ||
|
||
type Query { | ||
newsById: News! @grpc(body: {id: 2}, method: "news.NewsService.GetNews") | ||
newsByIdMustache(news: NewsInput!): News! @grpc(body: "{{.args.news}}", method: "news.NewsService.GetNews") | ||
newsByIdMustacheAndJson(news: NewsInput!): News! | ||
@grpc(body: {id: "{{.args.news.id}}"}, method: "news.NewsService.GetNews") | ||
} |
Oops, something went wrong.
afde464
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
407739 requests in 30.00s, 2.04GB read
Requests/sec: 13589.39
Transfer/sec: 69.75MB