Documentation
¶
Index ¶
- Variables
- func DialDB(addr string)
- func LoggerMiddleware(ctx *gin.Context)
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func RunServer(addr string)
- type BlogPostResolver
- type BlogUserResolver
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type MutationResolver
- type NewBlogPost
- type Pagination
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Sort
- type SortOrder
- type TweetResolver
- type TwitterUserResolver
Constants ¶
This section is empty.
Variables ¶
View Source
var AllSortOrder = []SortOrder{ SortOrderAsc, SortOrderDesc, }
Functions ¶
func LoggerMiddleware ¶ added in v0.1.4
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type BlogPostResolver ¶ added in v0.2.1
type BlogUserResolver ¶ added in v0.2.1
type ComplexityRoot ¶
type ComplexityRoot struct { BlogCategory struct { Name func(childComplexity int) int URL func(childComplexity int) int } BlogPost struct { Author func(childComplexity int) int Category func(childComplexity int) int Content func(childComplexity int) int CreatedAt func(childComplexity int) int Markdown func(childComplexity int) int ModifiedAt func(childComplexity int) int Name func(childComplexity int) int Tags func(childComplexity int) int Title func(childComplexity int) int Type func(childComplexity int) int } BlogUser struct { ID func(childComplexity int) int Username func(childComplexity int) int } Mutation struct { AmendBlogPost func(childComplexity int, name string, title string, markdown string, typeArg string) int CreateBlogPost func(childComplexity int, post NewBlogPost) int Login func(childComplexity int, account string, password string) int } Query struct { Benchmark func(childComplexity int) int Posts func(childComplexity int, page *Pagination, tag string, category string, length int, name string, regexp string) int Tweets func(childComplexity int, page *Pagination, username string, sort *Sort, topic string, regexp string) int } Tweet struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int IsRetweeted func(childComplexity int) int ReplyTo func(childComplexity int) int RetweetedTweet func(childComplexity int) int Text func(childComplexity int) int Topics func(childComplexity int) int URL func(childComplexity int) int User func(childComplexity int) int } TwitterUser struct { Description func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int ScreenName func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶ added in v0.3.0
type MutationResolver interface { CreateBlogPost(ctx context.Context, post NewBlogPost) (*blog.Post, error) Login(ctx context.Context, account string, password string) (*blog.User, error) AmendBlogPost(ctx context.Context, name string, title string, markdown string, typeArg string) (*blog.Post, error) }
type NewBlogPost ¶ added in v0.3.0
type Pagination ¶
type QueryResolver ¶
type QueryResolver interface { Benchmark(ctx context.Context) (string, error) Tweets(ctx context.Context, page *Pagination, username string, sort *Sort, topic string, regexp string) ([]*twitter.Tweet, error) Posts(ctx context.Context, page *Pagination, tag string, category string, length int, name string, regexp string) ([]*blog.Post, error) }
type Resolver ¶
type Resolver struct{}
func (*Resolver) BlogPost ¶ added in v0.2.1
func (r *Resolver) BlogPost() BlogPostResolver
func (*Resolver) BlogUser ¶ added in v0.2.1
func (r *Resolver) BlogUser() BlogUserResolver
func (*Resolver) Mutation ¶ added in v0.3.0
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
func (*Resolver) Tweet ¶
func (r *Resolver) Tweet() TweetResolver
func (*Resolver) TwitterUser ¶
func (r *Resolver) TwitterUser() TwitterUserResolver
type ResolverRoot ¶
type ResolverRoot interface { BlogPost() BlogPostResolver BlogUser() BlogUserResolver Mutation() MutationResolver Query() QueryResolver Tweet() TweetResolver TwitterUser() TwitterUserResolver }
type SortOrder ¶ added in v0.4.3
type SortOrder string
func (SortOrder) MarshalGQL ¶ added in v0.4.3
func (*SortOrder) UnmarshalGQL ¶ added in v0.4.3
type TweetResolver ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.