gqlgen

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type Auth

type Auth struct {
	Token   string    `json:"token"`
	Expires time.Time `json:"expires"`
}

type ComplexityRoot

type ComplexityRoot struct {
	Auth struct {
		Expires func(childComplexity int) int
		Token   func(childComplexity int) int
	}

	CreateUserPayload struct {
		Auth func(childComplexity int) int
		User func(childComplexity int) int
	}

	DecodeImagePayload struct {
		Data func(childComplexity int) int
	}

	EncodeImagePayload struct {
		File func(childComplexity int) int
	}

	FileType struct {
		Content func(childComplexity int) int
		Name    func(childComplexity int) int
	}

	Image struct {
		CreatedAt func(childComplexity int) int
		File      func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	ImageEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	ImagesConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	LoginPayload struct {
		Auth func(childComplexity int) int
		User func(childComplexity int) int
	}

	Mutation struct {
		CreateUser   func(childComplexity int, input NewUser) int
		DecodeImage  func(childComplexity int, input DecodeImageInput) int
		EncodeImage  func(childComplexity int, input EncodeImageInput) int
		Login        func(childComplexity int, input Login) int
		RefreshToken func(childComplexity int, input RefreshTokenInput) int
		UpdateUser   func(childComplexity int, input UpdateUser) int
	}

	OverviewPayload struct {
		User func(childComplexity int) int
	}

	PageInfo struct {
		EndCursor       func(childComplexity int) int
		HasNextPage     func(childComplexity int) int
		HasPreviousPage func(childComplexity int) int
		StartCursor     func(childComplexity int) int
	}

	Query struct {
		Image    func(childComplexity int, id ulid.ID) int
		Images   func(childComplexity int, after *ent.Cursor, first *int, before *ent.Cursor, last *int, where *ent.ImageWhereInput, orderBy *ent.ImageOrder) int
		Overview func(childComplexity int) int
	}

	RefreshTokenPayload struct {
		Auth func(childComplexity int) int
		User func(childComplexity int) int
	}

	UpdateUserPayload struct {
		User func(childComplexity int) int
	}

	User struct {
		CreatedAt func(childComplexity int) int
		Email     func(childComplexity int) int
		ID        func(childComplexity int) int
		LastLogin func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		Username  func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type CreateUserPayload

type CreateUserPayload struct {
	User *ent.User `json:"user"`
	Auth *Auth     `json:"auth"`
}

type DecodeImageInput

type DecodeImageInput struct {
	EncryptionKey *string        `json:"encryptionKey"`
	Upload        graphql.Upload `json:"upload"`
}

type DecodeImagePayload

type DecodeImagePayload struct {
	Data string `json:"data"`
}

type DirectiveRoot

type DirectiveRoot struct{}

type EncodeImageInput

type EncodeImageInput struct {
	Data             string         `json:"data"`
	EncryptionKey    *string        `json:"encryptionKey"`
	LsbUsed          int            `json:"lsbUsed"`
	Channel          util.Channel   `json:"channel"`
	EvenDistribution bool           `json:"evenDistribution"`
	Upload           graphql.Upload `json:"upload"`
}

type EncodeImagePayload

type EncodeImagePayload struct {
	File *FileType `json:"file"`
}

type FileType

type FileType struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

type ImageResolver

type ImageResolver interface {
	File(ctx context.Context, obj *ent.Image) (*FileType, error)
}

type ImagesConnection

type ImagesConnection struct {
	TotalCount int              `json:"totalCount"`
	PageInfo   *ent.PageInfo    `json:"pageInfo"`
	Edges      []*ent.ImageEdge `json:"edges"`
}

type Login

type Login struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginPayload

type LoginPayload struct {
	User *ent.User `json:"user"`
	Auth *Auth     `json:"auth"`
}

type MutationResolver

type MutationResolver interface {
	EncodeImage(ctx context.Context, input EncodeImageInput) (*EncodeImagePayload, error)
	DecodeImage(ctx context.Context, input DecodeImageInput) (*DecodeImagePayload, error)
	CreateUser(ctx context.Context, input NewUser) (*CreateUserPayload, error)
	UpdateUser(ctx context.Context, input UpdateUser) (*UpdateUserPayload, error)
	Login(ctx context.Context, input Login) (*LoginPayload, error)
	RefreshToken(ctx context.Context, input RefreshTokenInput) (*RefreshTokenPayload, error)
}

type NewUser

type NewUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type OverviewPayload

type OverviewPayload struct {
	User *ent.User `json:"user"`
}

type QueryResolver

type QueryResolver interface {
	Image(ctx context.Context, id ulid.ID) (*ent.Image, error)
	Images(ctx context.Context, after *ent.Cursor, first *int, before *ent.Cursor, last *int, where *ent.ImageWhereInput, orderBy *ent.ImageOrder) (*ImagesConnection, error)
	Overview(ctx context.Context) (*OverviewPayload, error)
}

type RefreshTokenInput

type RefreshTokenInput struct {
	Token string `json:"token"`
}

type RefreshTokenPayload

type RefreshTokenPayload struct {
	User *ent.User `json:"user"`
	Auth *Auth     `json:"auth"`
}

type ResolverRoot

type ResolverRoot interface {
	Image() ImageResolver
	Mutation() MutationResolver
	Query() QueryResolver
	User() UserResolver
}

type UpdateUser

type UpdateUser struct {
	Username *string `json:"username"`
	Email    *string `json:"email"`
	Password *string `json:"password"`
}

type UpdateUserPayload

type UpdateUserPayload struct {
	User *ent.User `json:"user"`
}

type UserResolver

type UserResolver interface {
	Username(ctx context.Context, obj *ent.User) (string, error)
}

Jump to

Keyboard shortcuts

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