diff --git a/example/greeter/Makefile b/example/greeter/Makefile index 372c092..aaf39f6 100644 --- a/example/greeter/Makefile +++ b/example/greeter/Makefile @@ -3,7 +3,7 @@ build: protoc \ -I. \ - -I../../include/graphql \ + -I../../proto/grpc-graphql-gateway \ --plugin=../../dist/protoc-gen-graphql \ --go_out=:./greeter \ --go-grpc_out=./greeter \ diff --git a/example/greeter/greeter.proto b/example/greeter/greeter.proto index cca427c..6593be8 100644 --- a/example/greeter/greeter.proto +++ b/example/greeter/greeter.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -import "graphql.proto"; +import "graphql/graphql.proto"; option go_package = "./;greeter"; diff --git a/example/greeter/greeter/greeter.pb.go b/example/greeter/greeter/greeter.pb.go index bc155c5..95c13ad 100644 --- a/example/greeter/greeter/greeter.pb.go +++ b/example/greeter/greeter/greeter.pb.go @@ -1,13 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v3.21.4 // source: greeter.proto package greeter import ( - _ "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + _ "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -215,27 +215,28 @@ var File_greeter_proto protoreflect.FileDescriptor var file_greeter_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x67, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x0d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, - 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xba, 0x43, - 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x26, 0x0a, 0x0a, 0x48, 0x65, 0x6c, - 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0x2b, 0x0a, 0x0e, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x05, 0xba, 0x43, 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, - 0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x79, 0x0a, 0x07, 0x47, 0x72, 0x65, 0x65, - 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, - 0x0d, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, - 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x0a, 0xba, 0x43, 0x07, - 0x12, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x3a, 0x0a, 0x0a, 0x53, 0x61, 0x79, 0x47, 0x6f, - 0x6f, 0x64, 0x62, 0x79, 0x65, 0x12, 0x0f, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x0c, 0xba, 0x43, 0x09, 0x12, 0x07, 0x67, 0x6f, 0x6f, 0x64, - 0x62, 0x79, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x3b, 0x67, 0x72, 0x65, 0x65, 0x74, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x15, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xba, 0x43, 0x02, 0x08, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x26, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2b, 0x0a, 0x0e, 0x47, 0x6f, 0x6f, + 0x64, 0x62, 0x79, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xba, 0x43, 0x02, 0x08, 0x01, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, + 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x32, 0x79, 0x0a, 0x07, 0x47, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x53, + 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x0d, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x0a, 0xba, 0x43, 0x07, 0x12, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x12, + 0x3a, 0x0a, 0x0a, 0x53, 0x61, 0x79, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x12, 0x0f, 0x2e, + 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, + 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x0c, 0xba, + 0x43, 0x09, 0x12, 0x07, 0x67, 0x6f, 0x6f, 0x64, 0x62, 0x79, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, + 0x2f, 0x3b, 0x67, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/example/greeter/greeter/greeter_grpc.pb.go b/example/greeter/greeter/greeter_grpc.pb.go index d2f1b80..2016c13 100644 --- a/example/greeter/greeter/greeter_grpc.pb.go +++ b/example/greeter/greeter/greeter_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.19.4 +// - protoc v3.21.4 // source: greeter.proto package greeter diff --git a/example/starwars/Makefile b/example/starwars/Makefile index ae7aac9..1a11c76 100644 --- a/example/starwars/Makefile +++ b/example/starwars/Makefile @@ -1,15 +1,7 @@ .PHONY: clean all -UNAME := $(shell uname) SPECDIR := "./spec" -ifeq ($(UNAME), Darwin) - LINKCMD := ln -s $(shell brew --prefix protobuf)/include/google ./proto/google -endif -ifeq ($(UNAME), Linux) - LINKCMD := ln -s /usr/local/include/protobuf/google ./proto/google -endif - all: build build: init @@ -18,7 +10,8 @@ build: init echo $$file; \ protoc \ -Iproto \ - --plugin=../..//dist/protoc-gen-graphql \ + -I../../proto/grpc-graphql-gateway \ + --plugin=../../dist/protoc-gen-graphql \ --graphql_out=${SPECDIR} \ --graphql_opt=paths=source_relative \ --go_out=:${SPECDIR} \ @@ -31,8 +24,6 @@ build: init init: if [ -L "./proto/google" ]; then rm ./proto/google; fi if [ -L "./proto/graphql" ]; then rm ./proto/graphql; fi - $(LINKCMD) - ln -s $(shell pwd)/../..//include/graphql ./proto/graphql cd ../../ && make start: build diff --git a/example/starwars/spec/starwars/starwars.graphql.go b/example/starwars/spec/starwars/starwars.graphql.go index a8ce9da..8959c61 100644 --- a/example/starwars/spec/starwars/starwars.graphql.go +++ b/example/starwars/spec/starwars/starwars.graphql.go @@ -15,12 +15,14 @@ var ( gql__enum_Episode *graphql.Enum // enum Episode in starwars/starwars.proto gql__interface_Character *graphql.Interface // message Character in starwars/starwars.proto gql__type_ListHumansResponse *graphql.Object // message ListHumansResponse in starwars/starwars.proto + gql__type_ListEmptyRequest *graphql.Object // message ListEmptyRequest in starwars/starwars.proto gql__type_ListDroidsResponse *graphql.Object // message ListDroidsResponse in starwars/starwars.proto gql__type_GetHumanRequest *graphql.Object // message GetHumanRequest in starwars/starwars.proto gql__type_GetHeroRequest *graphql.Object // message GetHeroRequest in starwars/starwars.proto gql__type_GetDroidRequest *graphql.Object // message GetDroidRequest in starwars/starwars.proto gql__type_Character *graphql.Object // message Character in starwars/starwars.proto gql__input_ListHumansResponse *graphql.InputObject // message ListHumansResponse in starwars/starwars.proto + gql__input_ListEmptyRequest *graphql.InputObject // message ListEmptyRequest in starwars/starwars.proto gql__input_ListDroidsResponse *graphql.InputObject // message ListDroidsResponse in starwars/starwars.proto gql__input_GetHumanRequest *graphql.InputObject // message GetHumanRequest in starwars/starwars.proto gql__input_GetHeroRequest *graphql.InputObject // message GetHeroRequest in starwars/starwars.proto @@ -114,6 +116,20 @@ func Gql__type_ListHumansResponse() *graphql.Object { return gql__type_ListHumansResponse } +func Gql__type_ListEmptyRequest() *graphql.Object { + if gql__type_ListEmptyRequest == nil { + gql__type_ListEmptyRequest = graphql.NewObject(graphql.ObjectConfig{ + Name: "Starwars_Type_ListEmptyRequest", + Fields: graphql.Fields{ + "_": &graphql.Field{ + Type: graphql.Boolean, + }, + }, + }) + } + return gql__type_ListEmptyRequest +} + func Gql__type_ListDroidsResponse() *graphql.Object { if gql__type_ListDroidsResponse == nil { gql__type_ListDroidsResponse = graphql.NewObject(graphql.ObjectConfig{ @@ -222,6 +238,20 @@ func Gql__input_ListHumansResponse() *graphql.InputObject { return gql__input_ListHumansResponse } +func Gql__input_ListEmptyRequest() *graphql.InputObject { + if gql__input_ListEmptyRequest == nil { + gql__input_ListEmptyRequest = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Starwars_Input_ListEmptyRequest", + Fields: graphql.InputObjectConfigFieldMap{ + "_": &graphql.InputObjectFieldConfig{ + Type: graphql.Boolean, + }, + }, + }) + } + return gql__input_ListEmptyRequest +} + func Gql__input_ListDroidsResponse() *graphql.InputObject { if gql__input_ListDroidsResponse == nil { gql__input_ListDroidsResponse = graphql.NewInputObject(graphql.InputObjectConfig{ diff --git a/example/starwars/spec/starwars/starwars.pb.go b/example/starwars/spec/starwars/starwars.pb.go index 616ab18..e68ebff 100644 --- a/example/starwars/spec/starwars/starwars.pb.go +++ b/example/starwars/spec/starwars/starwars.pb.go @@ -1,13 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v3.21.4 // source: starwars/starwars.proto package starwars import ( - _ "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + _ "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" diff --git a/example/starwars/spec/starwars/starwars_grpc.pb.go b/example/starwars/spec/starwars/starwars_grpc.pb.go index 469b209..530c5ce 100644 --- a/example/starwars/spec/starwars/starwars_grpc.pb.go +++ b/example/starwars/spec/starwars/starwars_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.19.4 +// - protoc v3.21.4 // source: starwars/starwars.proto package starwars diff --git a/proto/gen/go/graphql/v1/graphql.pb.go b/proto/gen/go/graphql/graphql.pb.go similarity index 57% rename from proto/gen/go/graphql/v1/graphql.pb.go rename to proto/gen/go/graphql/graphql.pb.go index 09d3576..904624a 100644 --- a/proto/gen/go/graphql/v1/graphql.pb.go +++ b/proto/gen/go/graphql/graphql.pb.go @@ -7,9 +7,9 @@ // versions: // protoc-gen-go v1.28.0-devel // protoc (unknown) -// source: graphql/v1/graphql.proto +// source: graphql/graphql.proto -package graphqlv1 +package graphql import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -63,11 +63,11 @@ func (x GraphqlType) String() string { } func (GraphqlType) Descriptor() protoreflect.EnumDescriptor { - return file_graphql_v1_graphql_proto_enumTypes[0].Descriptor() + return file_graphql_graphql_proto_enumTypes[0].Descriptor() } func (GraphqlType) Type() protoreflect.EnumType { - return &file_graphql_v1_graphql_proto_enumTypes[0] + return &file_graphql_graphql_proto_enumTypes[0] } func (x GraphqlType) Number() protoreflect.EnumNumber { @@ -76,7 +76,7 @@ func (x GraphqlType) Number() protoreflect.EnumNumber { // Deprecated: Use GraphqlType.Descriptor instead. func (GraphqlType) EnumDescriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{0} + return file_graphql_graphql_proto_rawDescGZIP(), []int{0} } // Base GraphqlService that gateway is built upon. @@ -89,7 +89,7 @@ type GraphqlService struct { func (x *GraphqlService) Reset() { *x = GraphqlService{} if protoimpl.UnsafeEnabled { - mi := &file_graphql_v1_graphql_proto_msgTypes[0] + mi := &file_graphql_graphql_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +102,7 @@ func (x *GraphqlService) String() string { func (*GraphqlService) ProtoMessage() {} func (x *GraphqlService) ProtoReflect() protoreflect.Message { - mi := &file_graphql_v1_graphql_proto_msgTypes[0] + mi := &file_graphql_graphql_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +115,7 @@ func (x *GraphqlService) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphqlService.ProtoReflect.Descriptor instead. func (*GraphqlService) Descriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{0} + return file_graphql_graphql_proto_rawDescGZIP(), []int{0} } // Extend MethodOptions in order to define GraphQL Query or Mutation. @@ -207,7 +207,7 @@ type GraphqlSchema struct { unknownFields protoimpl.UnknownFields // graphql type. Enum of QUERY or MUTATION is valid value - Type GraphqlType `protobuf:"varint,1,opt,name=type,proto3,enum=graphql.v1.GraphqlType" json:"type,omitempty"` + Type GraphqlType `protobuf:"varint,1,opt,name=type,proto3,enum=graphql.GraphqlType" json:"type,omitempty"` // query name. this field is required Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Query request object configuration @@ -219,7 +219,7 @@ type GraphqlSchema struct { func (x *GraphqlSchema) Reset() { *x = GraphqlSchema{} if protoimpl.UnsafeEnabled { - mi := &file_graphql_v1_graphql_proto_msgTypes[1] + mi := &file_graphql_graphql_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -232,7 +232,7 @@ func (x *GraphqlSchema) String() string { func (*GraphqlSchema) ProtoMessage() {} func (x *GraphqlSchema) ProtoReflect() protoreflect.Message { - mi := &file_graphql_v1_graphql_proto_msgTypes[1] + mi := &file_graphql_graphql_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -245,7 +245,7 @@ func (x *GraphqlSchema) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphqlSchema.ProtoReflect.Descriptor instead. func (*GraphqlSchema) Descriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{1} + return file_graphql_graphql_proto_rawDescGZIP(), []int{1} } func (x *GraphqlSchema) GetType() GraphqlType { @@ -293,7 +293,7 @@ type GraphqlRequest struct { func (x *GraphqlRequest) Reset() { *x = GraphqlRequest{} if protoimpl.UnsafeEnabled { - mi := &file_graphql_v1_graphql_proto_msgTypes[2] + mi := &file_graphql_graphql_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -306,7 +306,7 @@ func (x *GraphqlRequest) String() string { func (*GraphqlRequest) ProtoMessage() {} func (x *GraphqlRequest) ProtoReflect() protoreflect.Message { - mi := &file_graphql_v1_graphql_proto_msgTypes[2] + mi := &file_graphql_graphql_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -319,7 +319,7 @@ func (x *GraphqlRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphqlRequest.ProtoReflect.Descriptor instead. func (*GraphqlRequest) Descriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{2} + return file_graphql_graphql_proto_rawDescGZIP(), []int{2} } func (x *GraphqlRequest) GetName() string { @@ -354,7 +354,7 @@ type GraphqlResponse struct { func (x *GraphqlResponse) Reset() { *x = GraphqlResponse{} if protoimpl.UnsafeEnabled { - mi := &file_graphql_v1_graphql_proto_msgTypes[3] + mi := &file_graphql_graphql_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -367,7 +367,7 @@ func (x *GraphqlResponse) String() string { func (*GraphqlResponse) ProtoMessage() {} func (x *GraphqlResponse) ProtoReflect() protoreflect.Message { - mi := &file_graphql_v1_graphql_proto_msgTypes[3] + mi := &file_graphql_graphql_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -380,7 +380,7 @@ func (x *GraphqlResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphqlResponse.ProtoReflect.Descriptor instead. func (*GraphqlResponse) Descriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{3} + return file_graphql_graphql_proto_rawDescGZIP(), []int{3} } func (x *GraphqlResponse) GetRequired() bool { @@ -433,7 +433,7 @@ type GraphqlField struct { func (x *GraphqlField) Reset() { *x = GraphqlField{} if protoimpl.UnsafeEnabled { - mi := &file_graphql_v1_graphql_proto_msgTypes[4] + mi := &file_graphql_graphql_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -446,7 +446,7 @@ func (x *GraphqlField) String() string { func (*GraphqlField) ProtoMessage() {} func (x *GraphqlField) ProtoReflect() protoreflect.Message { - mi := &file_graphql_v1_graphql_proto_msgTypes[4] + mi := &file_graphql_graphql_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -459,7 +459,7 @@ func (x *GraphqlField) ProtoReflect() protoreflect.Message { // Deprecated: Use GraphqlField.ProtoReflect.Descriptor instead. func (*GraphqlField) Descriptor() ([]byte, []int) { - return file_graphql_v1_graphql_proto_rawDescGZIP(), []int{4} + return file_graphql_graphql_proto_rawDescGZIP(), []int{4} } func (x *GraphqlField) GetRequired() bool { @@ -497,157 +497,154 @@ func (x *GraphqlField) GetResolver() string { return "" } -var file_graphql_v1_graphql_proto_extTypes = []protoimpl.ExtensionInfo{ +var file_graphql_graphql_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*GraphqlService)(nil), Field: 1079, - Name: "graphql.v1.service", + Name: "graphql.service", Tag: "bytes,1079,opt,name=service", - Filename: "graphql/v1/graphql.proto", + Filename: "graphql/graphql.proto", }, { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*GraphqlField)(nil), Field: 1079, - Name: "graphql.v1.field", + Name: "graphql.field", Tag: "bytes,1079,opt,name=field", - Filename: "graphql/v1/graphql.proto", + Filename: "graphql/graphql.proto", }, { ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*GraphqlSchema)(nil), Field: 1079, - Name: "graphql.v1.schema", + Name: "graphql.schema", Tag: "bytes,1079,opt,name=schema", - Filename: "graphql/v1/graphql.proto", + Filename: "graphql/graphql.proto", }, } // Extension fields to descriptorpb.ServiceOptions. var ( - // optional graphql.v1.GraphqlService service = 1079; - E_Service = &file_graphql_v1_graphql_proto_extTypes[0] + // optional graphql.GraphqlService service = 1079; + E_Service = &file_graphql_graphql_proto_extTypes[0] ) // Extension fields to descriptorpb.FieldOptions. var ( - // optional graphql.v1.GraphqlField field = 1079; - E_Field = &file_graphql_v1_graphql_proto_extTypes[1] + // optional graphql.GraphqlField field = 1079; + E_Field = &file_graphql_graphql_proto_extTypes[1] ) // Extension fields to descriptorpb.MethodOptions. var ( - // optional graphql.v1.GraphqlSchema schema = 1079; - E_Schema = &file_graphql_v1_graphql_proto_extTypes[2] + // optional graphql.GraphqlSchema schema = 1079; + E_Schema = &file_graphql_graphql_proto_extTypes[2] ) -var File_graphql_v1_graphql_proto protoreflect.FileDescriptor - -var file_graphql_v1_graphql_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x72, 0x61, 0x70, - 0x68, 0x71, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x0d, 0x47, - 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2b, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x70, - 0x68, 0x71, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x0a, 0x0e, - 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x73, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x72, - 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6c, 0x75, - 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x22, - 0x88, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x6d, - 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6f, 0x6d, 0x69, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2a, 0x34, 0x0a, 0x0b, 0x47, 0x72, - 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45, - 0x52, 0x59, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x10, 0x02, - 0x3a, 0x56, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x4e, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xb7, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x52, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0xb7, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0xb4, 0x01, 0x0a, - 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x76, 0x31, 0x42, - 0x0c, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x6c, 0x65, 0x68, - 0x65, 0x63, 0x68, 0x6b, 0x61, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x72, 0x61, 0x70, 0x68, - 0x71, 0x6c, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2f, - 0x76, 0x31, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, - 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0a, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x47, - 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_graphql_graphql_proto protoreflect.FileDescriptor + +var file_graphql_graphql_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x0d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, + 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x0a, + 0x0e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x73, 0x22, 0x43, 0x0a, 0x0f, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6c, + 0x75, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6c, 0x75, 0x63, 0x6b, + 0x22, 0x88, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6f, + 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6f, 0x6d, 0x69, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2a, 0x34, 0x0a, 0x0b, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, + 0x45, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x54, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x52, 0x10, + 0x02, 0x3a, 0x53, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x4b, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, + 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, + 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x3a, 0x4f, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x42, 0x97, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x71, 0x6c, 0x42, 0x0c, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x6c, 0x65, 0x68, 0x65, 0x63, 0x68, 0x6b, 0x61, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x71, 0x6c, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x47, 0x72, 0x61, + 0x70, 0x68, 0x71, 0x6c, 0xca, 0x02, 0x07, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0xe2, 0x02, + 0x13, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_graphql_v1_graphql_proto_rawDescOnce sync.Once - file_graphql_v1_graphql_proto_rawDescData = file_graphql_v1_graphql_proto_rawDesc + file_graphql_graphql_proto_rawDescOnce sync.Once + file_graphql_graphql_proto_rawDescData = file_graphql_graphql_proto_rawDesc ) -func file_graphql_v1_graphql_proto_rawDescGZIP() []byte { - file_graphql_v1_graphql_proto_rawDescOnce.Do(func() { - file_graphql_v1_graphql_proto_rawDescData = protoimpl.X.CompressGZIP(file_graphql_v1_graphql_proto_rawDescData) +func file_graphql_graphql_proto_rawDescGZIP() []byte { + file_graphql_graphql_proto_rawDescOnce.Do(func() { + file_graphql_graphql_proto_rawDescData = protoimpl.X.CompressGZIP(file_graphql_graphql_proto_rawDescData) }) - return file_graphql_v1_graphql_proto_rawDescData -} - -var file_graphql_v1_graphql_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_graphql_v1_graphql_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_graphql_v1_graphql_proto_goTypes = []interface{}{ - (GraphqlType)(0), // 0: graphql.v1.GraphqlType - (*GraphqlService)(nil), // 1: graphql.v1.GraphqlService - (*GraphqlSchema)(nil), // 2: graphql.v1.GraphqlSchema - (*GraphqlRequest)(nil), // 3: graphql.v1.GraphqlRequest - (*GraphqlResponse)(nil), // 4: graphql.v1.GraphqlResponse - (*GraphqlField)(nil), // 5: graphql.v1.GraphqlField + return file_graphql_graphql_proto_rawDescData +} + +var file_graphql_graphql_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_graphql_graphql_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_graphql_graphql_proto_goTypes = []interface{}{ + (GraphqlType)(0), // 0: graphql.GraphqlType + (*GraphqlService)(nil), // 1: graphql.GraphqlService + (*GraphqlSchema)(nil), // 2: graphql.GraphqlSchema + (*GraphqlRequest)(nil), // 3: graphql.GraphqlRequest + (*GraphqlResponse)(nil), // 4: graphql.GraphqlResponse + (*GraphqlField)(nil), // 5: graphql.GraphqlField (*descriptorpb.ServiceOptions)(nil), // 6: google.protobuf.ServiceOptions (*descriptorpb.FieldOptions)(nil), // 7: google.protobuf.FieldOptions (*descriptorpb.MethodOptions)(nil), // 8: google.protobuf.MethodOptions } -var file_graphql_v1_graphql_proto_depIdxs = []int32{ - 0, // 0: graphql.v1.GraphqlSchema.type:type_name -> graphql.v1.GraphqlType - 3, // 1: graphql.v1.GraphqlSchema.request:type_name -> graphql.v1.GraphqlRequest - 4, // 2: graphql.v1.GraphqlSchema.response:type_name -> graphql.v1.GraphqlResponse - 6, // 3: graphql.v1.service:extendee -> google.protobuf.ServiceOptions - 7, // 4: graphql.v1.field:extendee -> google.protobuf.FieldOptions - 8, // 5: graphql.v1.schema:extendee -> google.protobuf.MethodOptions - 1, // 6: graphql.v1.service:type_name -> graphql.v1.GraphqlService - 5, // 7: graphql.v1.field:type_name -> graphql.v1.GraphqlField - 2, // 8: graphql.v1.schema:type_name -> graphql.v1.GraphqlSchema +var file_graphql_graphql_proto_depIdxs = []int32{ + 0, // 0: graphql.GraphqlSchema.type:type_name -> graphql.GraphqlType + 3, // 1: graphql.GraphqlSchema.request:type_name -> graphql.GraphqlRequest + 4, // 2: graphql.GraphqlSchema.response:type_name -> graphql.GraphqlResponse + 6, // 3: graphql.service:extendee -> google.protobuf.ServiceOptions + 7, // 4: graphql.field:extendee -> google.protobuf.FieldOptions + 8, // 5: graphql.schema:extendee -> google.protobuf.MethodOptions + 1, // 6: graphql.service:type_name -> graphql.GraphqlService + 5, // 7: graphql.field:type_name -> graphql.GraphqlField + 2, // 8: graphql.schema:type_name -> graphql.GraphqlSchema 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 6, // [6:9] is the sub-list for extension type_name @@ -655,13 +652,13 @@ var file_graphql_v1_graphql_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_graphql_v1_graphql_proto_init() } -func file_graphql_v1_graphql_proto_init() { - if File_graphql_v1_graphql_proto != nil { +func init() { file_graphql_graphql_proto_init() } +func file_graphql_graphql_proto_init() { + if File_graphql_graphql_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_graphql_v1_graphql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_graphql_graphql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GraphqlService); i { case 0: return &v.state @@ -673,7 +670,7 @@ func file_graphql_v1_graphql_proto_init() { return nil } } - file_graphql_v1_graphql_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_graphql_graphql_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GraphqlSchema); i { case 0: return &v.state @@ -685,7 +682,7 @@ func file_graphql_v1_graphql_proto_init() { return nil } } - file_graphql_v1_graphql_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_graphql_graphql_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GraphqlRequest); i { case 0: return &v.state @@ -697,7 +694,7 @@ func file_graphql_v1_graphql_proto_init() { return nil } } - file_graphql_v1_graphql_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_graphql_graphql_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GraphqlResponse); i { case 0: return &v.state @@ -709,7 +706,7 @@ func file_graphql_v1_graphql_proto_init() { return nil } } - file_graphql_v1_graphql_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_graphql_graphql_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GraphqlField); i { case 0: return &v.state @@ -726,20 +723,20 @@ func file_graphql_v1_graphql_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_graphql_v1_graphql_proto_rawDesc, + RawDescriptor: file_graphql_graphql_proto_rawDesc, NumEnums: 1, NumMessages: 5, NumExtensions: 3, NumServices: 0, }, - GoTypes: file_graphql_v1_graphql_proto_goTypes, - DependencyIndexes: file_graphql_v1_graphql_proto_depIdxs, - EnumInfos: file_graphql_v1_graphql_proto_enumTypes, - MessageInfos: file_graphql_v1_graphql_proto_msgTypes, - ExtensionInfos: file_graphql_v1_graphql_proto_extTypes, + GoTypes: file_graphql_graphql_proto_goTypes, + DependencyIndexes: file_graphql_graphql_proto_depIdxs, + EnumInfos: file_graphql_graphql_proto_enumTypes, + MessageInfos: file_graphql_graphql_proto_msgTypes, + ExtensionInfos: file_graphql_graphql_proto_extTypes, }.Build() - File_graphql_v1_graphql_proto = out.File - file_graphql_v1_graphql_proto_rawDesc = nil - file_graphql_v1_graphql_proto_goTypes = nil - file_graphql_v1_graphql_proto_depIdxs = nil + File_graphql_graphql_proto = out.File + file_graphql_graphql_proto_rawDesc = nil + file_graphql_graphql_proto_goTypes = nil + file_graphql_graphql_proto_depIdxs = nil } diff --git a/proto/grpc-graphql-gateway/graphql/v1/graphql.proto b/proto/grpc-graphql-gateway/graphql/graphql.proto similarity index 98% rename from proto/grpc-graphql-gateway/graphql/v1/graphql.proto rename to proto/grpc-graphql-gateway/graphql/graphql.proto index 4819bd1..d1ec613 100644 --- a/proto/grpc-graphql-gateway/graphql/v1/graphql.proto +++ b/proto/grpc-graphql-gateway/graphql/graphql.proto @@ -4,9 +4,9 @@ // see https://opensource.org/licenses/MIT syntax = "proto3"; -package graphql.v1; +package graphql; -option go_package = "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1;graphql"; +option go_package = "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql;graphql"; import "google/protobuf/descriptor.proto"; diff --git a/protoc-gen-graphql/generator/generator.go b/protoc-gen-graphql/generator/generator.go index becdb94..5b2827b 100644 --- a/protoc-gen-graphql/generator/generator.go +++ b/protoc-gen-graphql/generator/generator.go @@ -11,7 +11,7 @@ import ( "io/ioutil" "text/template" - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/alehechka/grpc-graphql-gateway/protoc-gen-graphql/spec" "github.com/golang/protobuf/proto" descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" @@ -122,9 +122,7 @@ func (g *Generator) generateFile(file *spec.File, tmpl string, services []*spec. } } if m.IsDepended(spec.DependTypeInput, file.Package()) { - if !spec.IsGooglePackage(m) { - inputs = append(inputs, m) - } + inputs = append(inputs, m) } if m.IsDepended(spec.DependTypeInterface, file.Package()) { interfaces = append(interfaces, m) diff --git a/protoc-gen-graphql/spec/field.go b/protoc-gen-graphql/spec/field.go index 93d2448..dfc5385 100644 --- a/protoc-gen-graphql/spec/field.go +++ b/protoc-gen-graphql/spec/field.go @@ -4,7 +4,7 @@ import ( "log" "strings" - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/golang/protobuf/proto" descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/iancoleman/strcase" diff --git a/protoc-gen-graphql/spec/method.go b/protoc-gen-graphql/spec/method.go index 9d09a22..fd8f3cf 100644 --- a/protoc-gen-graphql/spec/method.go +++ b/protoc-gen-graphql/spec/method.go @@ -3,7 +3,7 @@ package spec import ( "strings" - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/golang/protobuf/proto" descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" ) diff --git a/protoc-gen-graphql/spec/mutation.go b/protoc-gen-graphql/spec/mutation.go index babd2cb..cb3a8d6 100644 --- a/protoc-gen-graphql/spec/mutation.go +++ b/protoc-gen-graphql/spec/mutation.go @@ -5,7 +5,7 @@ import ( "path/filepath" - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/iancoleman/strcase" ) diff --git a/protoc-gen-graphql/spec/query.go b/protoc-gen-graphql/spec/query.go index e18c84f..0ea69be 100644 --- a/protoc-gen-graphql/spec/query.go +++ b/protoc-gen-graphql/spec/query.go @@ -7,7 +7,7 @@ import ( "path/filepath" - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/iancoleman/strcase" ) diff --git a/protoc-gen-graphql/spec/service.go b/protoc-gen-graphql/spec/service.go index 6394076..9aa66b1 100644 --- a/protoc-gen-graphql/spec/service.go +++ b/protoc-gen-graphql/spec/service.go @@ -1,7 +1,7 @@ package spec import ( - graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql/v1" + graphql "github.com/alehechka/grpc-graphql-gateway/proto/gen/go/graphql" "github.com/golang/protobuf/proto" descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" ) diff --git a/ptypes/buf.gen.yaml b/ptypes/buf.gen.yaml new file mode 100644 index 0000000..4b1f0f6 --- /dev/null +++ b/ptypes/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: github.com/alehechka/grpc-graphql-gateway/ptypes +plugins: + - name: graphql + out: ./ + opt: + - paths=source_relative diff --git a/ptypes/buf.lock b/ptypes/buf.lock new file mode 100644 index 0000000..c91b581 --- /dev/null +++ b/ptypes/buf.lock @@ -0,0 +1,2 @@ +# Generated by buf. DO NOT EDIT. +version: v1 diff --git a/ptypes/buf.yaml b/ptypes/buf.yaml new file mode 100644 index 0000000..1a51945 --- /dev/null +++ b/ptypes/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/ptypes/google/protobuf/empty/empty.go b/ptypes/google/protobuf/empty/empty.go index 212a660..00aafa5 100644 --- a/ptypes/google/protobuf/empty/empty.go +++ b/ptypes/google/protobuf/empty/empty.go @@ -2,41 +2,7 @@ package empty import ( "github.com/golang/protobuf/ptypes/empty" - "github.com/graphql-go/graphql" ) -// Expose Google defined ptypes as this package types +// Empty exposes Google defined ptypes as this package types type Empty = empty.Empty - -var ( - gql__type_Empty *graphql.Object - gql__input_Empty *graphql.InputObject -) - -func Gql__type_Empty() *graphql.Object { - if gql__type_Empty == nil { - gql__type_Empty = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Empty", - Fields: graphql.Fields{ - "_": &graphql.Field{ - Type: graphql.Boolean, - }, - }, - }) - } - return gql__type_Empty -} - -func Gql__input_Empty() *graphql.InputObject { - if gql__input_Empty == nil { - gql__input_Empty = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Empty", - Fields: graphql.InputObjectConfigFieldMap{ - "_": &graphql.InputObjectFieldConfig{ - Type: graphql.Boolean, - }, - }, - }) - } - return gql__input_Empty -} diff --git a/ptypes/google/protobuf/emptypb/emptypb.go b/ptypes/google/protobuf/empty/empty.graphql.go similarity index 66% rename from ptypes/google/protobuf/emptypb/emptypb.go rename to ptypes/google/protobuf/empty/empty.graphql.go index f919bcf..9882fbe 100644 --- a/ptypes/google/protobuf/emptypb/emptypb.go +++ b/ptypes/google/protobuf/empty/empty.graphql.go @@ -1,22 +1,19 @@ -package emptypb +// Code generated by proroc-gen-graphql, DO NOT EDIT. +package empty import ( "github.com/graphql-go/graphql" - "google.golang.org/protobuf/types/known/emptypb" ) -// Expose Google defined ptypes as this package types -type Empty = emptypb.Empty - var ( - gql__type_Empty *graphql.Object - gql__input_Empty *graphql.InputObject + gql__type_Empty *graphql.Object // message Empty in google/protobuf/empty/empty.proto + gql__input_Empty *graphql.InputObject // message Empty in google/protobuf/empty/empty.proto ) func Gql__type_Empty() *graphql.Object { if gql__type_Empty == nil { gql__type_Empty = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Empty", + Name: "Empty_Type_Empty", Fields: graphql.Fields{ "_": &graphql.Field{ Type: graphql.Boolean, @@ -30,7 +27,7 @@ func Gql__type_Empty() *graphql.Object { func Gql__input_Empty() *graphql.InputObject { if gql__input_Empty == nil { gql__input_Empty = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Empty", + Name: "Empty_Input_Empty", Fields: graphql.InputObjectConfigFieldMap{ "_": &graphql.InputObjectFieldConfig{ Type: graphql.Boolean, diff --git a/ptypes/google/protobuf/empty/empty.proto b/ptypes/google/protobuf/empty/empty.proto new file mode 100644 index 0000000..40d794e --- /dev/null +++ b/ptypes/google/protobuf/empty/empty.proto @@ -0,0 +1,45 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "github.com/alehechka/grpc-graphql-gateway/ptypes/google/protobuf/empty;empty"; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} \ No newline at end of file diff --git a/ptypes/google/protobuf/timestamp/timestamp.go b/ptypes/google/protobuf/timestamp/timestamp.go index c88fedc..83105e1 100644 --- a/ptypes/google/protobuf/timestamp/timestamp.go +++ b/ptypes/google/protobuf/timestamp/timestamp.go @@ -2,47 +2,7 @@ package timestamp import ( "github.com/golang/protobuf/ptypes/timestamp" - "github.com/graphql-go/graphql" ) // Expose Google defined ptypes as this package types type Timestamp = timestamp.Timestamp - -var ( - gql__type_Timestamp *graphql.Object - gql__input_Timestamp *graphql.InputObject -) - -func Gql__type_Timestamp() *graphql.Object { - if gql__type_Timestamp == nil { - gql__type_Timestamp = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Timestamp", - Fields: graphql.Fields{ - "seconds": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - "nanos": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Timestamp -} - -func Gql__input_Timestamp() *graphql.InputObject { - if gql__input_Timestamp == nil { - gql__input_Timestamp = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Timestamp", - Fields: graphql.InputObjectConfigFieldMap{ - "seconds": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - "nanos": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Timestamp -} diff --git a/ptypes/google/protobuf/timestamppb/timestamppb.go b/ptypes/google/protobuf/timestamp/timestamp.graphql.go similarity index 58% rename from ptypes/google/protobuf/timestamppb/timestamppb.go rename to ptypes/google/protobuf/timestamp/timestamp.graphql.go index be14565..3b6f695 100644 --- a/ptypes/google/protobuf/timestamppb/timestamppb.go +++ b/ptypes/google/protobuf/timestamp/timestamp.graphql.go @@ -1,28 +1,25 @@ -package timestamppb +// Code generated by proroc-gen-graphql, DO NOT EDIT. +package timestamp import ( "github.com/graphql-go/graphql" - "google.golang.org/protobuf/types/known/timestamppb" ) -// Expose Google defined ptypes as this package types -type Timestamp = timestamppb.Timestamp - var ( - gql__type_Timestamp *graphql.Object - gql__input_Timestamp *graphql.InputObject + gql__type_Timestamp *graphql.Object // message Timestamp in google/protobuf/timestamp/timestamp.proto + gql__input_Timestamp *graphql.InputObject // message Timestamp in google/protobuf/timestamp/timestamp.proto ) func Gql__type_Timestamp() *graphql.Object { if gql__type_Timestamp == nil { gql__type_Timestamp = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Timestamp", + Name: "Timestamp_Type_Timestamp", Fields: graphql.Fields{ "seconds": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), + Type: graphql.Int, }, "nanos": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), + Type: graphql.Int, }, }, }) @@ -33,13 +30,13 @@ func Gql__type_Timestamp() *graphql.Object { func Gql__input_Timestamp() *graphql.InputObject { if gql__input_Timestamp == nil { gql__input_Timestamp = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Timestamp", + Name: "Timestamp_Input_Timestamp", Fields: graphql.InputObjectConfigFieldMap{ "seconds": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), + Type: graphql.Int, }, "nanos": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), + Type: graphql.Int, }, }, }) diff --git a/ptypes/google/protobuf/timestamp/timestamp.proto b/ptypes/google/protobuf/timestamp/timestamp.proto new file mode 100644 index 0000000..b0b919f --- /dev/null +++ b/ptypes/google/protobuf/timestamp/timestamp.proto @@ -0,0 +1,141 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "github.com/alehechka/grpc-graphql-gateway/ptypes/google/protobuf/timestamp;timestamp"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} \ No newline at end of file diff --git a/ptypes/google/protobuf/wrappers/wrappers.go b/ptypes/google/protobuf/wrappers/wrappers.go index 5dca7a0..598cae0 100644 --- a/ptypes/google/protobuf/wrappers/wrappers.go +++ b/ptypes/google/protobuf/wrappers/wrappers.go @@ -2,7 +2,6 @@ package wrappers import ( "github.com/golang/protobuf/ptypes/wrappers" - "github.com/graphql-go/graphql" ) // Expose Google defined ptypes as this package types @@ -17,246 +16,3 @@ type ( StringValue = wrappers.StringValue BytesValue = wrappers.BytesValue ) - -var ( - gql__type_DoubleValue *graphql.Object - gql__type_FloatValue *graphql.Object - gql__type_Int64Value *graphql.Object - gql__type_Uint64Value *graphql.Object - gql__type_Int32Value *graphql.Object - gql__type_Uint32Value *graphql.Object - gql__type_BoolValue *graphql.Object - gql__type_StringValue *graphql.Object - gql__input_DoubleValue *graphql.InputObject - gql__input_FloatValue *graphql.InputObject - gql__input_Int64Value *graphql.InputObject - gql__input_Uint64Value *graphql.InputObject - gql__input_Int32Value *graphql.InputObject - gql__input_Uint32Value *graphql.InputObject - gql__input_BoolValue *graphql.InputObject - gql__input_StringValue *graphql.InputObject -) - -func Gql__type_DoubleValue() *graphql.Object { - if gql__type_DoubleValue == nil { - gql__type_DoubleValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_DoubleValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__type_DoubleValue -} - -func Gql__type_FloatValue() *graphql.Object { - if gql__type_FloatValue == nil { - gql__type_FloatValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_FloatValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__type_FloatValue -} - -func Gql__type_Int64Value() *graphql.Object { - if gql__type_Int64Value == nil { - gql__type_Int64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Int64Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Int64Value -} - -func Gql__type_Uint64Value() *graphql.Object { - if gql__type_Uint64Value == nil { - gql__type_Uint64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Uint64Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Uint64Value -} - -func Gql__type_Int32Value() *graphql.Object { - if gql__type_Int32Value == nil { - gql__type_Int32Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Int32Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Int32Value -} - -func Gql__type_Uint32Value() *graphql.Object { - if gql__type_Uint32Value == nil { - gql__type_Uint64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Uint32Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Uint32Value -} - -func Gql__type_BoolValue() *graphql.Object { - if gql__type_BoolValue == nil { - gql__type_BoolValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_BoolValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Boolean), - }, - }, - }) - } - return gql__type_BoolValue -} - -func Gql__type_StringValue() *graphql.Object { - if gql__type_StringValue == nil { - gql__type_StringValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_StringValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.String), - }, - }, - }) - } - return gql__type_StringValue -} - -func Gql__input_DoubleValue() *graphql.InputObject { - if gql__input_DoubleValue == nil { - gql__input_DoubleValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_DoubleValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__input_DoubleValue -} - -func Gql__input_FloatValue() *graphql.InputObject { - if gql__input_FloatValue == nil { - gql__input_FloatValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_FloatValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__input_FloatValue -} - -func Gql__input_Int64Value() *graphql.InputObject { - if gql__input_Int64Value == nil { - gql__input_Int64Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Int64Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Int64Value -} - -func Gql__input_Uint64Value() *graphql.InputObject { - if gql__input_Uint64Value == nil { - gql__input_Uint64Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Uint64Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Uint64Value -} - -func Gql__input_Int32Value() *graphql.InputObject { - if gql__input_Int32Value == nil { - gql__input_Int32Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Int32Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Int32Value -} - -func Gql__input_Uint32Value() *graphql.InputObject { - if gql__input_Uint32Value == nil { - gql__input_Uint32Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Uint32Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Uint32Value -} - -func Gql__input_BoolValue() *graphql.InputObject { - if gql__input_BoolValue == nil { - gql__input_BoolValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_BoolValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Boolean), - }, - }, - }) - } - return gql__input_BoolValue -} - -func Gql__input_StringValue() *graphql.InputObject { - if gql__input_StringValue == nil { - gql__input_StringValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_StringValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.String), - }, - }, - }) - } - return gql__input_StringValue -} diff --git a/ptypes/google/protobuf/wrappers/wrappers.graphql.go b/ptypes/google/protobuf/wrappers/wrappers.graphql.go new file mode 100644 index 0000000..c10f1fc --- /dev/null +++ b/ptypes/google/protobuf/wrappers/wrappers.graphql.go @@ -0,0 +1,279 @@ +// Code generated by proroc-gen-graphql, DO NOT EDIT. +package wrappers + +import ( + "github.com/graphql-go/graphql" +) + +var ( + gql__type_UInt64Value *graphql.Object // message UInt64Value in google/protobuf/wrappers/wrappers.proto + gql__type_UInt32Value *graphql.Object // message UInt32Value in google/protobuf/wrappers/wrappers.proto + gql__type_StringValue *graphql.Object // message StringValue in google/protobuf/wrappers/wrappers.proto + gql__type_Int64Value *graphql.Object // message Int64Value in google/protobuf/wrappers/wrappers.proto + gql__type_Int32Value *graphql.Object // message Int32Value in google/protobuf/wrappers/wrappers.proto + gql__type_FloatValue *graphql.Object // message FloatValue in google/protobuf/wrappers/wrappers.proto + gql__type_DoubleValue *graphql.Object // message DoubleValue in google/protobuf/wrappers/wrappers.proto + gql__type_BytesValue *graphql.Object // message BytesValue in google/protobuf/wrappers/wrappers.proto + gql__type_BoolValue *graphql.Object // message BoolValue in google/protobuf/wrappers/wrappers.proto + gql__input_UInt64Value *graphql.InputObject // message UInt64Value in google/protobuf/wrappers/wrappers.proto + gql__input_UInt32Value *graphql.InputObject // message UInt32Value in google/protobuf/wrappers/wrappers.proto + gql__input_StringValue *graphql.InputObject // message StringValue in google/protobuf/wrappers/wrappers.proto + gql__input_Int64Value *graphql.InputObject // message Int64Value in google/protobuf/wrappers/wrappers.proto + gql__input_Int32Value *graphql.InputObject // message Int32Value in google/protobuf/wrappers/wrappers.proto + gql__input_FloatValue *graphql.InputObject // message FloatValue in google/protobuf/wrappers/wrappers.proto + gql__input_DoubleValue *graphql.InputObject // message DoubleValue in google/protobuf/wrappers/wrappers.proto + gql__input_BytesValue *graphql.InputObject // message BytesValue in google/protobuf/wrappers/wrappers.proto + gql__input_BoolValue *graphql.InputObject // message BoolValue in google/protobuf/wrappers/wrappers.proto +) + +func Gql__type_UInt64Value() *graphql.Object { + if gql__type_UInt64Value == nil { + gql__type_UInt64Value = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_UInt64Value", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Int, + }, + }, + }) + } + return gql__type_UInt64Value +} + +func Gql__type_UInt32Value() *graphql.Object { + if gql__type_UInt32Value == nil { + gql__type_UInt32Value = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_UInt32Value", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Int, + }, + }, + }) + } + return gql__type_UInt32Value +} + +func Gql__type_StringValue() *graphql.Object { + if gql__type_StringValue == nil { + gql__type_StringValue = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_StringValue", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.String, + }, + }, + }) + } + return gql__type_StringValue +} + +func Gql__type_Int64Value() *graphql.Object { + if gql__type_Int64Value == nil { + gql__type_Int64Value = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_Int64Value", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Int, + }, + }, + }) + } + return gql__type_Int64Value +} + +func Gql__type_Int32Value() *graphql.Object { + if gql__type_Int32Value == nil { + gql__type_Int32Value = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_Int32Value", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Int, + }, + }, + }) + } + return gql__type_Int32Value +} + +func Gql__type_FloatValue() *graphql.Object { + if gql__type_FloatValue == nil { + gql__type_FloatValue = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_FloatValue", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Float, + }, + }, + }) + } + return gql__type_FloatValue +} + +func Gql__type_DoubleValue() *graphql.Object { + if gql__type_DoubleValue == nil { + gql__type_DoubleValue = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_DoubleValue", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Float, + }, + }, + }) + } + return gql__type_DoubleValue +} + +func Gql__type_BytesValue() *graphql.Object { + if gql__type_BytesValue == nil { + gql__type_BytesValue = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_BytesValue", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.String, + }, + }, + }) + } + return gql__type_BytesValue +} + +func Gql__type_BoolValue() *graphql.Object { + if gql__type_BoolValue == nil { + gql__type_BoolValue = graphql.NewObject(graphql.ObjectConfig{ + Name: "Wrappers_Type_BoolValue", + Fields: graphql.Fields{ + "value": &graphql.Field{ + Type: graphql.Boolean, + }, + }, + }) + } + return gql__type_BoolValue +} + +func Gql__input_UInt64Value() *graphql.InputObject { + if gql__input_UInt64Value == nil { + gql__input_UInt64Value = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_UInt64Value", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + }, + }) + } + return gql__input_UInt64Value +} + +func Gql__input_UInt32Value() *graphql.InputObject { + if gql__input_UInt32Value == nil { + gql__input_UInt32Value = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_UInt32Value", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + }, + }) + } + return gql__input_UInt32Value +} + +func Gql__input_StringValue() *graphql.InputObject { + if gql__input_StringValue == nil { + gql__input_StringValue = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_StringValue", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + }, + }) + } + return gql__input_StringValue +} + +func Gql__input_Int64Value() *graphql.InputObject { + if gql__input_Int64Value == nil { + gql__input_Int64Value = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_Int64Value", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + }, + }) + } + return gql__input_Int64Value +} + +func Gql__input_Int32Value() *graphql.InputObject { + if gql__input_Int32Value == nil { + gql__input_Int32Value = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_Int32Value", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + }, + }) + } + return gql__input_Int32Value +} + +func Gql__input_FloatValue() *graphql.InputObject { + if gql__input_FloatValue == nil { + gql__input_FloatValue = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_FloatValue", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Float, + }, + }, + }) + } + return gql__input_FloatValue +} + +func Gql__input_DoubleValue() *graphql.InputObject { + if gql__input_DoubleValue == nil { + gql__input_DoubleValue = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_DoubleValue", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Float, + }, + }, + }) + } + return gql__input_DoubleValue +} + +func Gql__input_BytesValue() *graphql.InputObject { + if gql__input_BytesValue == nil { + gql__input_BytesValue = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_BytesValue", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + }, + }) + } + return gql__input_BytesValue +} + +func Gql__input_BoolValue() *graphql.InputObject { + if gql__input_BoolValue == nil { + gql__input_BoolValue = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Wrappers_Input_BoolValue", + Fields: graphql.InputObjectConfigFieldMap{ + "value": &graphql.InputObjectFieldConfig{ + Type: graphql.Boolean, + }, + }, + }) + } + return gql__input_BoolValue +} diff --git a/ptypes/google/protobuf/wrappers/wrappers.proto b/ptypes/google/protobuf/wrappers/wrappers.proto new file mode 100644 index 0000000..67fe983 --- /dev/null +++ b/ptypes/google/protobuf/wrappers/wrappers.proto @@ -0,0 +1,117 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "github.com/alehechka/grpc-graphql-gateway/ptypes/google/protobuf/wrappers;wrappers"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} \ No newline at end of file diff --git a/ptypes/google/protobuf/wrapperspb/wrapperspb.go b/ptypes/google/protobuf/wrapperspb/wrapperspb.go deleted file mode 100644 index 31b9207..0000000 --- a/ptypes/google/protobuf/wrapperspb/wrapperspb.go +++ /dev/null @@ -1,262 +0,0 @@ -package wrapperspb - -import ( - "github.com/graphql-go/graphql" - "google.golang.org/protobuf/types/known/wrapperspb" -) - -// Expose Google defined ptypes as this package types -type ( - DoubleValue = wrapperspb.DoubleValue - FloatValue = wrapperspb.FloatValue - BoolValue = wrapperspb.BoolValue - Int32Value = wrapperspb.Int32Value - Int64Value = wrapperspb.Int64Value - UInt32Value = wrapperspb.UInt32Value - UInt64Value = wrapperspb.UInt64Value - StringValue = wrapperspb.StringValue - BytesValue = wrapperspb.BytesValue -) - -var ( - gql__type_DoubleValue *graphql.Object - gql__type_FloatValue *graphql.Object - gql__type_Int64Value *graphql.Object - gql__type_Uint64Value *graphql.Object - gql__type_Int32Value *graphql.Object - gql__type_Uint32Value *graphql.Object - gql__type_BoolValue *graphql.Object - gql__type_StringValue *graphql.Object - gql__input_DoubleValue *graphql.InputObject - gql__input_FloatValue *graphql.InputObject - gql__input_Int64Value *graphql.InputObject - gql__input_Uint64Value *graphql.InputObject - gql__input_Int32Value *graphql.InputObject - gql__input_Uint32Value *graphql.InputObject - gql__input_BoolValue *graphql.InputObject - gql__input_StringValue *graphql.InputObject -) - -func Gql__type_DoubleValue() *graphql.Object { - if gql__type_DoubleValue == nil { - gql__type_DoubleValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_DoubleValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__type_DoubleValue -} - -func Gql__type_FloatValue() *graphql.Object { - if gql__type_FloatValue == nil { - gql__type_FloatValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_FloatValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__type_FloatValue -} - -func Gql__type_Int64Value() *graphql.Object { - if gql__type_Int64Value == nil { - gql__type_Int64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Int64Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Int64Value -} - -func Gql__type_Uint64Value() *graphql.Object { - if gql__type_Uint64Value == nil { - gql__type_Uint64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Uint64Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Uint64Value -} - -func Gql__type_Int32Value() *graphql.Object { - if gql__type_Int32Value == nil { - gql__type_Int32Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Int32Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Int32Value -} - -func Gql__type_Uint32Value() *graphql.Object { - if gql__type_Uint32Value == nil { - gql__type_Uint64Value = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_Uint32Value", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__type_Uint32Value -} - -func Gql__type_BoolValue() *graphql.Object { - if gql__type_BoolValue == nil { - gql__type_BoolValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_BoolValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Boolean), - }, - }, - }) - } - return gql__type_BoolValue -} - -func Gql__type_StringValue() *graphql.Object { - if gql__type_StringValue == nil { - gql__type_StringValue = graphql.NewObject(graphql.ObjectConfig{ - Name: "Google_type_Wrappers_StringValue", - Fields: graphql.Fields{ - "value": &graphql.Field{ - Type: graphql.NewNonNull(graphql.String), - }, - }, - }) - } - return gql__type_StringValue -} - -func Gql__input_DoubleValue() *graphql.InputObject { - if gql__input_DoubleValue == nil { - gql__input_DoubleValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_DoubleValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__input_DoubleValue -} - -func Gql__input_FloatValue() *graphql.InputObject { - if gql__input_FloatValue == nil { - gql__input_FloatValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_FloatValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Float), - }, - }, - }) - } - return gql__input_FloatValue -} - -func Gql__input_Int64Value() *graphql.InputObject { - if gql__input_Int64Value == nil { - gql__input_Int64Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Int64Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Int64Value -} - -func Gql__input_Uint64Value() *graphql.InputObject { - if gql__input_Uint64Value == nil { - gql__input_Uint64Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Uint64Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Uint64Value -} - -func Gql__input_Int32Value() *graphql.InputObject { - if gql__input_Int32Value == nil { - gql__input_Int32Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Int32Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Int32Value -} - -func Gql__input_Uint32Value() *graphql.InputObject { - if gql__input_Uint32Value == nil { - gql__input_Uint32Value = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_Uint32Value", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Int), - }, - }, - }) - } - return gql__input_Uint32Value -} - -func Gql__input_BoolValue() *graphql.InputObject { - if gql__input_BoolValue == nil { - gql__input_BoolValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_BoolValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.Boolean), - }, - }, - }) - } - return gql__input_BoolValue -} - -func Gql__input_StringValue() *graphql.InputObject { - if gql__input_StringValue == nil { - gql__input_StringValue = graphql.NewInputObject(graphql.InputObjectConfig{ - Name: "Google_input_Wrappers_StringValue", - Fields: graphql.InputObjectConfigFieldMap{ - "value": &graphql.InputObjectFieldConfig{ - Type: graphql.NewNonNull(graphql.String), - }, - }, - }) - } - return gql__input_StringValue -}