Documentation
¶
Index ¶
- Variables
- func MapFieldTypeToGraphQL(fieldType schema.FieldType) graphql.Type
- func WhereInputField(fieldType schema.FieldType) *graphql.InputObjectFieldConfig
- type Handler
- func (h *Handler) EnableGraphiQL() *Handler
- func (h *Handler) EnablePlayground() *Handler
- func (h *Handler) ServeGraphQL(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ServeGraphiQL(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ServePlayground(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetLogger(l logger.Logger) *Handler
- func (h *Handler) SetPretty(pretty bool) *Handler
- type SchemaGenerator
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
var GraphQLDateTime = graphql.NewScalar(graphql.ScalarConfig{ Name: "DateTime", Description: "DateTime scalar type represents a date and time in ISO 8601 format", Serialize: func(value any) any { return value }, ParseValue: func(value any) any { return value }, ParseLiteral: func(valueAST ast.Value) any { if stringValue, ok := valueAST.(*ast.StringValue); ok { return stringValue.Value } return nil }, })
GraphQLDateTime is a custom scalar for DateTime fields
var GraphQLJSON = graphql.NewScalar(graphql.ScalarConfig{ Name: "JSON", Description: "JSON scalar type represents JSON data", Serialize: func(value any) any { return value }, ParseValue: func(value any) any { return value }, ParseLiteral: func(valueAST ast.Value) any { if stringValue, ok := valueAST.(*ast.StringValue); ok { return stringValue.Value } return nil }, })
GraphQLJSON is a custom scalar for JSON fields
var OrderByEnum = graphql.NewEnum(graphql.EnumConfig{ Name: "OrderBy", Description: "Order by direction", Values: graphql.EnumValueConfigMap{ "ASC": &graphql.EnumValueConfig{ Value: "ASC", }, "DESC": &graphql.EnumValueConfig{ Value: "DESC", }, }, })
OrderByEnum creates an enum for ordering
Functions ¶
func MapFieldTypeToGraphQL ¶
MapFieldTypeToGraphQL converts RediORM field types to GraphQL types
func WhereInputField ¶
func WhereInputField(fieldType schema.FieldType) *graphql.InputObjectFieldConfig
WhereInputField creates a GraphQL input field for where conditions
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides a generic HTTP handler for GraphQL requests
func NewHandler ¶
NewHandler creates a new GraphQL HTTP handler
func (*Handler) EnableGraphiQL ¶
EnableGraphiQL enables the GraphiQL interface
func (*Handler) EnablePlayground ¶
EnablePlayground enables the GraphQL Playground interface
func (*Handler) ServeGraphQL ¶
func (h *Handler) ServeGraphQL(w http.ResponseWriter, r *http.Request)
ServeGraphQL handles GraphQL query execution
func (*Handler) ServeGraphiQL ¶
func (h *Handler) ServeGraphiQL(w http.ResponseWriter, r *http.Request)
ServeGraphiQL serves the GraphiQL interface
func (*Handler) ServeHTTP ¶
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface
func (*Handler) ServePlayground ¶
func (h *Handler) ServePlayground(w http.ResponseWriter, r *http.Request)
ServePlayground serves the GraphQL Playground interface
type SchemaGenerator ¶
type SchemaGenerator struct {
// contains filtered or unexported fields
}
SchemaGenerator generates GraphQL schema from RediORM schemas
func NewSchemaGenerator ¶
NewSchemaGenerator creates a new schema generator
func (*SchemaGenerator) Generate ¶
func (g *SchemaGenerator) Generate() (*graphql.Schema, error)
Generate creates the complete GraphQL schema
func (*SchemaGenerator) GetObjectTypes ¶
func (g *SchemaGenerator) GetObjectTypes() map[string]*graphql.Object
GetObjectTypes returns the object types for debugging