-
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(grpc): config generation for optional fields (#2042)
- Loading branch information
Showing
9 changed files
with
121 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
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
36 changes: 36 additions & 0 deletions
36
...ore/generator/snapshots/tailcall__core__generator__from_proto__test__optional_fields.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: src/core/generator/from_proto.rs | ||
expression: config | ||
--- | ||
schema @server @upstream { | ||
query: Query | ||
} | ||
|
||
input type__Type @tag(id: "type.Type") { | ||
id: Int | ||
idOpt: Int | ||
nested: type__Type__Nested | ||
nestedOpt: type__Type__Nested | ||
nestedRep: [type__Type__Nested] | ||
num: [Float] | ||
str: String | ||
strOpt: String | ||
} | ||
|
||
input type__Type__Nested @tag(id: "type.Type.Nested") { | ||
id: Int | ||
idOpt: Int | ||
num: [Float] | ||
str: String | ||
strOpt: String | ||
} | ||
|
||
enum type__Status { | ||
FIRST | ||
SECOND | ||
UNSPECIFIED | ||
} | ||
|
||
type Query { | ||
type__TypeService__Get(type: type__Type!): type__Type! @grpc(body: "{{.args.type}}", method: "type.TypeService.Get") | ||
} |
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,32 @@ | ||
syntax = "proto3"; | ||
|
||
package type; | ||
|
||
enum Status { | ||
UNSPECIFIED = 0; | ||
FIRST = 1; | ||
SECOND = 2; | ||
} | ||
|
||
message Type { | ||
message Nested { | ||
int32 id = 1; | ||
string str = 2; | ||
optional int32 id_opt = 3; | ||
optional string str_opt = 4; | ||
repeated float num = 5; | ||
} | ||
|
||
int32 id = 1; | ||
string str = 2; | ||
optional int32 id_opt = 3; | ||
optional string str_opt = 4; | ||
repeated float num = 5; | ||
Nested nested = 50; | ||
optional Nested nested_opt = 51; | ||
repeated Nested nested_rep = 52; | ||
} | ||
|
||
service TypeService { | ||
rpc Get(Type) returns (Type) {} | ||
} |
0f27a09
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
453166 requests in 30.01s, 2.27GB read
Requests/sec: 15101.19
Transfer/sec: 77.51MB