Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyChanges(changes map[string]interface{}, to interface{}) error
- func DeleteAllCommentsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
- func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
- func GetLoaders(db *DB) map[string]*dataloader.Loader
- func Marshal_Any(v interface{}) graphql.Marshaler
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func Unmarshal_Any(v interface{}) (interface{}, error)
- type Comment
- func CreateCommentHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Comment, err error)
- func DeleteCommentHandler(ctx context.Context, r *GeneratedResolver, id string) (item *Comment, err error)
- func QueryCommentHandler(ctx context.Context, r *GeneratedResolver, opts QueryCommentHandlerOptions) (*Comment, error)
- func UpdateCommentHandler(ctx context.Context, r *GeneratedResolver, id string, ...) (item *Comment, err error)
- type CommentChanges
- type CommentFilterType
- func (f *CommentFilterType) AndWith(f2 ...*CommentFilterType) *CommentFilterType
- func (f *CommentFilterType) Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, ...) error
- func (f *CommentFilterType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, wheres *[]string, ...) error
- func (f *CommentFilterType) IsEmpty(ctx context.Context, dialect gorm.Dialect) bool
- func (f *CommentFilterType) OrWith(f2 ...*CommentFilterType) *CommentFilterType
- func (f *CommentFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
- type CommentQueryFilter
- type CommentResultType
- type CommentResultTypeResolver
- type CommentSortType
- type ComplexityRoot
- type Config
- type DB
- type DirectiveRoot
- type GeneratedCommentResultTypeResolver
- type GeneratedMutationResolver
- func (r *GeneratedMutationResolver) CreateComment(ctx context.Context, input map[string]interface{}) (item *Comment, err error)
- func (r *GeneratedMutationResolver) DeleteAllComments(ctx context.Context) (bool, error)
- func (r *GeneratedMutationResolver) DeleteComment(ctx context.Context, id string) (item *Comment, err error)
- func (r *GeneratedMutationResolver) UpdateComment(ctx context.Context, id string, input map[string]interface{}) (item *Comment, err error)
- type GeneratedQueryResolver
- type GeneratedResolver
- type JWTClaims
- type MutationResolver
- type NotFoundError
- type QueryCommentHandlerOptions
- type QueryCommentsHandlerOptions
- type QueryResolver
- type ResolutionHandlers
- type ResolverRoot
Constants ¶
Variables ¶
View Source
var AllCommentSortType = []CommentSortType{ CommentSortTypeIDAsc, CommentSortTypeIDDesc, CommentSortTypeTextAsc, CommentSortTypeTextDesc, CommentSortTypeReferenceAsc, CommentSortTypeReferenceDesc, CommentSortTypeReferenceIDAsc, CommentSortTypeReferenceIDDesc, CommentSortTypeUpdatedAtAsc, CommentSortTypeUpdatedAtDesc, CommentSortTypeCreatedAtAsc, CommentSortTypeCreatedAtDesc, CommentSortTypeUpdatedByAsc, CommentSortTypeUpdatedByDesc, CommentSortTypeCreatedByAsc, CommentSortTypeCreatedByDesc, }
Functions ¶
func ApplyChanges ¶
used to convert map[string]interface{} to EntityChanges struct
func DeleteAllCommentsHandler ¶
func DeleteAllCommentsHandler(ctx context.Context, r *GeneratedResolver) (bool, error)
func GetHTTPServeMux ¶
func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux
func GetLoaders ¶
func GetLoaders(db *DB) map[string]*dataloader.Loader
func Marshal_Any ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func Unmarshal_Any ¶
func Unmarshal_Any(v interface{}) (interface{}, error)
Types ¶
type Comment ¶
type Comment struct { ID string `json:"id" gorm:"column:id;primary_key"` Text *string `json:"text" gorm:"column:text;type:text"` Reference *string `json:"reference" gorm:"column:reference"` ReferenceID *string `json:"referenceID" gorm:"column:referenceID"` UpdatedAt *time.Time `json:"updatedAt" gorm:"column:updatedAt"` CreatedAt time.Time `json:"createdAt" gorm:"column:createdAt"` UpdatedBy *string `json:"updatedBy" gorm:"column:updatedBy"` CreatedBy *string `json:"createdBy" gorm:"column:createdBy"` }
func CreateCommentHandler ¶
func DeleteCommentHandler ¶
func QueryCommentHandler ¶
func QueryCommentHandler(ctx context.Context, r *GeneratedResolver, opts QueryCommentHandlerOptions) (*Comment, error)
func UpdateCommentHandler ¶
type CommentChanges ¶
type CommentFilterType ¶
type CommentFilterType struct { And []*CommentFilterType `json:"AND"` Or []*CommentFilterType `json:"OR"` ID *string `json:"id"` IDNe *string `json:"id_ne"` IDGt *string `json:"id_gt"` IDLt *string `json:"id_lt"` IDGte *string `json:"id_gte"` IDLte *string `json:"id_lte"` IDIn []string `json:"id_in"` Text *string `json:"text"` TextNe *string `json:"text_ne"` TextGt *string `json:"text_gt"` TextLt *string `json:"text_lt"` TextGte *string `json:"text_gte"` TextLte *string `json:"text_lte"` TextIn []string `json:"text_in"` TextLike *string `json:"text_like"` TextPrefix *string `json:"text_prefix"` TextSuffix *string `json:"text_suffix"` Reference *string `json:"reference"` ReferenceNe *string `json:"reference_ne"` ReferenceGt *string `json:"reference_gt"` ReferenceLt *string `json:"reference_lt"` ReferenceGte *string `json:"reference_gte"` ReferenceLte *string `json:"reference_lte"` ReferenceIn []string `json:"reference_in"` ReferenceLike *string `json:"reference_like"` ReferencePrefix *string `json:"reference_prefix"` ReferenceSuffix *string `json:"reference_suffix"` ReferenceID *string `json:"referenceID"` ReferenceIDNe *string `json:"referenceID_ne"` ReferenceIDGt *string `json:"referenceID_gt"` ReferenceIDLt *string `json:"referenceID_lt"` ReferenceIDGte *string `json:"referenceID_gte"` ReferenceIDLte *string `json:"referenceID_lte"` ReferenceIDIn []string `json:"referenceID_in"` UpdatedAt *time.Time `json:"updatedAt"` UpdatedAtNe *time.Time `json:"updatedAt_ne"` UpdatedAtGt *time.Time `json:"updatedAt_gt"` UpdatedAtLt *time.Time `json:"updatedAt_lt"` UpdatedAtGte *time.Time `json:"updatedAt_gte"` UpdatedAtLte *time.Time `json:"updatedAt_lte"` UpdatedAtIn []*time.Time `json:"updatedAt_in"` CreatedAt *time.Time `json:"createdAt"` CreatedAtNe *time.Time `json:"createdAt_ne"` CreatedAtGt *time.Time `json:"createdAt_gt"` CreatedAtLt *time.Time `json:"createdAt_lt"` CreatedAtGte *time.Time `json:"createdAt_gte"` CreatedAtLte *time.Time `json:"createdAt_lte"` CreatedAtIn []*time.Time `json:"createdAt_in"` UpdatedBy *string `json:"updatedBy"` UpdatedByNe *string `json:"updatedBy_ne"` UpdatedByGt *string `json:"updatedBy_gt"` UpdatedByLt *string `json:"updatedBy_lt"` UpdatedByGte *string `json:"updatedBy_gte"` UpdatedByLte *string `json:"updatedBy_lte"` UpdatedByIn []string `json:"updatedBy_in"` CreatedBy *string `json:"createdBy"` CreatedByNe *string `json:"createdBy_ne"` CreatedByGt *string `json:"createdBy_gt"` CreatedByLt *string `json:"createdBy_lt"` CreatedByGte *string `json:"createdBy_gte"` CreatedByLte *string `json:"createdBy_lte"` CreatedByIn []string `json:"createdBy_in"` }
func (*CommentFilterType) AndWith ¶
func (f *CommentFilterType) AndWith(f2 ...*CommentFilterType) *CommentFilterType
AndWith convenience method for combining two or more filters with AND statement
func (*CommentFilterType) ApplyWithAlias ¶
func (*CommentFilterType) OrWith ¶
func (f *CommentFilterType) OrWith(f2 ...*CommentFilterType) *CommentFilterType
OrWith convenience method for combining two or more filters with OR statement
func (*CommentFilterType) WhereContent ¶
func (f *CommentFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})
type CommentQueryFilter ¶
type CommentQueryFilter struct {
Query *string
}
type CommentResultType ¶
type CommentResultType struct {
resolvers.EntityResultType
}
func QueryCommentsHandler ¶
func QueryCommentsHandler(ctx context.Context, r *GeneratedResolver, opts QueryCommentsHandlerOptions) (*CommentResultType, error)
type CommentResultTypeResolver ¶
type CommentResultTypeResolver interface { Items(ctx context.Context, obj *CommentResultType) ([]*Comment, error) Count(ctx context.Context, obj *CommentResultType) (int, error) }
type CommentSortType ¶
type CommentSortType string
const ( CommentSortTypeIDAsc CommentSortType = "ID_ASC" CommentSortTypeIDDesc CommentSortType = "ID_DESC" CommentSortTypeTextAsc CommentSortType = "TEXT_ASC" CommentSortTypeTextDesc CommentSortType = "TEXT_DESC" CommentSortTypeReferenceAsc CommentSortType = "REFERENCE_ASC" CommentSortTypeReferenceDesc CommentSortType = "REFERENCE_DESC" CommentSortTypeReferenceIDAsc CommentSortType = "REFERENCE_ID_ASC" CommentSortTypeReferenceIDDesc CommentSortType = "REFERENCE_ID_DESC" CommentSortTypeUpdatedAtAsc CommentSortType = "UPDATED_AT_ASC" CommentSortTypeUpdatedAtDesc CommentSortType = "UPDATED_AT_DESC" CommentSortTypeCreatedAtAsc CommentSortType = "CREATED_AT_ASC" CommentSortTypeCreatedAtDesc CommentSortType = "CREATED_AT_DESC" CommentSortTypeUpdatedByAsc CommentSortType = "UPDATED_BY_ASC" CommentSortTypeUpdatedByDesc CommentSortType = "UPDATED_BY_DESC" CommentSortTypeCreatedByAsc CommentSortType = "CREATED_BY_ASC" CommentSortTypeCreatedByDesc CommentSortType = "CREATED_BY_DESC" )
func (CommentSortType) IsValid ¶
func (e CommentSortType) IsValid() bool
func (CommentSortType) MarshalGQL ¶
func (e CommentSortType) MarshalGQL(w io.Writer)
func (CommentSortType) String ¶
func (e CommentSortType) String() string
func (*CommentSortType) UnmarshalGQL ¶
func (e *CommentSortType) UnmarshalGQL(v interface{}) error
type ComplexityRoot ¶
type ComplexityRoot struct { Comment struct { CreatedAt func(childComplexity int) int CreatedBy func(childComplexity int) int ID func(childComplexity int) int Reference func(childComplexity int) int ReferenceID func(childComplexity int) int Text func(childComplexity int) int UpdatedAt func(childComplexity int) int UpdatedBy func(childComplexity int) int } CommentResultType struct { Count func(childComplexity int) int Items func(childComplexity int) int } Mutation struct { CreateComment func(childComplexity int, input map[string]interface{}) int DeleteAllComments func(childComplexity int) int DeleteComment func(childComplexity int, id string) int UpdateComment func(childComplexity int, id string, input map[string]interface{}) int } Query struct { Comment func(childComplexity int, id *string, q *string, filter *CommentFilterType) int Comments func(childComplexity int, offset *int, limit *int, q *string, sort []CommentSortType, filter *CommentFilterType) int // contains filtered or unexported fields } // contains filtered or unexported fields }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB ...
func NewDBFromEnvVars ¶
func NewDBFromEnvVars() *DB
NewDBFromEnvVars Create database client using DATABASE_URL environment variable
type DirectiveRoot ¶
type DirectiveRoot struct { }
type GeneratedCommentResultTypeResolver ¶
type GeneratedCommentResultTypeResolver struct{ *GeneratedResolver }
func (*GeneratedCommentResultTypeResolver) Count ¶
func (r *GeneratedCommentResultTypeResolver) Count(ctx context.Context, obj *CommentResultType) (count int, err error)
func (*GeneratedCommentResultTypeResolver) Items ¶
func (r *GeneratedCommentResultTypeResolver) Items(ctx context.Context, obj *CommentResultType) (items []*Comment, err error)
type GeneratedMutationResolver ¶
type GeneratedMutationResolver struct{ *GeneratedResolver }
func (*GeneratedMutationResolver) CreateComment ¶
func (*GeneratedMutationResolver) DeleteAllComments ¶
func (r *GeneratedMutationResolver) DeleteAllComments(ctx context.Context) (bool, error)
func (*GeneratedMutationResolver) DeleteComment ¶
func (*GeneratedMutationResolver) UpdateComment ¶
type GeneratedQueryResolver ¶
type GeneratedQueryResolver struct{ *GeneratedResolver }
func (*GeneratedQueryResolver) Comment ¶
func (r *GeneratedQueryResolver) Comment(ctx context.Context, id *string, q *string, filter *CommentFilterType) (*Comment, error)
func (*GeneratedQueryResolver) Comments ¶
func (r *GeneratedQueryResolver) Comments(ctx context.Context, offset *int, limit *int, q *string, sort []CommentSortType, filter *CommentFilterType) (*CommentResultType, error)
type GeneratedResolver ¶
type GeneratedResolver struct { Handlers ResolutionHandlers DB *DB EventController *events.EventController }
type JWTClaims ¶
type JWTClaims struct { jwtgo.StandardClaims Scope *string }
type MutationResolver ¶
type MutationResolver interface { CreateComment(ctx context.Context, input map[string]interface{}) (*Comment, error) UpdateComment(ctx context.Context, id string, input map[string]interface{}) (*Comment, error) DeleteComment(ctx context.Context, id string) (*Comment, error) DeleteAllComments(ctx context.Context) (bool, error) }
type NotFoundError ¶
type NotFoundError struct {
Entity string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type QueryCommentHandlerOptions ¶
type QueryCommentHandlerOptions struct { ID *string Q *string Filter *CommentFilterType }
type QueryCommentsHandlerOptions ¶
type QueryCommentsHandlerOptions struct { Offset *int Limit *int Q *string Sort []CommentSortType Filter *CommentFilterType }
type QueryResolver ¶
type QueryResolver interface { Comment(ctx context.Context, id *string, q *string, filter *CommentFilterType) (*Comment, error) Comments(ctx context.Context, offset *int, limit *int, q *string, sort []CommentSortType, filter *CommentFilterType) (*CommentResultType, error) // contains filtered or unexported methods }
type ResolutionHandlers ¶
type ResolutionHandlers struct { CreateComment func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Comment, err error) UpdateComment func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Comment, err error) DeleteComment func(ctx context.Context, r *GeneratedResolver, id string) (item *Comment, err error) DeleteAllComments func(ctx context.Context, r *GeneratedResolver) (bool, error) QueryComment func(ctx context.Context, r *GeneratedResolver, opts QueryCommentHandlerOptions) (*Comment, error) QueryComments func(ctx context.Context, r *GeneratedResolver, opts QueryCommentsHandlerOptions) (*CommentResultType, error) }
func DefaultResolutionHandlers ¶
func DefaultResolutionHandlers() ResolutionHandlers
type ResolverRoot ¶
type ResolverRoot interface { CommentResultType() CommentResultTypeResolver Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.