Documentation ¶
Index ¶
- func GetRequestOperation(rpcOpts *graphqlv1.Rpc) string
- func GraphqlFieldOptions(opts proto.Message) *graphqlv1.Field
- func GraphqlMethodOptions(opts proto.Message) *graphqlv1.Rpc
- func GraphqlOneofOptions(opts proto.Message) *graphqlv1.Oneof
- func IsAny(o protoreflect.MessageDescriptor) bool
- func IsEmpty(o protoreflect.MessageDescriptor) bool
- func ToLowerFirst(s string) string
- type Callstack
- type SchemaDescriptor
- func (s *SchemaDescriptor) AsGraphQL() *ast.Schema
- func (s *SchemaDescriptor) CreateObjects(msgDesc protoreflect.MessageDescriptor, isInput bool) (*ast.Definition, error)
- func (ins *SchemaDescriptor) Marshal(msg proto.Message, field *ast.Field) (interface{}, error)
- func (schema *SchemaDescriptor) RegisterFileDescriptor(generateUnboundMethods bool, file protoreflect.FileDescriptor) error
- func (ins *SchemaDescriptor) Unmarshal(desc protoreflect.MessageDescriptor, field *ast.Field, ...) (proto.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRequestOperation ¶
func IsAny ¶
func IsAny(o protoreflect.MessageDescriptor) bool
func ToLowerFirst ¶
Types ¶
type Callstack ¶
type Callstack interface { Push(entry interface{}) Pop(entry interface{}) Has(entry interface{}) bool }
func NewCallstack ¶
func NewCallstack() Callstack
type SchemaDescriptor ¶
type SchemaDescriptor struct { FileDescriptors []protoreflect.FileDescriptor Query *ast.Definition Mutation *ast.Definition Subscription *ast.Definition Directives map[string]*ast.DirectiveDefinition Types map[string]*ast.Definition Types2MessageDesc map[string]protoreflect.MessageDescriptor MethodsByName map[ast.Operation]map[string]protoreflect.MethodDescriptor ProtoTypes *protoregistry.Types HaveFieldMask map[protoreflect.MessageDescriptor]struct{} }
SchemaDescriptor 存储生成的 GraphQL schema 信息
func New ¶
func New() *SchemaDescriptor
func (*SchemaDescriptor) AsGraphQL ¶
func (s *SchemaDescriptor) AsGraphQL() *ast.Schema
func (*SchemaDescriptor) CreateObjects ¶
func (s *SchemaDescriptor) CreateObjects(msgDesc protoreflect.MessageDescriptor, isInput bool) (*ast.Definition, error)
CreateObjects 创建 GraphQL 对象类型定义
func (*SchemaDescriptor) RegisterFileDescriptor ¶
func (schema *SchemaDescriptor) RegisterFileDescriptor(generateUnboundMethods bool, file protoreflect.FileDescriptor) error
func (*SchemaDescriptor) Unmarshal ¶
func (ins *SchemaDescriptor) Unmarshal(desc protoreflect.MessageDescriptor, field *ast.Field, vars map[string]interface{}) (proto.Message, error)
Unmarshal 将 GraphQL 字段转换为 Protocol Buffers 消息
Click to show internal directories.
Click to hide internal directories.