model

package
v0.0.0-...-77b0776 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllLanguages = []Languages{
	LanguagesFr,
	LanguagesEn,
}

Functions

This section is empty.

Types

type Language

type Language struct {
	ID        gqlutil.ID `json:"id"`
	Name      string     `json:"name"`
	ImageUUID gqlutil.UUID
}

Language represents the Language type in GraphQL

type Languages

type Languages string
const (
	LanguagesFr Languages = "FR"
	LanguagesEn Languages = "EN"
)

func (Languages) IsValid

func (e Languages) IsValid() bool

func (Languages) MarshalGQL

func (e Languages) MarshalGQL(w io.Writer)

func (Languages) String

func (e Languages) String() string

func (*Languages) UnmarshalGQL

func (e *Languages) UnmarshalGQL(v interface{}) error

type Mutation

type Mutation struct {
}

type PrivateUser

type PrivateUser struct {
	UserInfo *User `json:"userInfo"`
}

PrivateUser represents the logged in user

func NewUserPrivateFromDB

func NewUserPrivateFromDB(user repository.User) *PrivateUser

NewUserPrivateFromDB create a new User from a repository.User struct

type Query

type Query struct {
}

type User

type User struct {
	UUID gqlutil.UUID `json:"uuid"`
	Name string       `json:"name"`
}

User represents the User type in GraphQL

func NewUserFromDB

func NewUserFromDB(user repository.User) *User

NewUserFromDB create a new User from a repository.User struct

type UserConnection

type UserConnection struct {
	PageInfo *gqlutil.PageInfo `json:"pageInfo"`
	Edges    []*UserEdge       `json:"edges"`
}

type UserEdge

type UserEdge struct {
	Cursor string `json:"cursor"`
	Node   *User  `json:"node"`
}

UserEdge represents the UserEdge type in GraphQL

func NewUserEdgesFromModel

func NewUserEdgesFromModel(users []*User) []*UserEdge

NewUserEdgesFromModel creates new []*UserEdge from a []*User

type UserUpdateInput

type UserUpdateInput struct {
	Name *string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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