generated

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownType  = errors.New("unknown type")
	ErrTypeNotFound = errors.New("type not found")
)

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Entity struct {
		FindUserByID func(childComplexity int, id repos.ID) int
	}

	InviteCode struct {
		ID         func(childComplexity int) int
		InviteCode func(childComplexity int) int
		Name       func(childComplexity int) int
	}

	Mutation struct {
		AuthChangeEmail             func(childComplexity int, email string) int
		AuthChangePassword          func(childComplexity int, currentPassword string, newPassword string) int
		AuthClearMetadata           func(childComplexity int) int
		AuthCreateInviteCode        func(childComplexity int, name string, inviteCode string) int
		AuthCreateRemoteLogin       func(childComplexity int, secret *string) int
		AuthDeleteInviteCode        func(childComplexity int, inviteCodeID string) int
		AuthLogin                   func(childComplexity int, email string, password string) int
		AuthLogout                  func(childComplexity int) int
		AuthRequestResetPassword    func(childComplexity int, email string, captchaToken string) int
		AuthResendVerificationEmail func(childComplexity int) int
		AuthResetPassword           func(childComplexity int, token string, password string) int
		AuthSetMetadata             func(childComplexity int, values map[string]interface{}) int
		AuthSetRemoteAuthHeader     func(childComplexity int, loginID string, authHeader *string) int
		AuthSignup                  func(childComplexity int, name string, email string, password string, captchaToken string) int
		AuthVerifyEmail             func(childComplexity int, token string) int
		AuthVerifyInviteCode        func(childComplexity int, invitationCode string) int
		OAuthAddLogin               func(childComplexity int, provider string, state string, code string) int
		OAuthLogin                  func(childComplexity int, provider string, code string, state *string) int
	}

	OAuthProviderStatus struct {
		Enabled  func(childComplexity int) int
		Provider func(childComplexity int) int
	}

	Query struct {
		AuthFindByEmail        func(childComplexity int, email string) int
		AuthGetRemoteLogin     func(childComplexity int, loginID string, secret string) int
		AuthListOAuthProviders func(childComplexity int) int
		AuthMe                 func(childComplexity int) int
		OAuthRequestLogin      func(childComplexity int, provider string, state *string) int
		// contains filtered or unexported fields
	}

	RemoteLogin struct {
		AuthHeader func(childComplexity int) int
		Status     func(childComplexity int) int
	}

	Session struct {
		ID           func(childComplexity int) int
		LoginMethod  func(childComplexity int) int
		UserEmail    func(childComplexity int) int
		UserID       func(childComplexity int) int
		UserVerified func(childComplexity int) int
	}

	User struct {
		Approved       func(childComplexity int) int
		Avatar         func(childComplexity int) int
		Email          func(childComplexity int) int
		ID             func(childComplexity int) int
		Invite         func(childComplexity int) int
		Joined         func(childComplexity int) int
		Metadata       func(childComplexity int) int
		Name           func(childComplexity int) int
		ProviderGithub func(childComplexity int) int
		ProviderGitlab func(childComplexity int) int
		ProviderGoogle func(childComplexity int) int
		Verified       func(childComplexity int) int
	}
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
	IsLoggedIn            func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	IsLoggedInAndVerified func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type EntityResolver

type EntityResolver interface {
	FindUserByID(ctx context.Context, id repos.ID) (*model.User, error)
}

type MutationResolver

type MutationResolver interface {
	AuthSetRemoteAuthHeader(ctx context.Context, loginID string, authHeader *string) (bool, error)
	AuthCreateRemoteLogin(ctx context.Context, secret *string) (string, error)
	AuthLogin(ctx context.Context, email string, password string) (*model.Session, error)
	AuthSignup(ctx context.Context, name string, email string, password string, captchaToken string) (*model.Session, error)
	OAuthLogin(ctx context.Context, provider string, code string, state *string) (*model.Session, error)
	OAuthAddLogin(ctx context.Context, provider string, state string, code string) (bool, error)
	AuthLogout(ctx context.Context) (bool, error)
	AuthSetMetadata(ctx context.Context, values map[string]interface{}) (*model.User, error)
	AuthClearMetadata(ctx context.Context) (*model.User, error)
	AuthVerifyEmail(ctx context.Context, token string) (*model.Session, error)
	AuthResetPassword(ctx context.Context, token string, password string) (bool, error)
	AuthRequestResetPassword(ctx context.Context, email string, captchaToken string) (bool, error)
	AuthChangeEmail(ctx context.Context, email string) (bool, error)
	AuthResendVerificationEmail(ctx context.Context) (bool, error)
	AuthChangePassword(ctx context.Context, currentPassword string, newPassword string) (bool, error)
	AuthCreateInviteCode(ctx context.Context, name string, inviteCode string) (*model.InviteCode, error)
	AuthDeleteInviteCode(ctx context.Context, inviteCodeID string) (bool, error)
	AuthVerifyInviteCode(ctx context.Context, invitationCode string) (bool, error)
}

type QueryResolver

type QueryResolver interface {
	AuthMe(ctx context.Context) (*model.User, error)
	AuthFindByEmail(ctx context.Context, email string) (*model.User, error)
	OAuthRequestLogin(ctx context.Context, provider string, state *string) (string, error)
	AuthGetRemoteLogin(ctx context.Context, loginID string, secret string) (*model.RemoteLogin, error)
	AuthListOAuthProviders(ctx context.Context) ([]*model.OAuthProviderStatus, error)
}

type ResolverRoot

type ResolverRoot interface {
	Entity() EntityResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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