Documentation
¶
Index ¶
- Constants
- func BuildCategorySchema(repository blog.CategoryRepository) func(*schemabuilder.Schema)
- func BuildFileSchema(repository storage.FileRepository) func(*schemabuilder.Schema)
- func BuildGraphAPISchema(baseURL string, c facebook.Client) func(*schemabuilder.Schema)
- func BuildPostSchema(repository blog.PostRepository) func(*schemabuilder.Schema)
- func BuildSchema(buildSchemaFunc ...func(*schemabuilder.Schema)) (*graphql.Schema, error)
- func BuildTagSchema(repository blog.TagRepository) func(*schemabuilder.Schema)
- func CreatePostFieldFunc(repository blog.PostRepository) interface{}
- func FindAllAttachmentsBelongedToPostFieldFunc(repository storage.FileRepository) interface{}
- func FindAllCategoriesBelongedToPostFieldFunc(repository blog.CategoryRepository) interface{}
- func FindAllCategoriesFieldFunc(repository blog.CategoryRepository) interface{}
- func FindAllLPPBelongedToCategoryFieldFunc(repository blog.PostRepository) interface{}
- func FindAllLPPBelongedToTagFieldFunc(repository blog.PostRepository) interface{}
- func FindAllLatestPublishedPostsFieldFunc(repository blog.PostRepository) interface{}
- func FindAllMyPostsFieldFunc(repository blog.PostRepository) interface{}
- func FindAllTagsBelongedToPostFieldFunc(repository blog.TagRepository) interface{}
- func FindAllTagsFieldFunc(repository blog.TagRepository) interface{}
- func FindCategoryBySlugFieldFunc(repository blog.CategoryRepository) interface{}
- func FindFeaturedImageBelongedToPostFieldFunc(repository storage.FileRepository) interface{}
- func FindPostBySlugFieldFunc(repository blog.PostRepository) interface{}
- func FindTagBySlugFieldFunc(repository blog.TagRepository) interface{}
- func GetURLNodeShareCountFieldFunc(baseURL string, c facebook.Client) interface{}
- func Handler(schema *graphql.Schema, middlewares ...graphql.MiddlewareFunc) http.Handler
- func ServeGraphiqlHandlerFunc(tmpl []byte) http.HandlerFunc
- func UpdatePostAttachmentsFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostCategoriesFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostContentFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostFeaturedImageFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostStatusFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostTagsFieldFunc(repository blog.PostRepository) interface{}
- func UpdatePostTitleFieldFunc(repository blog.PostRepository) interface{}
- func VerifyAuthorityMiddleware(input *graphql.ComputationInput, next graphql.MiddlewareNextFunc) *graphql.ComputationOutput
- type Slug
Constants ¶
const AuthorizedID = "authID"
AuthorizedID is a context.Context key where an authorized ID value stored
Variables ¶
This section is empty.
Functions ¶
func BuildCategorySchema ¶
func BuildCategorySchema(repository blog.CategoryRepository) func(*schemabuilder.Schema)
BuildCategorySchema builds all category related schemas
func BuildFileSchema ¶
func BuildFileSchema(repository storage.FileRepository) func(*schemabuilder.Schema)
BuildFileSchema builds all file related schemas
func BuildGraphAPISchema ¶
func BuildGraphAPISchema(baseURL string, c facebook.Client) func(*schemabuilder.Schema)
BuildGraphAPISchema builds all Facebook Graph API related schemas
func BuildPostSchema ¶
func BuildPostSchema(repository blog.PostRepository) func(*schemabuilder.Schema)
BuildPostSchema builds all post related schemas
func BuildSchema ¶
func BuildSchema(buildSchemaFunc ...func(*schemabuilder.Schema)) (*graphql.Schema, error)
BuildSchema accepts build schema function(s) for applying to the schemabuilding.Schema object
func BuildTagSchema ¶
func BuildTagSchema(repository blog.TagRepository) func(*schemabuilder.Schema)
BuildTagSchema builds all tag related schemas
func CreatePostFieldFunc ¶
func CreatePostFieldFunc(repository blog.PostRepository) interface{}
CreatePostFieldFunc handles the following mutation ```graphql
mutation { createPost { ... } }
```
func FindAllAttachmentsBelongedToPostFieldFunc ¶
func FindAllAttachmentsBelongedToPostFieldFunc(repository storage.FileRepository) interface{}
FindAllAttachmentsBelongedToPostFieldFunc handles the following query in the Post type ```graphql
{ Post { ... attachments { ... } } }
```
func FindAllCategoriesBelongedToPostFieldFunc ¶
func FindAllCategoriesBelongedToPostFieldFunc(repository blog.CategoryRepository) interface{}
FindAllCategoriesBelongedToPostFieldFunc handles the following query in the Post type ```graphql
{ Post { ... categories { ... } } }
```
func FindAllCategoriesFieldFunc ¶
func FindAllCategoriesFieldFunc(repository blog.CategoryRepository) interface{}
FindAllCategoriesFieldFunc handles the following query ```graphql
{ categories { ... } }
```
func FindAllLPPBelongedToCategoryFieldFunc ¶
func FindAllLPPBelongedToCategoryFieldFunc(repository blog.PostRepository) interface{}
FindAllLPPBelongedToCategoryFieldFunc handles the following query in the Category type ```graphql
{ Category { ... latestPublishedPosts(offset: int!, limit: int!) { ... } } }
```
func FindAllLPPBelongedToTagFieldFunc ¶
func FindAllLPPBelongedToTagFieldFunc(repository blog.PostRepository) interface{}
FindAllLPPBelongedToTagFieldFunc handles the following query in the Tag type ```graphql
{ Tag { ... latestPublishedPosts(offset: int!, limit: int!) { ... } } }
```
func FindAllLatestPublishedPostsFieldFunc ¶
func FindAllLatestPublishedPostsFieldFunc(repository blog.PostRepository) interface{}
FindAllLatestPublishedPostsFieldFunc handles the following query ```graphql
{ latestPublishedPosts(offset: int!, limit: int!) { ... } }
```
func FindAllMyPostsFieldFunc ¶
func FindAllMyPostsFieldFunc(repository blog.PostRepository) interface{}
FindAllMyPostsFieldFunc handles the following query ```graphql
{ myPosts(offset: int!, limit: int!) { ... } }
```
func FindAllTagsBelongedToPostFieldFunc ¶
func FindAllTagsBelongedToPostFieldFunc(repository blog.TagRepository) interface{}
FindAllTagsBelongedToPostFieldFunc handles the following query in the Post type ```graphql
{ Post { ... tags { ... } } }
```
func FindAllTagsFieldFunc ¶
func FindAllTagsFieldFunc(repository blog.TagRepository) interface{}
FindAllTagsFieldFunc handles the following query ```graphql
{ tags { ... } }
```
func FindCategoryBySlugFieldFunc ¶
func FindCategoryBySlugFieldFunc(repository blog.CategoryRepository) interface{}
FindCategoryBySlugFieldFunc handles the following query ```graphql
{ category(slug: string!) { ... } }
```
func FindFeaturedImageBelongedToPostFieldFunc ¶
func FindFeaturedImageBelongedToPostFieldFunc(repository storage.FileRepository) interface{}
FindFeaturedImageBelongedToPostFieldFunc handles the following query in the Post type ```graphql
{ Post { ... featuredImage { .. } } }
```
func FindPostBySlugFieldFunc ¶
func FindPostBySlugFieldFunc(repository blog.PostRepository) interface{}
FindPostBySlugFieldFunc handles the following query ```graphql
{ post(slug: string!) { ... } }
```
func FindTagBySlugFieldFunc ¶
func FindTagBySlugFieldFunc(repository blog.TagRepository) interface{}
FindTagBySlugFieldFunc handles the following query ```graphql
{ tag(slug: string!) { ... } }
```
func GetURLNodeShareCountFieldFunc ¶
GetURLNodeShareCountFieldFunc handles the following query in the Post type ```graphql
{ Post { ... engagement { ... } } }
```
func Handler ¶
Handler is a wrapped function to the original graphql.HTTPHandler for avoiding package name conflict
func ServeGraphiqlHandlerFunc ¶
func ServeGraphiqlHandlerFunc(tmpl []byte) http.HandlerFunc
ServeGraphiqlHandlerFunc provides a GraphQL Playground page
func UpdatePostAttachmentsFieldFunc ¶
func UpdatePostAttachmentsFieldFunc(repository blog.PostRepository) interface{}
UpdatePostAttachmentsFieldFunc handles the following mutation ```graphql
mutation { updatePostAttachments(slug: string!, attachmentSlugs: [string!]!) { ... } }
```
func UpdatePostCategoriesFieldFunc ¶
func UpdatePostCategoriesFieldFunc(repository blog.PostRepository) interface{}
UpdatePostCategoriesFieldFunc handles the following mutation ```graphql
mutation { updatePostCategories(slug: string!, categorySlugs: [string!]!) { ... } }
```
func UpdatePostContentFieldFunc ¶
func UpdatePostContentFieldFunc(repository blog.PostRepository) interface{}
UpdatePostContentFieldFunc handles the following mutation ```graphql
mutation { updatePostContent(slug: string!, markdown: string!) { ... } }
```
func UpdatePostFeaturedImageFieldFunc ¶
func UpdatePostFeaturedImageFieldFunc(repository blog.PostRepository) interface{}
UpdatePostFeaturedImageFieldFunc handles the following mutation ```graphql
mutation { updatePostFeaturedImage(slug: string!, featuredImageSlug: string!) { ... } }
```
func UpdatePostStatusFieldFunc ¶
func UpdatePostStatusFieldFunc(repository blog.PostRepository) interface{}
UpdatePostStatusFieldFunc handles the following mutation ```graphql
mutation { updatePostStatus(slug: string!, status: Status!) { ... } }
```
func UpdatePostTagsFieldFunc ¶
func UpdatePostTagsFieldFunc(repository blog.PostRepository) interface{}
UpdatePostTagsFieldFunc handles the following mutation ```graphql
mutation { updatePostTags(slug: string!, tags: [string!]!) { ... } }
```
func UpdatePostTitleFieldFunc ¶
func UpdatePostTitleFieldFunc(repository blog.PostRepository) interface{}
UpdatePostTitleFieldFunc handles the following mutation ```graphql
mutation { updatePostTitle(slug: string!, title: string!) { ... } }
```
func VerifyAuthorityMiddleware ¶
func VerifyAuthorityMiddleware(input *graphql.ComputationInput, next graphql.MiddlewareNextFunc) *graphql.ComputationOutput
VerifyAuthorityMiddleware looks on the request header for the authorization token