Documentation
¶
Index ¶
- Variables
- type Author
- type AuthorArgs
- type AuthorResolver
- type AuthorsArgs
- type Content
- type ContentArgs
- type ContentResolver
- type ContentsArgs
- type Group
- type GroupArgs
- type GroupResolver
- type GroupsArgs
- type RootResolver
- func (*RootResolver) Author(args AuthorArgs) AuthorResolver
- func (*RootResolver) Authors(args AuthorsArgs) *[]*AuthorResolver
- func (*RootResolver) Content(args ContentArgs) ContentResolver
- func (*RootResolver) Contents(args ContentsArgs) []*ContentResolver
- func (*RootResolver) Group(args GroupArgs) GroupResolver
- func (*RootResolver) Groups(args GroupsArgs) *[]*GroupResolver
- func (*RootResolver) TWL(args TWLArgs) TWLResolver
- func (*RootResolver) TWLs(args TWLsArgs) *[]*TWLResolver
- type TWL
- type TWLArgs
- type TWLResolver
- type TWLsArgs
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Authors = []Author{ Author{ ID: "0", Name: "DoLim", ProfileImage: "https://api.adorable.io/avatars/285/dolim", Groups: []*graphql.ID{&zero, &two}, }, Author{ ID: "1", Name: "Collin", ProfileImage: "https://api.adorable.io/avatars/285/collin", Groups: []*graphql.ID{&zero, &one}, }, Author{ ID: "2", Name: "John", ProfileImage: "https://api.adorable.io/avatars/285/john", Groups: []*graphql.ID{&one, &two}, }, }
Authors is dummy data of Author
View Source
var Contents = []Content{ Content{ ID: "0", TWLID: "0", AuthorID: "0", CreatedAt: "2020-04-07", ModifiedAt: "2020-04-07", Text: "First study of DoLim", }, Content{ ID: "1", TWLID: "0", AuthorID: "1", CreatedAt: "2020-04-07", ModifiedAt: "2020-04-07", Text: "First study of Collin", }, Content{ ID: "2", TWLID: "1", AuthorID: "1", CreatedAt: "2020-04-07", ModifiedAt: "2020-04-07", Text: "First exercise of Collin", }, Content{ ID: "3", TWLID: "1", AuthorID: "2", CreatedAt: "2020-04-07", ModifiedAt: "2020-04-07", Text: "First exercise of John", }, Content{ ID: "4", TWLID: "0", AuthorID: "0", CreatedAt: "2020-04-08", ModifiedAt: "2020-04-08", Text: "Second study of DoLim", }, Content{ ID: "5", TWLID: "0", AuthorID: "1", CreatedAt: "2020-04-08", ModifiedAt: "2020-04-08", Text: "Second study of Collin", }, Content{ ID: "6", TWLID: "1", AuthorID: "1", CreatedAt: "2020-04-08", ModifiedAt: "2020-04-08", Text: "Second exercise of Collin", }, Content{ ID: "7", TWLID: "1", AuthorID: "2", CreatedAt: "2020-04-08", ModifiedAt: "2020-04-08", Text: "Second exercise of John", }, Content{ ID: "8", TWLID: "0", AuthorID: "0", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "Third study of DoLim", }, Content{ ID: "9", TWLID: "0", AuthorID: "1", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "Third study of Collin", }, Content{ ID: "10", TWLID: "1", AuthorID: "1", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "Third exercise of Collin", }, Content{ ID: "11", TWLID: "1", AuthorID: "2", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "Third exercise of John", }, Content{ ID: "12", TWLID: "2", AuthorID: "0", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "First Coffee of Dolim", }, Content{ ID: "13", TWLID: "2", AuthorID: "2", CreatedAt: "2020-04-09", ModifiedAt: "2020-04-09", Text: "First Coffee of John", }, }
Contents is dummy data of Content
View Source
var Groups = []Group{ Group{ ID: "0", Title: "Study", Description: "Group for Studying", Member: []*graphql.ID{&zero, &one}, }, Group{ ID: "1", Title: "Exercise", Description: "Group for Exercise", Member: []*graphql.ID{&one, &two}, }, Group{ ID: "2", Title: "Coffee", Description: "Group for making Coffee", Member: []*graphql.ID{&zero, &two}, }, }
Groups is dummy data of Group
View Source
var TWLs = []TWL{ TWL{ ID: "0", GroupID: "0", Date: "2020-04-07", }, TWL{ ID: "1", GroupID: "1", Date: "2020-04-07", }, TWL{ ID: "2", GroupID: "0", Date: "2020-04-08", }, TWL{ ID: "3", GroupID: "1", Date: "2020-04-08", }, TWL{ ID: "4", GroupID: "0", Date: "2020-04-09", }, TWL{ ID: "5", GroupID: "1", Date: "2020-04-09", }, TWL{ ID: "6", GroupID: "2", Date: "2020-04-09", }, }
TWLs is dummy data of TWL
Functions ¶
This section is empty.
Types ¶
type Author ¶
Author schema struct
func GetAuthors ¶
func GetAuthors(groupID graphql.ID) []Author
GetAuthors from DB
Example ¶
res := GetAuthors("0") fmt.Println(res)
Output: [{0 DoLim https://api.adorable.io/avatars/285/dolim [0 2]} {1 Collin https://api.adorable.io/avatars/285/collin [0 1]}]
type AuthorResolver ¶
type AuthorResolver struct {
// contains filtered or unexported fields
}
AuthorResolver is resolver of Author
func (AuthorResolver) ProfileImage ¶
func (r AuthorResolver) ProfileImage() *string
ProfileImage of Author
type Content ¶
type Content struct { ID graphql.ID TWLID graphql.ID AuthorID graphql.ID CreatedAt string ModifiedAt string Text string }
Content schema struct
type ContentResolver ¶
type ContentResolver struct {
// contains filtered or unexported fields
}
ContentResolver is resolver of Content
func (*ContentResolver) AuthorID ¶
func (r *ContentResolver) AuthorID() graphql.ID
AuthorID of Content
func (*ContentResolver) CreatedAt ¶
func (r *ContentResolver) CreatedAt() string
CreatedAt of Content
func (*ContentResolver) ModifiedAt ¶
func (r *ContentResolver) ModifiedAt() string
ModifiedAt of Content
type Group ¶
type Group struct { ID graphql.ID Title string Description string Member []*graphql.ID TWLs []*graphql.ID }
Group schema struct
type GroupResolver ¶
type GroupResolver struct {
// contains filtered or unexported fields
}
GroupResolver is resolver of Group
func (*GroupResolver) Description ¶
func (r *GroupResolver) Description() string
Description of Group
type RootResolver ¶
type RootResolver struct{}
RootResolver struct
func (*RootResolver) Author ¶
func (*RootResolver) Author(args AuthorArgs) AuthorResolver
Author query resolver
func (*RootResolver) Authors ¶
func (*RootResolver) Authors(args AuthorsArgs) *[]*AuthorResolver
Authors query resolver
func (*RootResolver) Content ¶
func (*RootResolver) Content(args ContentArgs) ContentResolver
Content query resolver
func (*RootResolver) Contents ¶
func (*RootResolver) Contents(args ContentsArgs) []*ContentResolver
Contents query resolver
func (*RootResolver) Group ¶
func (*RootResolver) Group(args GroupArgs) GroupResolver
Group query resolver
func (*RootResolver) Groups ¶
func (*RootResolver) Groups(args GroupsArgs) *[]*GroupResolver
Groups query resolver
func (*RootResolver) TWLs ¶
func (*RootResolver) TWLs(args TWLsArgs) *[]*TWLResolver
TWLs query resolver
type TWL ¶
type TWL struct { ID graphql.ID GroupID graphql.ID Date string Contents []*graphql.ID }
TWL schema struct
type TWLResolver ¶
type TWLResolver struct {
// contains filtered or unexported fields
}
TWLResolver is resolver of TWL
Click to show internal directories.
Click to hide internal directories.