Skip to content

Commit

Permalink
supports creating enum value as a gRPC Federation's variable (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy authored Jan 20, 2025
1 parent aaa31df commit a69b281
Show file tree
Hide file tree
Showing 45 changed files with 8,924 additions and 6,271 deletions.
471 changes: 244 additions & 227 deletions _examples/02_simple/federation/federation.pb.go

Large diffs are not rendered by default.

138 changes: 95 additions & 43 deletions _examples/02_simple/federation/federation_grpc_federation.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _examples/02_simple/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ func TestFederation(t *testing.T) {
StringsJoin: "1.2",
ParseFloat: 1.2,
UrlUserName: "test_user",
EnumValue: federation.Item_ITEM_TYPE_2,
}, cmpopts.IgnoreUnexported(
federation.GetPostResponse{},
federation.Post{},
Expand Down
2 changes: 2 additions & 0 deletions _examples/02_simple/proto/federation/federation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ message GetPostResponse {
def { name: "map_value" by : "{1: 'a', 2: 'b', 3: 'c'}" }
def { name: "null_value" by: "null" }
def { by: "grpc.federation.log.info('output federation log', {'post_message': post})" }
def { name: "e" enum {name: "Item.ItemType" by: "user.Item.ItemType.value('ITEM_TYPE_2')"}}
};
Post post = 1 [(grpc.federation.field).by = "post"];
string str = 2 [(grpc.federation.field).by = "'hello'"];
Expand Down Expand Up @@ -82,6 +83,7 @@ message GetPostResponse {
string strings_join = 32 [(grpc.federation.field).by = "strings_join"];
double parse_float = 33 [(grpc.federation.field).by = "parse_float"];
string url_user_name = 34 [(grpc.federation.field).by = "url.userinfo().username()"];
Item.ItemType enum_value = 35 [(grpc.federation.field).by = "e"];
}

message A {
Expand Down
Loading

0 comments on commit a69b281

Please sign in to comment.