Documentation
¶
Index ¶
- Constants
- func GraphQLEndpointHandler() http.Handler
- func GraphQLRequestForOperation(operation string) ([]byte, error)
- func LoadSchemaFromExamplesDirectoryWithinPkg() ([]byte, error)
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type Chatroom
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type Message
- type MutationResolver
- type QueryResolver
- type ResolverRoot
- type SubscriptionResolver
Constants ¶
View Source
const ( MutationSendMessage = `mutation SendMessage{ post(roomName: "#test", username: "myuser", text: "Hello World!") { text createdBy } }` QueryGetMessages = `query GetMessages { room(name:"#test") { name messages { text createdBy } } }` SubscriptionLiveMessages = `subscription LiveMessages { messageAdded(roomName: "#test") { text createdBy } }` InvalidSubscriptionLiveMessages = `` /* 130-byte string literal not displayed */ InvalidOperation = `query InvalidOperation { serverName } ` )
Variables ¶
This section is empty.
Functions ¶
func GraphQLEndpointHandler ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct {
Chatroom struct {
Messages func(childComplexity int) int
Name func(childComplexity int) int
}
Message struct {
CreatedAt func(childComplexity int) int
CreatedBy func(childComplexity int) int
ID func(childComplexity int) int
Text func(childComplexity int) int
}
Mutation struct {
Post func(childComplexity int, text string, username string, roomName string) int
}
Query struct {
Room func(childComplexity int, name string) int
}
Subscription struct {
MessageAdded func(childComplexity int, roomName string) int
}
}
type Config ¶
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type DirectiveRoot ¶
type MutationResolver ¶
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
Subscription() SubscriptionResolver
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.