pub

package
v0.0.0-...-bc55c55 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 16 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 AggregateUser

type AggregateUser struct {
	Count int `json:"count"`
}

type BatchPayload

type BatchPayload struct {
	Count string `json:"count"`
}

type ComplexityRoot

type ComplexityRoot struct {
	AggregateUser struct {
		Count func(childComplexity int) int
	}

	BatchPayload struct {
		Count func(childComplexity int) int
	}

	Error struct {
		Field    func(childComplexity int) int
		Messages func(childComplexity int) int
	}

	Mutation struct {
		CreateUser      func(childComplexity int, data UserCreateInput) int
		UpdateUser      func(childComplexity int, data UserUpdateInput, where UserWhereUniqueInput) int
		UpdateManyUsers func(childComplexity int, data UserUpdateManyMutationInput, where *UserWhereInput) int
		UpsertUser      func(childComplexity int, where UserWhereUniqueInput, create UserCreateInput, update UserUpdateInput) int
		DeleteUser      func(childComplexity int, where UserWhereUniqueInput) int
		DeleteManyUsers func(childComplexity int, where *UserWhereInput) int
	}

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

	PubM struct {
		Login  func(childComplexity int, username string, password string) int
		Signup func(childComplexity int, username string, password string) int
	}

	PubQ struct {
		Country func(childComplexity int) int
	}

	Query struct {
		User            func(childComplexity int, where UserWhereUniqueInput) int
		Users           func(childComplexity int, where *UserWhereInput, orderBy *UserOrderByInput, skip *int, after *string, before *string, first *int, last *int) int
		UsersConnection func(childComplexity int, where *UserWhereInput, orderBy *UserOrderByInput, skip *int, after *string, before *string, first *int, last *int) int
		Node            func(childComplexity int, id string) int
	}

	Session struct {
		Id func(childComplexity int) int
	}

	Status struct {
		Ok     func(childComplexity int) int
		Errors func(childComplexity int) int
	}

	Subscription struct {
		User func(childComplexity int, where *UserSubscriptionWhereInput) int
	}

	User struct {
		Id       func(childComplexity int) int
		Username func(childComplexity int) int
		Password func(childComplexity int) int
	}

	UserConnection struct {
		PageInfo  func(childComplexity int) int
		Edges     func(childComplexity int) int
		Aggregate func(childComplexity int) int
	}

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

	UserPreviousValues struct {
		Id       func(childComplexity int) int
		Username func(childComplexity int) int
		Password func(childComplexity int) int
	}

	UserSubscriptionPayload struct {
		Mutation       func(childComplexity int) int
		Node           func(childComplexity int) int
		UpdatedFields  func(childComplexity int) int
		PreviousValues func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Error

type Error struct {
	Field    string   `json:"field"`
	Messages []string `json:"messages"`
}

type Mutation

type Mutation struct {
	CreateUser      prisma.User  `json:"createUser"`
	UpdateUser      *prisma.User `json:"updateUser"`
	UpdateManyUsers BatchPayload `json:"updateManyUsers"`
	UpsertUser      prisma.User  `json:"upsertUser"`
	DeleteUser      *prisma.User `json:"deleteUser"`
	DeleteManyUsers BatchPayload `json:"deleteManyUsers"`
}

type MutationType

type MutationType string
const (
	MutationTypeCreated MutationType = "CREATED"
	MutationTypeUpdated MutationType = "UPDATED"
	MutationTypeDeleted MutationType = "DELETED"
)

func (MutationType) IsValid

func (e MutationType) IsValid() bool

func (MutationType) MarshalGQL

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

func (MutationType) String

func (e MutationType) String() string

func (*MutationType) UnmarshalGQL

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

type Node

type Node interface {
	IsNode()
}

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *string `json:"startCursor"`
	EndCursor       *string `json:"endCursor"`
}

type PubMResolver

type PubMResolver interface {
	Login(ctx context.Context, username string, password string) (SessionAndStatus, error)
	Signup(ctx context.Context, username string, password string) (UserAndStatus, error)
}

type PubQResolver

type PubQResolver interface {
	Country(ctx context.Context) ([]*string, error)
}

type Query

type Query struct {
	User            *prisma.User   `json:"user"`
	Users           []*prisma.User `json:"users"`
	UsersConnection UserConnection `json:"usersConnection"`
	Node            Node           `json:"node"`
}

type Resolver

type Resolver struct {
	Db      *prisma.Client
	TokConf *gauthConf.Config
}

Resolver is a struct for pub-api reolver

func (*Resolver) PubM

func (r *Resolver) PubM() PubMResolver

PubM indicates a public mutation

func (*Resolver) PubQ

func (r *Resolver) PubQ() PubQResolver

PubQ indicates a public query

func (*Resolver) Subscription

func (r *Resolver) Subscription() SubscriptionResolver

Subscription indicates a public subscription (what??)

type ResolverRoot

type ResolverRoot interface {
	PubM() PubMResolver
	PubQ() PubQResolver
	Subscription() SubscriptionResolver
}

type Session

type Session struct {
	ID string `json:"id"`
}

func (Session) IsSessionAndStatus

func (Session) IsSessionAndStatus()

type SessionAndStatus

type SessionAndStatus interface {
	IsSessionAndStatus()
}

type Status

type Status struct {
	Ok     bool    `json:"ok"`
	Errors []Error `json:"errors"`
}

func (Status) IsSessionAndStatus

func (Status) IsSessionAndStatus()

func (Status) IsUserAndStatus

func (Status) IsUserAndStatus()

type SubscriptionResolver

type SubscriptionResolver interface {
	User(ctx context.Context, where *UserSubscriptionWhereInput) (<-chan *UserSubscriptionPayload, error)
}

type UserAndStatus

type UserAndStatus interface {
	IsUserAndStatus()
}

type UserConnection

type UserConnection struct {
	PageInfo  PageInfo      `json:"pageInfo"`
	Edges     []*UserEdge   `json:"edges"`
	Aggregate AggregateUser `json:"aggregate"`
}

type UserCreateInput

type UserCreateInput struct {
	ID       *string `json:"id"`
	Username string  `json:"username"`
	Password string  `json:"password"`
}

func UnmarshalUserCreateInput

func UnmarshalUserCreateInput(v interface{}) (UserCreateInput, error)

type UserEdge

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

type UserOrderByInput

type UserOrderByInput string
const (
	UserOrderByInputIdAsc        UserOrderByInput = "id_ASC"
	UserOrderByInputIdDesc       UserOrderByInput = "id_DESC"
	UserOrderByInputUsernameAsc  UserOrderByInput = "username_ASC"
	UserOrderByInputUsernameDesc UserOrderByInput = "username_DESC"
	UserOrderByInputPasswordAsc  UserOrderByInput = "password_ASC"
	UserOrderByInputPasswordDesc UserOrderByInput = "password_DESC"
)

func (UserOrderByInput) IsValid

func (e UserOrderByInput) IsValid() bool

func (UserOrderByInput) MarshalGQL

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

func (UserOrderByInput) String

func (e UserOrderByInput) String() string

func (*UserOrderByInput) UnmarshalGQL

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

type UserPreviousValues

type UserPreviousValues struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserSubscriptionPayload

type UserSubscriptionPayload struct {
	Mutation       MutationType        `json:"mutation"`
	Node           *prisma.User        `json:"node"`
	UpdatedFields  []string            `json:"updatedFields"`
	PreviousValues *UserPreviousValues `json:"previousValues"`
}

type UserSubscriptionWhereInput

type UserSubscriptionWhereInput struct {
	MutationIn                 []MutationType               `json:"mutation_in"`
	UpdatedFieldsContains      *string                      `json:"updatedFields_contains"`
	UpdatedFieldsContainsEvery []string                     `json:"updatedFields_contains_every"`
	UpdatedFieldsContainsSome  []string                     `json:"updatedFields_contains_some"`
	Node                       *UserWhereInput              `json:"node"`
	AND                        []UserSubscriptionWhereInput `json:"AND"`
	OR                         []UserSubscriptionWhereInput `json:"OR"`
	NOT                        []UserSubscriptionWhereInput `json:"NOT"`
}

func UnmarshalUserSubscriptionWhereInput

func UnmarshalUserSubscriptionWhereInput(v interface{}) (UserSubscriptionWhereInput, error)

type UserUpdateInput

type UserUpdateInput struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

func UnmarshalUserUpdateInput

func UnmarshalUserUpdateInput(v interface{}) (UserUpdateInput, error)

type UserUpdateManyMutationInput

type UserUpdateManyMutationInput struct {
	Username *string `json:"username"`
	Password *string `json:"password"`
}

func UnmarshalUserUpdateManyMutationInput

func UnmarshalUserUpdateManyMutationInput(v interface{}) (UserUpdateManyMutationInput, error)

type UserWhereInput

type UserWhereInput struct {
	ID                    *string          `json:"id"`
	IDNot                 *string          `json:"id_not"`
	IDIn                  []string         `json:"id_in"`
	IDNotIn               []string         `json:"id_not_in"`
	IDLt                  *string          `json:"id_lt"`
	IDLte                 *string          `json:"id_lte"`
	IDGt                  *string          `json:"id_gt"`
	IDGte                 *string          `json:"id_gte"`
	IDContains            *string          `json:"id_contains"`
	IDNotContains         *string          `json:"id_not_contains"`
	IDStartsWith          *string          `json:"id_starts_with"`
	IDNotStartsWith       *string          `json:"id_not_starts_with"`
	IDEndsWith            *string          `json:"id_ends_with"`
	IDNotEndsWith         *string          `json:"id_not_ends_with"`
	Username              *string          `json:"username"`
	UsernameNot           *string          `json:"username_not"`
	UsernameIn            []string         `json:"username_in"`
	UsernameNotIn         []string         `json:"username_not_in"`
	UsernameLt            *string          `json:"username_lt"`
	UsernameLte           *string          `json:"username_lte"`
	UsernameGt            *string          `json:"username_gt"`
	UsernameGte           *string          `json:"username_gte"`
	UsernameContains      *string          `json:"username_contains"`
	UsernameNotContains   *string          `json:"username_not_contains"`
	UsernameStartsWith    *string          `json:"username_starts_with"`
	UsernameNotStartsWith *string          `json:"username_not_starts_with"`
	UsernameEndsWith      *string          `json:"username_ends_with"`
	UsernameNotEndsWith   *string          `json:"username_not_ends_with"`
	Password              *string          `json:"password"`
	PasswordNot           *string          `json:"password_not"`
	PasswordIn            []string         `json:"password_in"`
	PasswordNotIn         []string         `json:"password_not_in"`
	PasswordLt            *string          `json:"password_lt"`
	PasswordLte           *string          `json:"password_lte"`
	PasswordGt            *string          `json:"password_gt"`
	PasswordGte           *string          `json:"password_gte"`
	PasswordContains      *string          `json:"password_contains"`
	PasswordNotContains   *string          `json:"password_not_contains"`
	PasswordStartsWith    *string          `json:"password_starts_with"`
	PasswordNotStartsWith *string          `json:"password_not_starts_with"`
	PasswordEndsWith      *string          `json:"password_ends_with"`
	PasswordNotEndsWith   *string          `json:"password_not_ends_with"`
	AND                   []UserWhereInput `json:"AND"`
	OR                    []UserWhereInput `json:"OR"`
	NOT                   []UserWhereInput `json:"NOT"`
}

func UnmarshalUserWhereInput

func UnmarshalUserWhereInput(v interface{}) (UserWhereInput, error)

type UserWhereUniqueInput

type UserWhereUniqueInput struct {
	ID       *string `json:"id"`
	Username *string `json:"username"`
}

func UnmarshalUserWhereUniqueInput

func UnmarshalUserWhereUniqueInput(v interface{}) (UserWhereUniqueInput, error)

Jump to

Keyboard shortcuts

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