Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UserGraphQL = graphql.NewObject( graphql.ObjectConfig{ Name: "User", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.String, }, "name": &graphql.Field{ Type: graphql.String, }, "email": &graphql.Field{ Type: graphql.String, }, "phone": &graphql.Field{ Type: graphql.String, }, "address": &graphql.Field{ Type: graphql.String, }, "created_at": &graphql.Field{ Type: graphql.DateTime, }, "updated_at": &graphql.Field{ Type: graphql.DateTime, }, }, }, )
UserGraphQL holds user information with graphql object
View Source
var UserListGraphQL = graphql.NewObject( graphql.ObjectConfig{ Name: "UserList", Fields: graphql.Fields{ "list": &graphql.Field{ Type: graphql.NewList(UserGraphQL), }, "page": &graphql.Field{ Type: graphql.Int, }, "per_page": &graphql.Field{ Type: graphql.Int, }, "total_page": &graphql.Field{ Type: graphql.Int, }, "total_data": &graphql.Field{ Type: graphql.Int, }, }, }, )
UserListGraphQL holds user list information with graphql object
Functions ¶
Types ¶
type Resolver ¶
type Resolver interface { List(params graphql.ResolveParams) (interface{}, error) Detail(params graphql.ResolveParams) (interface{}, error) Update(params graphql.ResolveParams) (interface{}, error) Create(params graphql.ResolveParams) (interface{}, error) Delete(params graphql.ResolveParams) (interface{}, error) }
Resolver represent the graphql resolver
func NewResolver ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is struct which has method for Query and Mutation. Please init this struct using constructor function.
Click to show internal directories.
Click to hide internal directories.