diff --git a/Gopkg.lock b/Gopkg.lock index e238a5e..4176035 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -25,6 +25,14 @@ pruneopts = "" revision = "de5bf2ad457846296e2031421a34e2568e304e35" +[[projects]] + digest = "1:d8a2bb36a048d1571bcc1aee208b61f39dc16c6c53823feffd37449dde162507" + name = "github.com/asaskevich/govalidator" + packages = ["."] + pruneopts = "" + revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" + version = "v9" + [[projects]] digest = "1:0deddd908b6b4b768cfc272c16ee61e7088a60f7fe2f06c547bd3d8e1f8b8e77" name = "github.com/davecgh/go-spew" @@ -41,6 +49,36 @@ revision = "6a34d38c8fe27a73b3adb076ab02f9614e70fff0" version = "v1.6.8" +[[projects]] + branch = "master" + digest = "1:e9ffb9315dce0051beb757d0f0fc25db57c4da654efc4eada4ea109c2d9da815" + name = "github.com/globalsign/mgo" + packages = [ + "bson", + "internal/json", + ] + pruneopts = "" + revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" + +[[projects]] + digest = "1:48f9a43c330434d61098a65bdf4d8cbfbdc0eecf30ab35b1b88405868df6a42b" + name = "github.com/go-openapi/analysis" + packages = [ + ".", + "internal", + ] + pruneopts = "" + revision = "e2f3fdbb7ed0e56e070ccbfb6fc75b288a33c014" + version = "v0.18.0" + +[[projects]] + digest = "1:90d75a4ad18e82be220162df5f551537c917ef2c0bfa4f04b3bde61130b6286a" + name = "github.com/go-openapi/errors" + packages = ["."] + pruneopts = "" + revision = "7a7ff1b7b8020f22574411a32f28b4d168d69237" + version = "v0.18.0" + [[projects]] digest = "1:c8052dcf3ec378a9a6bc4f00ecc10d6d5eb3cc1f8faaf6b2f70f047e8881d446" name = "github.com/go-openapi/jsonpointer" @@ -57,6 +95,31 @@ revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3" version = "v0.18.0" +[[projects]] + digest = "1:e6529722d1b6bb2e80126d20a03bc05ab4409ace3f006cfa8717c74a8b5ad075" + name = "github.com/go-openapi/loads" + packages = ["."] + pruneopts = "" + revision = "74628589c3b94e3526a842d24f46589980f5ab22" + version = "v0.18.0" + +[[projects]] + digest = "1:708923386755f46d63d254e484c77c70ceb1706bf3cb58a45426b3e1469376a1" + name = "github.com/go-openapi/runtime" + packages = [ + ".", + "client", + "logger", + "middleware", + "middleware/denco", + "middleware/header", + "middleware/untyped", + "security", + ] + pruneopts = "" + revision = "41e24cc66d7af6af39eb9b5a6418e901bcdd333c" + version = "v0.18.0" + [[projects]] digest = "1:54af405aae840f810418f3d25211012af1c4bfd56d07d3de6482a7a3b762528a" name = "github.com/go-openapi/spec" @@ -65,6 +128,14 @@ revision = "5b6cdde3200976e3ecceb2868706ee39b6aff3e4" version = "v0.18.0" +[[projects]] + digest = "1:8673b4ec9f67eda2cdf08386179ab0bc232b9bda4671c585aa71ed684d3d48fb" + name = "github.com/go-openapi/strfmt" + packages = ["."] + pruneopts = "" + revision = "e471370ae57ac74eaf0afe816a66e4ddd7f1b027" + version = "v0.18.0" + [[projects]] digest = "1:417789264f7cc44cbb3431ac997473e085018b01bdd98df57e6039981428aca4" name = "github.com/go-openapi/swag" @@ -73,6 +144,14 @@ revision = "1d29f06aebd59ccdf11ae04aa0334ded96e2d909" version = "v0.18.0" +[[projects]] + digest = "1:3e3802ad256a6bc362935373649a355abe1d1e419bb920f65507abfac3675ae4" + name = "github.com/go-openapi/validate" + packages = ["."] + pruneopts = "" + revision = "d2eab7d93009e9215fc85b2faa2c2f2a98c2af48" + version = "v0.18.0" + [[projects]] digest = "1:530233672f656641b365f8efb38ed9fba80e420baff2ce87633813ab3755ed6d" name = "github.com/golang/mock" @@ -364,7 +443,11 @@ "github.com/EGT-Ukraine/dataloaden/pkg/generator", "github.com/davecgh/go-spew/spew", "github.com/emicklei/proto", + "github.com/go-openapi/errors", + "github.com/go-openapi/runtime", + "github.com/go-openapi/runtime/client", "github.com/go-openapi/spec", + "github.com/go-openapi/strfmt", "github.com/go-openapi/swag", "github.com/golang/mock/gomock", "github.com/golang/protobuf/proto", diff --git a/example/main.go b/example/main.go index 7a9a6f6..d0599ca 100644 --- a/example/main.go +++ b/example/main.go @@ -45,6 +45,10 @@ func (Client) GetEmptiesMsg(ctx context.Context, in *example.Empty, opts ...grpc return &example.Empty{}, nil } +func (Client) ListSomeEntities(ctx context.Context, in *example.ListSomeEntitiesRequest, opts ...grpc.CallOption) (*example.ListSomeEntitiesResponse, error) { + return &example.ListSomeEntitiesResponse{}, nil +} + func main() { schem, err := schema.GetExampleSchemaSchema(schema.ExampleSchemaSchemaClients{ ServiceExampleClient: Client{}, diff --git a/example/proto/example.pb.go b/example/proto/example.pb.go index 5007475..4708c8d 100644 --- a/example/proto/example.pb.go +++ b/example/proto/example.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: proto/example.proto -package example +package proto import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -44,7 +44,7 @@ func (x SomeEnum) String() string { return proto.EnumName(SomeEnum_name, int32(x)) } func (SomeEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{0} + return fileDescriptor_example_d5b2843992209486, []int{0} } type ASomeEnum3 int32 @@ -67,7 +67,7 @@ func (x ASomeEnum3) String() string { return proto.EnumName(ASomeEnum3_name, int32(x)) } func (ASomeEnum3) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{2, 0} + return fileDescriptor_example_d5b2843992209486, []int{2, 0} } type ListSomeEntitiesRequest struct { @@ -81,7 +81,7 @@ func (m *ListSomeEntitiesRequest) Reset() { *m = ListSomeEntitiesRequest func (m *ListSomeEntitiesRequest) String() string { return proto.CompactTextString(m) } func (*ListSomeEntitiesRequest) ProtoMessage() {} func (*ListSomeEntitiesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{0} + return fileDescriptor_example_d5b2843992209486, []int{0} } func (m *ListSomeEntitiesRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListSomeEntitiesRequest.Unmarshal(m, b) @@ -120,7 +120,7 @@ func (m *ListSomeEntitiesRequest_Filter) Reset() { *m = ListSomeEntities func (m *ListSomeEntitiesRequest_Filter) String() string { return proto.CompactTextString(m) } func (*ListSomeEntitiesRequest_Filter) ProtoMessage() {} func (*ListSomeEntitiesRequest_Filter) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{0, 0} + return fileDescriptor_example_d5b2843992209486, []int{0, 0} } func (m *ListSomeEntitiesRequest_Filter) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListSomeEntitiesRequest_Filter.Unmarshal(m, b) @@ -165,7 +165,7 @@ func (m *ListSomeEntitiesResponse) Reset() { *m = ListSomeEntitiesRespon func (m *ListSomeEntitiesResponse) String() string { return proto.CompactTextString(m) } func (*ListSomeEntitiesResponse) ProtoMessage() {} func (*ListSomeEntitiesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{1} + return fileDescriptor_example_d5b2843992209486, []int{1} } func (m *ListSomeEntitiesResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListSomeEntitiesResponse.Unmarshal(m, b) @@ -205,7 +205,7 @@ func (m *ListSomeEntitiesResponse_SomeEntity) Reset() { *m = ListSomeEnt func (m *ListSomeEntitiesResponse_SomeEntity) String() string { return proto.CompactTextString(m) } func (*ListSomeEntitiesResponse_SomeEntity) ProtoMessage() {} func (*ListSomeEntitiesResponse_SomeEntity) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{1, 0} + return fileDescriptor_example_d5b2843992209486, []int{1, 0} } func (m *ListSomeEntitiesResponse_SomeEntity) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListSomeEntitiesResponse_SomeEntity.Unmarshal(m, b) @@ -247,17 +247,17 @@ func (m *ListSomeEntitiesResponse_SomeEntity) GetAId() string { } type A struct { - MapEnum map[int32]SomeEnum `protobuf:"bytes,1,rep,name=map_enum,json=mapEnum,proto3" json:"map_enum,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=example.SomeEnum"` + MapEnum map[int32]SomeEnum `protobuf:"bytes,1,rep,name=map_enum,json=mapEnum,proto3" json:"map_enum,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=proto.SomeEnum"` MapScalar map[int32]int32 `protobuf:"bytes,2,rep,name=map_scalar,json=mapScalar,proto3" json:"map_scalar,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` MapMsg map[int32]*timestamp.Timestamp `protobuf:"bytes,3,rep,name=map_msg,json=mapMsg,proto3" json:"map_msg,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` RMsg []*timestamp.Timestamp `protobuf:"bytes,4,rep,name=r_msg,json=rMsg,proto3" json:"r_msg,omitempty"` RScalar []int32 `protobuf:"varint,5,rep,packed,name=r_scalar,json=rScalar,proto3" json:"r_scalar,omitempty"` - REnum []SomeEnum `protobuf:"varint,6,rep,packed,name=r_enum,json=rEnum,proto3,enum=example.SomeEnum" json:"r_enum,omitempty"` - NREnum ASomeEnum3 `protobuf:"varint,7,opt,name=n_r_enum,json=nREnum,proto3,enum=example.ASomeEnum3" json:"n_r_enum,omitempty"` + REnum []SomeEnum `protobuf:"varint,6,rep,packed,name=r_enum,json=rEnum,proto3,enum=proto.SomeEnum" json:"r_enum,omitempty"` + NREnum ASomeEnum3 `protobuf:"varint,7,opt,name=n_r_enum,json=nREnum,proto3,enum=proto.ASomeEnum3" json:"n_r_enum,omitempty"` NRScalar int32 `protobuf:"varint,8,opt,name=n_r_scalar,json=nRScalar,proto3" json:"n_r_scalar,omitempty"` NRMsg *timestamp.Timestamp `protobuf:"bytes,9,opt,name=n_r_msg,json=nRMsg,proto3" json:"n_r_msg,omitempty"` ScalarFromContext int32 `protobuf:"varint,10,opt,name=scalar_from_context,json=scalarFromContext,proto3" json:"scalar_from_context,omitempty"` - EnumFromContext SomeEnum `protobuf:"varint,11,opt,name=enum_from_context,json=enumFromContext,proto3,enum=example.SomeEnum" json:"enum_from_context,omitempty"` + EnumFromContext SomeEnum `protobuf:"varint,11,opt,name=enum_from_context,json=enumFromContext,proto3,enum=proto.SomeEnum" json:"enum_from_context,omitempty"` MessageFromContext *timestamp.Timestamp `protobuf:"bytes,12,opt,name=message_from_context,json=messageFromContext,proto3" json:"message_from_context,omitempty"` // repeated bytes r_bytes = 13; // TODO // bytes n_r_bytes = 14; // TODO @@ -275,7 +275,7 @@ func (m *A) Reset() { *m = A{} } func (m *A) String() string { return proto.CompactTextString(m) } func (*A) ProtoMessage() {} func (*A) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{2} + return fileDescriptor_example_d5b2843992209486, []int{2} } func (m *A) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_A.Unmarshal(m, b) @@ -439,7 +439,7 @@ func (m *AOneOffs) Reset() { *m = AOneOffs{} } func (m *AOneOffs) String() string { return proto.CompactTextString(m) } func (*AOneOffs) ProtoMessage() {} func (*AOneOffs) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{3} + return fileDescriptor_example_d5b2843992209486, []int{3} } func (m *AOneOffs) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AOneOffs.Unmarshal(m, b) @@ -470,7 +470,7 @@ type isAOneOffs_FirstMessage interface { } type AOneOffs_ENREnum struct { - ENREnum SomeEnum `protobuf:"varint,7,opt,name=e_n_r_enum,json=eNREnum,proto3,enum=example.SomeEnum,oneof"` + ENREnum SomeEnum `protobuf:"varint,7,opt,name=e_n_r_enum,json=eNREnum,proto3,enum=proto.SomeEnum,oneof"` } type AOneOffs_ENRScalar struct { ENRScalar int32 `protobuf:"varint,8,opt,name=e_n_r_scalar,json=eNRScalar,proto3,oneof"` @@ -482,7 +482,7 @@ type AOneOffs_SNRScalar struct { SNRScalar int32 `protobuf:"varint,10,opt,name=s_n_r_scalar,json=sNRScalar,proto3,oneof"` } type AOneOffs_SNREnum struct { - SNREnum SomeEnum `protobuf:"varint,11,opt,name=s_n_r_enum,json=sNREnum,proto3,enum=example.SomeEnum,oneof"` + SNREnum SomeEnum `protobuf:"varint,11,opt,name=s_n_r_enum,json=sNREnum,proto3,enum=proto.SomeEnum,oneof"` } type AOneOffs_SNRMsg struct { SNRMsg *timestamp.Timestamp `protobuf:"bytes,12,opt,name=s_n_r_msg,json=sNRMsg,proto3,oneof"` @@ -494,7 +494,7 @@ type AOneOffs_MNRScalar struct { MNRScalar int32 `protobuf:"varint,14,opt,name=m_n_r_scalar,json=mNRScalar,proto3,oneof"` } type AOneOffs_MNREnum struct { - MNREnum SomeEnum `protobuf:"varint,15,opt,name=m_n_r_enum,json=mNREnum,proto3,enum=example.SomeEnum,oneof"` + MNREnum SomeEnum `protobuf:"varint,15,opt,name=m_n_r_enum,json=mNREnum,proto3,enum=proto.SomeEnum,oneof"` } func (*AOneOffs_ENREnum) isAOneOffs_FirstEnum() {} @@ -801,7 +801,7 @@ func (m *MsgWithEmpty) Reset() { *m = MsgWithEmpty{} } func (m *MsgWithEmpty) String() string { return proto.CompactTextString(m) } func (*MsgWithEmpty) ProtoMessage() {} func (*MsgWithEmpty) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{4} + return fileDescriptor_example_d5b2843992209486, []int{4} } func (m *MsgWithEmpty) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgWithEmpty.Unmarshal(m, b) @@ -838,7 +838,7 @@ func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{5} + return fileDescriptor_example_d5b2843992209486, []int{5} } func (m *Empty) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Empty.Unmarshal(m, b) @@ -859,13 +859,13 @@ func (m *Empty) XXX_DiscardUnknown() { var xxx_messageInfo_Empty proto.InternalMessageInfo type B struct { - MapEnum map[int32]SomeEnum `protobuf:"bytes,1,rep,name=map_enum,json=mapEnum,proto3" json:"map_enum,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=example.SomeEnum"` + MapEnum map[int32]SomeEnum `protobuf:"bytes,1,rep,name=map_enum,json=mapEnum,proto3" json:"map_enum,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=proto.SomeEnum"` MapScalar map[int32]int32 `protobuf:"bytes,2,rep,name=map_scalar,json=mapScalar,proto3" json:"map_scalar,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` MapMsg map[int32]*timestamp.Timestamp `protobuf:"bytes,3,rep,name=map_msg,json=mapMsg,proto3" json:"map_msg,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` RMsg []*timestamp.Timestamp `protobuf:"bytes,4,rep,name=r_msg,json=rMsg,proto3" json:"r_msg,omitempty"` RScalar []int32 `protobuf:"varint,5,rep,packed,name=r_scalar,json=rScalar,proto3" json:"r_scalar,omitempty"` - REnum []SomeEnum `protobuf:"varint,6,rep,packed,name=r_enum,json=rEnum,proto3,enum=example.SomeEnum" json:"r_enum,omitempty"` - NREnum SomeEnum `protobuf:"varint,7,opt,name=n_r_enum,json=nREnum,proto3,enum=example.SomeEnum" json:"n_r_enum,omitempty"` + REnum []SomeEnum `protobuf:"varint,6,rep,packed,name=r_enum,json=rEnum,proto3,enum=proto.SomeEnum" json:"r_enum,omitempty"` + NREnum SomeEnum `protobuf:"varint,7,opt,name=n_r_enum,json=nREnum,proto3,enum=proto.SomeEnum" json:"n_r_enum,omitempty"` NRScalar int32 `protobuf:"varint,8,opt,name=n_r_scalar,json=nRScalar,proto3" json:"n_r_scalar,omitempty"` NRMsg *timestamp.Timestamp `protobuf:"bytes,9,opt,name=n_r_msg,json=nRMsg,proto3" json:"n_r_msg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -877,7 +877,7 @@ func (m *B) Reset() { *m = B{} } func (m *B) String() string { return proto.CompactTextString(m) } func (*B) ProtoMessage() {} func (*B) Descriptor() ([]byte, []int) { - return fileDescriptor_example_b81780ae5ead9159, []int{6} + return fileDescriptor_example_d5b2843992209486, []int{6} } func (m *B) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_B.Unmarshal(m, b) @@ -961,23 +961,23 @@ func (m *B) GetNRMsg() *timestamp.Timestamp { } func init() { - proto.RegisterType((*ListSomeEntitiesRequest)(nil), "example.ListSomeEntitiesRequest") - proto.RegisterType((*ListSomeEntitiesRequest_Filter)(nil), "example.ListSomeEntitiesRequest.Filter") - proto.RegisterType((*ListSomeEntitiesResponse)(nil), "example.ListSomeEntitiesResponse") - proto.RegisterType((*ListSomeEntitiesResponse_SomeEntity)(nil), "example.ListSomeEntitiesResponse.SomeEntity") - proto.RegisterType((*A)(nil), "example.A") - proto.RegisterMapType((map[int32]SomeEnum)(nil), "example.A.MapEnumEntry") - proto.RegisterMapType((map[int32]*timestamp.Timestamp)(nil), "example.A.MapMsgEntry") - proto.RegisterMapType((map[int32]int32)(nil), "example.A.MapScalarEntry") - proto.RegisterType((*AOneOffs)(nil), "example.AOneOffs") - proto.RegisterType((*MsgWithEmpty)(nil), "example.MsgWithEmpty") - proto.RegisterType((*Empty)(nil), "example.Empty") - proto.RegisterType((*B)(nil), "example.B") - proto.RegisterMapType((map[int32]SomeEnum)(nil), "example.B.MapEnumEntry") - proto.RegisterMapType((map[int32]*timestamp.Timestamp)(nil), "example.B.MapMsgEntry") - proto.RegisterMapType((map[int32]int32)(nil), "example.B.MapScalarEntry") - proto.RegisterEnum("example.SomeEnum", SomeEnum_name, SomeEnum_value) - proto.RegisterEnum("example.ASomeEnum3", ASomeEnum3_name, ASomeEnum3_value) + proto.RegisterType((*ListSomeEntitiesRequest)(nil), "proto.ListSomeEntitiesRequest") + proto.RegisterType((*ListSomeEntitiesRequest_Filter)(nil), "proto.ListSomeEntitiesRequest.Filter") + proto.RegisterType((*ListSomeEntitiesResponse)(nil), "proto.ListSomeEntitiesResponse") + proto.RegisterType((*ListSomeEntitiesResponse_SomeEntity)(nil), "proto.ListSomeEntitiesResponse.SomeEntity") + proto.RegisterType((*A)(nil), "proto.A") + proto.RegisterMapType((map[int32]SomeEnum)(nil), "proto.A.MapEnumEntry") + proto.RegisterMapType((map[int32]*timestamp.Timestamp)(nil), "proto.A.MapMsgEntry") + proto.RegisterMapType((map[int32]int32)(nil), "proto.A.MapScalarEntry") + proto.RegisterType((*AOneOffs)(nil), "proto.AOneOffs") + proto.RegisterType((*MsgWithEmpty)(nil), "proto.MsgWithEmpty") + proto.RegisterType((*Empty)(nil), "proto.Empty") + proto.RegisterType((*B)(nil), "proto.B") + proto.RegisterMapType((map[int32]SomeEnum)(nil), "proto.B.MapEnumEntry") + proto.RegisterMapType((map[int32]*timestamp.Timestamp)(nil), "proto.B.MapMsgEntry") + proto.RegisterMapType((map[int32]int32)(nil), "proto.B.MapScalarEntry") + proto.RegisterEnum("proto.SomeEnum", SomeEnum_name, SomeEnum_value) + proto.RegisterEnum("proto.ASomeEnum3", ASomeEnum3_name, ASomeEnum3_value) } // Reference imports to suppress errors if they are not otherwise used. @@ -1010,7 +1010,7 @@ func NewServiceExampleClient(cc *grpc.ClientConn) ServiceExampleClient { func (c *serviceExampleClient) GetQueryMethod(ctx context.Context, in *AOneOffs, opts ...grpc.CallOption) (*B, error) { out := new(B) - err := c.cc.Invoke(ctx, "/example.ServiceExample/getQueryMethod", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/getQueryMethod", in, out, opts...) if err != nil { return nil, err } @@ -1019,7 +1019,7 @@ func (c *serviceExampleClient) GetQueryMethod(ctx context.Context, in *AOneOffs, func (c *serviceExampleClient) MutationMethod(ctx context.Context, in *B, opts ...grpc.CallOption) (*A, error) { out := new(A) - err := c.cc.Invoke(ctx, "/example.ServiceExample/mutationMethod", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/mutationMethod", in, out, opts...) if err != nil { return nil, err } @@ -1028,7 +1028,7 @@ func (c *serviceExampleClient) MutationMethod(ctx context.Context, in *B, opts . func (c *serviceExampleClient) QueryMethod(ctx context.Context, in *timestamp.Timestamp, opts ...grpc.CallOption) (*timestamp.Timestamp, error) { out := new(timestamp.Timestamp) - err := c.cc.Invoke(ctx, "/example.ServiceExample/queryMethod", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/queryMethod", in, out, opts...) if err != nil { return nil, err } @@ -1037,7 +1037,7 @@ func (c *serviceExampleClient) QueryMethod(ctx context.Context, in *timestamp.Ti func (c *serviceExampleClient) GetMutatuionMethod(ctx context.Context, in *MsgWithEmpty, opts ...grpc.CallOption) (*MsgWithEmpty, error) { out := new(MsgWithEmpty) - err := c.cc.Invoke(ctx, "/example.ServiceExample/getMutatuionMethod", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/getMutatuionMethod", in, out, opts...) if err != nil { return nil, err } @@ -1046,7 +1046,7 @@ func (c *serviceExampleClient) GetMutatuionMethod(ctx context.Context, in *MsgWi func (c *serviceExampleClient) GetEmptiesMsg(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) - err := c.cc.Invoke(ctx, "/example.ServiceExample/getEmptiesMsg", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/getEmptiesMsg", in, out, opts...) if err != nil { return nil, err } @@ -1055,7 +1055,7 @@ func (c *serviceExampleClient) GetEmptiesMsg(ctx context.Context, in *Empty, opt func (c *serviceExampleClient) ListSomeEntities(ctx context.Context, in *ListSomeEntitiesRequest, opts ...grpc.CallOption) (*ListSomeEntitiesResponse, error) { out := new(ListSomeEntitiesResponse) - err := c.cc.Invoke(ctx, "/example.ServiceExample/ListSomeEntities", in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.ServiceExample/ListSomeEntities", in, out, opts...) if err != nil { return nil, err } @@ -1086,7 +1086,7 @@ func _ServiceExample_GetQueryMethod_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/GetQueryMethod", + FullMethod: "/proto.ServiceExample/GetQueryMethod", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).GetQueryMethod(ctx, req.(*AOneOffs)) @@ -1104,7 +1104,7 @@ func _ServiceExample_MutationMethod_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/MutationMethod", + FullMethod: "/proto.ServiceExample/MutationMethod", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).MutationMethod(ctx, req.(*B)) @@ -1122,7 +1122,7 @@ func _ServiceExample_QueryMethod_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/QueryMethod", + FullMethod: "/proto.ServiceExample/QueryMethod", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).QueryMethod(ctx, req.(*timestamp.Timestamp)) @@ -1140,7 +1140,7 @@ func _ServiceExample_GetMutatuionMethod_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/GetMutatuionMethod", + FullMethod: "/proto.ServiceExample/GetMutatuionMethod", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).GetMutatuionMethod(ctx, req.(*MsgWithEmpty)) @@ -1158,7 +1158,7 @@ func _ServiceExample_GetEmptiesMsg_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/GetEmptiesMsg", + FullMethod: "/proto.ServiceExample/GetEmptiesMsg", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).GetEmptiesMsg(ctx, req.(*Empty)) @@ -1176,7 +1176,7 @@ func _ServiceExample_ListSomeEntities_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/example.ServiceExample/ListSomeEntities", + FullMethod: "/proto.ServiceExample/ListSomeEntities", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ServiceExampleServer).ListSomeEntities(ctx, req.(*ListSomeEntitiesRequest)) @@ -1185,7 +1185,7 @@ func _ServiceExample_ListSomeEntities_Handler(srv interface{}, ctx context.Conte } var _ServiceExample_serviceDesc = grpc.ServiceDesc{ - ServiceName: "example.ServiceExample", + ServiceName: "proto.ServiceExample", HandlerType: (*ServiceExampleServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1217,73 +1217,73 @@ var _ServiceExample_serviceDesc = grpc.ServiceDesc{ Metadata: "proto/example.proto", } -func init() { proto.RegisterFile("proto/example.proto", fileDescriptor_example_b81780ae5ead9159) } - -var fileDescriptor_example_b81780ae5ead9159 = []byte{ - // 1026 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x51, 0x6f, 0xe3, 0x44, - 0x10, 0xae, 0x93, 0xd8, 0xb1, 0x27, 0xa9, 0x9b, 0xec, 0x15, 0xce, 0x67, 0x21, 0x2e, 0x8d, 0x10, - 0x17, 0x01, 0x72, 0x4a, 0x4e, 0xd0, 0x13, 0x02, 0x9d, 0x9a, 0x2a, 0x55, 0x4e, 0xba, 0xb4, 0x62, - 0x0b, 0xdc, 0xa3, 0xe5, 0x6b, 0x36, 0xa9, 0x45, 0xd6, 0xce, 0x79, 0x37, 0xc7, 0xe5, 0x8d, 0x77, - 0x1e, 0xf9, 0x15, 0xfc, 0x2b, 0xfe, 0x07, 0x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30, 0xb1, 0xd1, 0xb7, 0xcc, 0xec, 0xde, 0x8a, 0xd1, - 0x2b, 0x68, 0xdc, 0xfe, 0x00, 0x45, 0xad, 0x5d, 0x1f, 0xcb, 0xee, 0xd1, 0xce, 0xaf, 0xd7, 0xd7, - 0x86, 0x54, 0xf8, 0xf4, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0x28, 0x28, 0x71, 0xe5, 0x0b, - 0x00, 0x00, +func init() { proto.RegisterFile("proto/example.proto", fileDescriptor_example_d5b2843992209486) } + +var fileDescriptor_example_d5b2843992209486 = []byte{ + // 1028 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0x5d, 0x6e, 0xdb, 0x46, + 0x10, 0x36, 0x25, 0x51, 0x22, 0x47, 0xb2, 0x2c, 0xaf, 0x53, 0x84, 0x25, 0x8a, 0x58, 0x11, 0x9a, + 0x40, 0x4d, 0x1a, 0x3a, 0x55, 0xd0, 0xb8, 0x68, 0x9b, 0x02, 0x56, 0x20, 0x43, 0x41, 0x23, 0x1b, + 0x5d, 0xf7, 0xe7, 0x91, 0x60, 0xac, 0x95, 0x4c, 0x54, 0x4b, 0x2a, 0xdc, 0x55, 0x1a, 0x3d, 0xf7, + 0xa9, 0x27, 0xe9, 0x9d, 0x7a, 0x86, 0x02, 0xbd, 0x42, 0xb1, 0xb3, 0x24, 0x4d, 0xd9, 0x8a, 0x55, + 0x04, 0x28, 0x50, 0xf4, 0xc9, 0x3b, 0x33, 0xdf, 0x37, 0x3b, 0x23, 0xcf, 0xc7, 0x59, 0xd8, 0x9b, + 0x27, 0xb1, 0x8c, 0x0f, 0xd8, 0xdb, 0x80, 0xcf, 0x67, 0xcc, 0x43, 0x8b, 0x98, 0xf8, 0xc7, 0xdd, + 0x9f, 0xc6, 0xf1, 0x74, 0xc6, 0x0e, 0xd0, 0x7a, 0xb5, 0x98, 0x1c, 0xc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, 0x02, 0x28, 0x86, 0x38, 0x0f, 0x66, 0x41, 0x82, 0xbf, 0x46, 0xbd, 0x77, 0xbb, + 0xc8, 0x39, 0xc3, 0x88, 0x66, 0xd9, 0x3c, 0xb3, 0xc9, 0x23, 0x50, 0x29, 0x7c, 0x2e, 0xa6, 0x4e, + 0x19, 0x49, 0xb7, 0x8a, 0xa4, 0x91, 0x98, 0x6a, 0x46, 0x95, 0xa3, 0x41, 0x0e, 0xc0, 0x4c, 0x10, + 0x5c, 0x41, 0xb0, 0xeb, 0xe9, 0x29, 0xf0, 0xb2, 0x29, 0xf0, 0xbe, 0xcf, 0xa6, 0x80, 0x56, 0x12, + 0x45, 0xf8, 0x10, 0xac, 0x24, 0xab, 0xca, 0x6c, 0x97, 0xbb, 0x26, 0xad, 0x25, 0xe9, 0xd5, 0xf7, + 0xa1, 0x9a, 0xe8, 0x16, 0xab, 0xed, 0x72, 0xb7, 0xd9, 0xdb, 0x49, 0x6f, 0x16, 0xf8, 0x23, 0x2e, + 0x38, 0x35, 0x13, 0x6c, 0xed, 0x53, 0xb0, 0x22, 0x3f, 0x45, 0xd6, 0xda, 0x46, 0xb7, 0xd9, 0x23, + 0x79, 0x8d, 0x19, 0xf6, 0x09, 0xad, 0x46, 0x14, 0xd1, 0x1f, 0x01, 0x28, 0x74, 0x7a, 0xa5, 0xd5, + 0x36, 0xba, 0x26, 0xb5, 0x22, 0x9a, 0xde, 0xd9, 0x83, 0x9a, 0x8a, 0xaa, 0x0e, 0x6c, 0x9c, 0xbc, + 0x9b, 0x3a, 0x30, 0x23, 0xaa, 0x5a, 0xf0, 0x60, 0x4f, 0x67, 0xf3, 0x27, 0x49, 0xcc, 0xfd, 0xf3, + 0x38, 0x92, 0xec, 0xad, 0x74, 0x00, 0x53, 0xef, 0xea, 0xd0, 0x71, 0x12, 0xf3, 0xe7, 0x3a, 0x40, + 0xbe, 0x82, 0x5d, 0x55, 0xeb, 0x2a, 0xba, 0x8e, 0x85, 0x5f, 0x6b, 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0xff, 0x86, 0x55, 0xd1, 0x7f, 0x8f, 0x55, 0xd1, 0x7f, + 0x9f, 0x55, 0xd1, 0xff, 0xcf, 0xac, 0x8a, 0x4f, 0xae, 0xad, 0x8a, 0x6b, 0xc8, 0x7f, 0x6d, 0x4f, + 0xfc, 0xff, 0xbf, 0x5b, 0x0f, 0xee, 0x80, 0x95, 0xd5, 0x9a, 0x7e, 0xac, 0x3e, 0xcb, 0x3f, 0x5b, + 0xbd, 0x96, 0xd1, 0xfb, 0xb3, 0x04, 0xcd, 0x33, 0x96, 0xbc, 0x09, 0xcf, 0xd9, 0x40, 0xbf, 0x19, + 0xc9, 0x43, 0x68, 0x4e, 0x99, 0xfc, 0x6e, 0xc1, 0x92, 0xe5, 0x88, 0xc9, 0x8b, 0x78, 0x4c, 0xae, + 0x6e, 0x1d, 0xd7, 0xca, 0xc6, 0x48, 0xed, 0x0b, 0xbe, 0x90, 0x81, 0x0c, 0xe3, 0x28, 0x05, 0xe7, + 0xb1, 0x1c, 0x75, 0x44, 0x06, 0x50, 0x7f, 0x5d, 0xc8, 0x77, 0x43, 0xed, 0xee, 0x0d, 0x31, 0xf2, + 0x0d, 0x90, 0x29, 0x93, 0x23, 0x75, 0xdf, 0xe2, 0xf2, 0xc2, 0xbd, 0xf4, 0x9a, 0xa2, 0x42, 0xdd, + 0x75, 0x4e, 0xf2, 0x10, 0xb6, 0xa7, 0x4c, 0xaa, 0x73, 0xc8, 0x84, 0x9a, 0xdf, 0x15, 0xc9, 0xba, + 0x2b, 0x16, 0x39, 0x83, 0xd6, 0xd5, 0xc7, 0x24, 0xb9, 0x73, 0xf3, 0xa3, 0xd7, 0xdd, 0xdf, 0xf0, + 0x0a, 0x7d, 0x55, 0xc5, 0xf8, 0x93, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xf3, 0xae, 0x87, + 0xa7, 0x0b, 0x00, 0x00, } diff --git a/example/proto/example.proto b/example/proto/example.proto index f5bb8a3..f82b82f 100644 --- a/example/proto/example.proto +++ b/example/proto/example.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package example; +package proto; import "google/protobuf/timestamp.proto"; diff --git a/generator/plugins/dataloader/config.go b/generator/plugins/dataloader/config.go index 0008101..b8c8faa 100644 --- a/generator/plugins/dataloader/config.go +++ b/generator/plugins/dataloader/config.go @@ -9,6 +9,7 @@ type DataLoadersConfig struct { type ProviderConfig struct { Name string `mapstructure:"name"` WaitDuration time.Duration `mapstructure:"wait_duration_ms"` + Slice bool } type FieldConfig struct { diff --git a/generator/plugins/dataloader/data_loader_generator.go b/generator/plugins/dataloader/data_loader_generator.go index 5e30642..23d563b 100644 --- a/generator/plugins/dataloader/data_loader_generator.go +++ b/generator/plugins/dataloader/data_loader_generator.go @@ -57,14 +57,14 @@ func (p *LoaderGenerator) GenerateDataLoaders() error { for _, dataLoader := range p.dataLoader.Loaders { if err := p.generateLoaders(dataLoader.InputGoType, dataLoader.OutputGoType, dataLoader.Slice); err != nil { - return err + return errors.Wrapf(err, "failed to generate %s data loader", dataLoader.Config.Name) } } return nil } -func (p *LoaderGenerator) generateLoaders(requestGoType graphql.GoType, responseGoType graphql.GoType, slice bool) error { +func (p *LoaderGenerator) generateLoaders(requestGoType graphql.GoType, responseGoType graphql.GoType, slice bool) (rerr error) { keyType := requestGoType.ElemType.Kind.String() var typeName string @@ -74,6 +74,11 @@ func (p *LoaderGenerator) generateLoaders(requestGoType graphql.GoType, response } else { typeName = responseGoType.ElemType.Pkg + "." + responseGoType.ElemType.Name } + defer func() { + if v := recover(); v != nil { + rerr = fmt.Errorf("failed to generate dataloader: %v", v) + } + }() if err := generator.Generate(typeName, keyType, slice, true, p.dataLoader.OutputPath); err != nil { return errors.Wrapf(err, "Failed to generate loader for '%s'", typeName) diff --git a/generator/plugins/graphql/lib/pluginconfig/decoder.go b/generator/plugins/graphql/lib/pluginconfig/decoder.go new file mode 100644 index 0000000..f6b526e --- /dev/null +++ b/generator/plugins/graphql/lib/pluginconfig/decoder.go @@ -0,0 +1,20 @@ +package pluginconfig + +import "github.com/mitchellh/mapstructure" + +func Decode(input, output interface{}) error { + config := &mapstructure.DecoderConfig{ + DecodeHook: mapstructure.ComposeDecodeHookFunc( + mapstructure.StringToTimeDurationHookFunc(), + ), + Metadata: nil, + Result: output, + } + + decoder, err := mapstructure.NewDecoder(config) + if err != nil { + return err + } + + return decoder.Decode(input) +} diff --git a/generator/plugins/proto2gql/dataloaders.go b/generator/plugins/proto2gql/dataloaders.go index 8c4e591..0b8d790 100644 --- a/generator/plugins/proto2gql/dataloaders.go +++ b/generator/plugins/proto2gql/dataloaders.go @@ -62,6 +62,7 @@ func (g Proto2GraphQL) registerMethodDataLoader(name string, cfg DataLoaderConfi Kind: reflect.Slice, ElemType: &responseCopy, } + dataLoaderOutType = graphql.GqlListTypeResolver(dataLoaderOutType) } else { fetchCode = g.oneToOneDataLoaderFetchCode(file, cfg, method) } diff --git a/generator/plugins/proto2gql/plugin.go b/generator/plugins/proto2gql/plugin.go index 2aa8264..881fc8a 100644 --- a/generator/plugins/proto2gql/plugin.go +++ b/generator/plugins/proto2gql/plugin.go @@ -10,6 +10,7 @@ import ( "github.com/EGT-Ukraine/go2gql/generator" "github.com/EGT-Ukraine/go2gql/generator/plugins/dataloader" "github.com/EGT-Ukraine/go2gql/generator/plugins/graphql" + "github.com/EGT-Ukraine/go2gql/generator/plugins/graphql/lib/pluginconfig" ) const ( @@ -42,7 +43,7 @@ func (p *Plugin) Init(config *generator.GenerateConfig, plugins []generator.Plug return errors.New("'dataloader' plugin is not installed") } cfg := new(Config) - err := mapstructure.Decode(config.PluginsConfigs[PluginConfigKey], cfg) + err := pluginconfig.Decode(config.PluginsConfigs[PluginConfigKey], cfg) if err != nil { return errors.Wrap(err, "failed to decode config") } @@ -70,6 +71,7 @@ func (p *Plugin) parseImports() error { for _, config := range *configs { var importFileDir = filepath.Dir(pluginsConfigsImports.Path) + var protoPath = filepath.Join(importFileDir, config.ProtoPath) config.ProtoPath = protoPath diff --git a/generator/plugins/swagger2gql/services.go b/generator/plugins/swagger2gql/services.go index f90de26..4318162 100644 --- a/generator/plugins/swagger2gql/services.go +++ b/generator/plugins/swagger2gql/services.go @@ -194,6 +194,7 @@ func (p *Plugin) addDataLoaderProvider( OutputGoType: responseGoType, OutputGraphqlType: dataLoaderOutType, Config: dataLoaderProviderConfig, + Slice: dataLoaderProviderConfig.Slice, } p.dataLoaderPlugin.AddLoader(dataLoaderProvider) diff --git a/tests/dataloader/apis/category.proto b/tests/dataloader/apis/category.proto index 9b0589f..2d565fe 100644 --- a/tests/dataloader/apis/category.proto +++ b/tests/dataloader/apis/category.proto @@ -17,5 +17,6 @@ message CategoryListResponse { } message Category { - string name = 1; + uint64 id = 1; + string name = 2; } diff --git a/tests/dataloader/apis/reviews.proto b/tests/dataloader/apis/reviews.proto index 629a84b..71a9c57 100644 --- a/tests/dataloader/apis/reviews.proto +++ b/tests/dataloader/apis/reviews.proto @@ -7,22 +7,21 @@ option go_package = "github.com/EGT-Ukraine/go2gql/tests/dataloader/generated/cl import "google/protobuf/empty.proto"; service ItemsReviewService { - rpc List (ListRequest) returns (ListResponse) {} + rpc List (ListRequest) returns (ListResponse) { + } } message ListRequest { - repeated int64 item_id = 1; + repeated int64 item_id = 1; } message ListResponse { - repeated ItemReviews item_reviews = 1; + repeated Review reviews = 1; } -message ItemReviews { - repeated Review item_review = 1; -} message Review { - int64 id = 1; - string text = 2; + int64 id = 1; + int64 item_id = 2; + string text = 3; } diff --git a/tests/dataloader/dataloader_test.go b/tests/dataloader/dataloader_test.go index b994d6e..599fc74 100644 --- a/tests/dataloader/dataloader_test.go +++ b/tests/dataloader/dataloader_test.go @@ -47,9 +47,11 @@ func TestDataLoader(t *testing.T) { categoryClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(&apis.CategoryListResponse{ Categories: []*apis.Category{ { + Id: 12, Name: "category 12", }, { + Id: 11, Name: "category 11", }, }, @@ -118,12 +120,15 @@ func TestDataLoaderWithKeyFieldSlice(t *testing.T) { categoryClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(&apis.CategoryListResponse{ Categories: []*apis.Category{ { + Id: 12, Name: "category 12", }, { + Id: 11, Name: "category 11", }, { + Id: 15, Name: "category 15", }, }, @@ -236,7 +241,7 @@ func TestDataLoaderGetOne(t *testing.T) { itemsClient := mock.NewMockItemsServiceClient(mockCtrl) itemsClient.EXPECT().GetOne(gomock.Any(), gomock.Any()).Return(&apis.Item{ Name: "item 1", - CategoryId: 12, + CategoryId: 1, }, nil).AnyTimes() categoryClient := mock.NewMockCategoryServiceClient(mockCtrl) @@ -244,6 +249,7 @@ func TestDataLoaderGetOne(t *testing.T) { categoryClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(&apis.CategoryListResponse{ Categories: []*apis.Category{ { + Id: 1, Name: "category 1", }, }, @@ -367,19 +373,17 @@ func TestDataLoaderWithProtoFieldUnwrapping(t *testing.T) { itemsClient := mock.NewMockItemsServiceClient(mockCtrl) itemsClient.EXPECT().GetOne(gomock.Any(), gomock.Any()).Return(&apis.Item{ Name: "item 1", + Id: 1, CategoryId: 12, }, nil).AnyTimes() reviewsClient := mock.NewMockItemsReviewServiceClient(mockCtrl) reviewsClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(&apis.ListResponse{ - ItemReviews: []*apis.ItemReviews{ + Reviews: []*apis.Review{ { - ItemReview: []*apis.Review{ - { - Id: 456, - Text: "excellent item", - }, - }, + Id: 456, + ItemId: 1, + Text: "excellent item", }, }, }, nil).AnyTimes() diff --git a/tests/dataloader/generate.yml b/tests/dataloader/generate.yml index 354c1cb..46d301a 100644 --- a/tests/dataloader/generate.yml +++ b/tests/dataloader/generate.yml @@ -15,8 +15,13 @@ proto2gql: ItemsReviewService: methods: List: - data_loader_provider: - name: "ItemReviewsLoader" + data_loaders: + ItemReviewsByIDs: + request_field: "item_id" + result_field: "reviews" + match_field: "item_id" + type: "1-N" + messages: - "^ListResponse$": unwrap_field: true @@ -26,18 +31,27 @@ proto2gql: CategoryService: methods: List: - data_loader_provider: - name: "CategoryLoader" - wait_duration_ms: 5 + data_loaders: + CategoriesByIDs: + request_field: "id" + result_field: "categories" + match_field: "id" + type: "1-1" + wait_duration: 5ms + - proto_path: "./apis/user.proto" services: UserService: methods: List: - data_loader_provider: - name: "UserLoader" - wait_duration_ms: 5 + data_loaders: + UsersByIDs: + request_field: "id" + result_field: "users" + match_field: "id" + type: "1-1" + wait_duration: "5ms" - proto_path: "./apis/items.proto" services: ItemsService: @@ -52,16 +66,16 @@ proto2gql: data_loaders: - field_name: "category" key_field_name: "category_id" - data_loader_name: "CategoryLoader" + data_loader_name: "CategoriesByIDs" - field_name: "categories" key_field_name: "category_ids" - data_loader_name: "CategoryLoader" + data_loader_name: "CategoriesByIDs" - field_name: "comments" key_field_name: "id" data_loader_name: "CommentsLoader" - field_name: "reviews" key_field_name: "id" - data_loader_name: "ItemReviewsLoader" + data_loader_name: "ItemReviewsByIDs" swagger2gql: output_path: "./generated/schema" @@ -79,12 +93,13 @@ swagger2gql: data_loader_provider: name: "CommentsLoader" wait_duration_ms: 5 + slice: true objects: - "ItemComment$": data_loaders: - field_name: "user" key_field_name: "user_id" - data_loader_name: "UserLoader" + data_loader_name: "UsersByIDs" graphql_schemas: - name: "API"