graphql

package
v0.0.0-...-a9a9e39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthenticated = errors.New("You are not logged in")
	ErrPasswordToWeak   = errors.New("Password does not meet requirements")
)
View Source
var Handler = &handler{Schema: graphql.MustParseSchema(schema, &Query{})}

Functions

func Init

func Init(s *fiber.App)

func PlaygroundHandler

func PlaygroundHandler(c *fiber.Ctx) error

Types

type Course

type Course struct {
	// contains filtered or unexported fields
}

func (*Course) CreatedAt

func (c *Course) CreatedAt() graphql.Time

func (*Course) ID

func (c *Course) ID() string

func (*Course) Instructors

func (c *Course) Instructors(ctx context.Context) ([]*User, error)

func (*Course) Label

func (c *Course) Label() string

func (*Course) Students

func (c *Course) Students(ctx context.Context) ([]*User, error)

func (*Course) UpdatedAt

func (c *Course) UpdatedAt() graphql.Time

type Filter

type Filter struct {
	First int32
	Skip  int32
}

type LoginInput

type LoginInput struct {
	Input struct {
		Username string
		Password string
	}
}

type LoginPayload

type LoginPayload struct {
	// contains filtered or unexported fields
}

func (*LoginPayload) Token

func (l *LoginPayload) Token() string

func (*LoginPayload) User

func (l *LoginPayload) User() *User

type Query

type Query struct{}

func (*Query) AddCourse

func (_ *Query) AddCourse(c context.Context, args struct{ Input *models.Course }) (*Course, error)

func (*Query) AddUser

func (_ *Query) AddUser(c context.Context, args struct{ Input *models.User }) (*User, error)

func (*Query) CountCourses

func (_ *Query) CountCourses(c context.Context) (int32, error)

func (*Query) CountFiles

func (_ *Query) CountFiles(c context.Context) (int32, error)

func (*Query) CountUsers

func (_ *Query) CountUsers(c context.Context) (int32, error)

func (*Query) Course

func (_ *Query) Course(c context.Context, args struct{ ID string }) (*Course, error)

func (*Query) Courses

func (_ *Query) Courses(c context.Context) (courses []*Course, err error)

func (*Query) Login

func (_ *Query) Login(c context.Context, args *LoginInput) (*LoginPayload, error)

func (*Query) UpdatePassword

func (_ *Query) UpdatePassword(c context.Context, args *UpdatePasswordInput) (string, error)

func (*Query) User

func (_ *Query) User(c context.Context, args struct{ ID string }) (*User, error)

func (*Query) Users

func (_ *Query) Users(c context.Context, args struct {
	Page    int32
	PerPage int32
	Sort    string
}) (users []*User, err error)

type Request

type Request struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

type UpdatePasswordInput

type UpdatePasswordInput struct {
	Input struct {
		UserID   string
		Password string
	}
}

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) CreatedAt

func (u *User) CreatedAt() graphql.Time

func (*User) FirstName

func (u *User) FirstName() string

func (*User) ID

func (u *User) ID() string

func (*User) LastLogin

func (u *User) LastLogin() graphql.Time

func (*User) LastName

func (u *User) LastName() string

func (*User) Type

func (u *User) Type() string

func (*User) UpdatedAt

func (u *User) UpdatedAt() graphql.Time

func (*User) Username

func (u *User) Username() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL