gql

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 30 Imported by: 0

README

GraphQL

This API is currently only used for admin. Learn GraphQL

Changing the API

  1. Make appropriate changes to schema.graphql
  2. [conditional] Add any predefined types you are using in the schema in types.json
  3. go generate gql/graphql.go to generate the new interface (located in generated.go)
  4. Update and implement any interfaces changes from generated.go

Read more about gqlgen

Performance

Because of GraphQLs heavily nested nature, retrieving data must be loosely coupled. However, this could potentially result in multiplying the query count by n every nest. To alleviate this, dataloaders are used to batch requests.

We use dataloaden to build our dataloaders using codegen in go.

See dataloader package for more specifics.

Documentation

Index

Constants

View Source
const (
	START_OF_WEEK_DAY = time.Sunday
	DATE_FORMAT       = "2006-01-02 MST"
	RETURN_SUCCESS    = "success"
	RETURN_NO_CHANGE  = "no changes made"
)

Variables

This section is empty.

Functions

func MakeExecutableSchema

func MakeExecutableSchema(resolvers Resolvers) graphql.ExecutableSchema

MakeExecutableSchema creates an ExecutableSchema from the Resolvers interface.

func MarshalInt64Scalar

func MarshalInt64Scalar(n int64) graphql.Marshaler

nolint: vet, errcheck

func NewExecutableSchema

func NewExecutableSchema(resolvers ResolverRoot) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func UnmarshalInt64Scalar

func UnmarshalInt64Scalar(v interface{}) (int64, error)

Types

type AnnouncementInput

type AnnouncementInput struct {
	ToUsers    []globalid.ID `json:"toUsers"`
	ToEveryone bool          `json:"toEveryone"`
	ForCard    *globalid.ID  `json:"forCard"`
	FromUser   globalid.ID   `json:"fromUser"`
	Message    string        `json:"message"`
}

func UnmarshalAnnouncementInput

func UnmarshalAnnouncementInput(v interface{}) (AnnouncementInput, error)

type AnnouncementResolver

type AnnouncementResolver interface {
	User(ctx context.Context, obj *model.Announcement) (*model.User, error)
	Card(ctx context.Context, obj *model.Announcement) (*model.Card, error)
}

type CardEngagement

type CardEngagement struct {
	ID                     globalid.ID `json:"id"`
	UniqueUserCommentCount int         `json:"uniqueUserCommentCount"`
	TotalLikeCount         int         `json:"totalLikeCount"`
	TotalDislikeCount      int         `json:"totalDislikeCount"`
	TotalReplyCount        int         `json:"totalReplyCount"`
}

type CardResolver

type CardResolver interface {
	ApparentAuthor(ctx context.Context, obj *model.Card) (*model.Author, error)
}

type ChannelInput

type ChannelInput struct {
	Name      string `json:"name"`
	IsDefault bool   `json:"isDefault"`
	IsPrivate *bool  `json:"isPrivate"`
}

func UnmarshalChannelInput

func UnmarshalChannelInput(v interface{}) (ChannelInput, error)

type ChannelResolver

type ChannelResolver interface {
	IsPrivate(ctx context.Context, obj *model.Channel) (bool, error)
}

type Config

type Config struct {
	GraphAddress                 string
	TestPushNotificationIconPath string
}

func NewConfig

func NewConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type FeatureState

type FeatureState string
const (
	FeatureStateOff     FeatureState = "off"
	FeatureStateTesting FeatureState = "testing"
	FeatureStateOn      FeatureState = "on"
)

func (FeatureState) IsValid

func (e FeatureState) IsValid() bool

func (FeatureState) MarshalGQL

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

func (FeatureState) String

func (e FeatureState) String() string

func (*FeatureState) UnmarshalGQL

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

type FeatureSwitchResolver

type FeatureSwitchResolver interface {
	State(ctx context.Context, obj *model.FeatureSwitch) (FeatureState, error)
	TestingUsers(ctx context.Context, obj *model.FeatureSwitch) ([]globalid.ID, error)
}

type GraphQL

type GraphQL struct {
	Store *store.Store
	RPC   rpc.RPC

	Notifier       *worker.Notifier
	Notifications  *notifications.Notifications
	Pusher         *push.Pusher
	ImageProcessor *rpc.ImageProcessor
	Indexer        *search.Indexer
	// contains filtered or unexported fields
}

GraphQL gives access to a GraphQL handler in order to setup an endpoint for processing GraphQL queries.

func NewGraphQL

func NewGraphQL(s *store.Store, r rpc.RPC, router *protocol.Router, ip *rpc.ImageProcessor, settings *model.Settings, l log.Logger, n *worker.Notifier, p *push.Pusher, i *search.Indexer, c *Config) *GraphQL

NewGraphQL returns a new instance of GraphQL.

func (*GraphQL) Announcement_card

func (g *GraphQL) Announcement_card(ctx context.Context, obj *model.Announcement) (*model.Card, error)

func (*GraphQL) Announcement_user

func (g *GraphQL) Announcement_user(ctx context.Context, obj *model.Announcement) (*model.User, error)

func (*GraphQL) Card_apparentAuthor

func (g *GraphQL) Card_apparentAuthor(ctx context.Context, card *model.Card) (author *model.Author, err error)

func (*GraphQL) Channel_isPrivate

func (g *GraphQL) Channel_isPrivate(ctx context.Context, obj *model.Channel) (bool, error)

func (*GraphQL) FeatureSwitch_state

func (g *GraphQL) FeatureSwitch_state(ctx context.Context, obj *model.FeatureSwitch) (FeatureState, error)

TODO: this is not neede if we use the enum types in the model definition

func (*GraphQL) FeatureSwitch_testingUsers

func (g *GraphQL) FeatureSwitch_testingUsers(ctx context.Context, obj *model.FeatureSwitch) ([]globalid.ID, error)

func (*GraphQL) Invite_issuer

func (g *GraphQL) Invite_issuer(ctx context.Context, obj *model.Invite) (model.User, error)

func (*GraphQL) LoaderMiddleware

func (g *GraphQL) LoaderMiddleware(next http.Handler) http.Handler

func (*GraphQL) ModelTime_time

func (g *GraphQL) ModelTime_time(ctx context.Context, obj *model.DBTime) (*time.Time, error)

hack to account for the fact that it's hard to make a dataloader for time.Time

func (*GraphQL) Mutation_blockUser

func (g *GraphQL) Mutation_blockUser(ctx context.Context, id globalid.ID, deleteCards *bool) (string, error)

func (*GraphQL) Mutation_createAnnouncement

func (g *GraphQL) Mutation_createAnnouncement(ctx context.Context, announcementIn AnnouncementInput, sendPush *bool) (*model.Announcement, error)

func (*GraphQL) Mutation_createChannel

func (g *GraphQL) Mutation_createChannel(ctx context.Context, channel ChannelInput) (*model.Channel, error)

func (*GraphQL) Mutation_createChannelInvite

func (g *GraphQL) Mutation_createChannelInvite(ctx context.Context, channelID, inviterID globalid.ID) (*model.Invite, error)

func (*GraphQL) Mutation_createFeatureSwitch

func (g *GraphQL) Mutation_createFeatureSwitch(ctx context.Context, state *string, name string) (string, error)

func (*GraphQL) Mutation_createInvite

func (g *GraphQL) Mutation_createInvite(ctx context.Context, userID globalid.ID, usesAllowed *int) (*model.Invite, error)

func (*GraphQL) Mutation_createInvitesFromTokens

func (g *GraphQL) Mutation_createInvitesFromTokens(ctx context.Context, userID globalid.ID, tokens []string) ([]model.Invite, error)

func (*GraphQL) Mutation_createUser

func (g *GraphQL) Mutation_createUser(ctx context.Context, userIn UserInput) (user *model.User, err error)

func (*GraphQL) Mutation_deactivateInvite

func (g *GraphQL) Mutation_deactivateInvite(ctx context.Context, id globalid.ID) (string, error)

func (*GraphQL) Mutation_deleteAnnouncement

func (g *GraphQL) Mutation_deleteAnnouncement(ctx context.Context, id globalid.ID) (string, error)

func (*GraphQL) Mutation_deleteFeatureSwitch

func (g *GraphQL) Mutation_deleteFeatureSwitch(ctx context.Context, featureID globalid.ID) (string, error)

func (*GraphQL) Mutation_generateExampleFeed

func (g *GraphQL) Mutation_generateExampleFeed(ctx context.Context, limitToChannels []globalid.ID, limitToLastNHours *int) ([]globalid.ID, error)

func (*GraphQL) Mutation_getCardConfidenceData

func (g *GraphQL) Mutation_getCardConfidenceData(ctx context.Context, userID globalid.ID) ([]model.ConfidenceData, error)

func (*GraphQL) Mutation_indexAllChannels

func (g *GraphQL) Mutation_indexAllChannels(ctx context.Context, clearFirst *bool) (string, error)

func (*GraphQL) Mutation_indexAllUsers

func (g *GraphQL) Mutation_indexAllUsers(ctx context.Context, clearFirst *bool) (string, error)

func (*GraphQL) Mutation_previewUserFeed

func (g *GraphQL) Mutation_previewUserFeed(ctx context.Context, userID globalid.ID) ([]globalid.ID, error)

func (*GraphQL) Mutation_recalculateLeaderboard

func (g *GraphQL) Mutation_recalculateLeaderboard(ctx context.Context, inviteReward *int) (string, error)

func (*GraphQL) Mutation_resetPasswords

func (g *GraphQL) Mutation_resetPasswords(ctx context.Context, usernames []string) (string, error)

func (*GraphQL) Mutation_sendTestPush

func (g *GraphQL) Mutation_sendTestPush(ctx context.Context, userID globalid.ID, forCardID *globalid.ID, message, typ string, action, actionData *string) (string, error)

func (*GraphQL) Mutation_setCardIntroStatus

func (g *GraphQL) Mutation_setCardIntroStatus(ctx context.Context, id globalid.ID, status bool) (string, error)

func (*GraphQL) Mutation_setFeatureSwitchState

func (g *GraphQL) Mutation_setFeatureSwitchState(ctx context.Context, featureID globalid.ID, state string) (string, error)

func (*GraphQL) Mutation_setUserDefaultStatus

func (g *GraphQL) Mutation_setUserDefaultStatus(ctx context.Context, id globalid.ID, status bool) (string, error)

func (*GraphQL) Mutation_shadowbanCards

func (g *GraphQL) Mutation_shadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)

func (*GraphQL) Mutation_shadowbanUser

func (g *GraphQL) Mutation_shadowbanUser(ctx context.Context, id globalid.ID) (string, error)

func (*GraphQL) Mutation_toggleFeatureForUser

func (g *GraphQL) Mutation_toggleFeatureForUser(ctx context.Context, username string, featurename string) (string, error)

func (*GraphQL) Mutation_unblockUser

func (g *GraphQL) Mutation_unblockUser(ctx context.Context, id globalid.ID) (string, error)

func (*GraphQL) Mutation_unshadowbanCards

func (g *GraphQL) Mutation_unshadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)

func (*GraphQL) Mutation_unshadowbanUser

func (g *GraphQL) Mutation_unshadowbanUser(ctx context.Context, id globalid.ID) (string, error)

func (*GraphQL) Mutation_updateChannel

func (g *GraphQL) Mutation_updateChannel(ctx context.Context, id globalid.ID, channelUpdate ChannelInput) (*model.Channel, error)

func (*GraphQL) Mutation_updateCoinBalances

func (g *GraphQL) Mutation_updateCoinBalances(ctx context.Context, userID globalid.ID, coinBalance, temporaryCoinBalance *int) (string, error)

func (*GraphQL) Mutation_updateSettings

func (g *GraphQL) Mutation_updateSettings(ctx context.Context, settings SettingsInput) (string, error)

func (*GraphQL) Mutation_updateWaitlist

func (g *GraphQL) Mutation_updateWaitlist(ctx context.Context, comment string, email string) (string, error)

func (*GraphQL) Query_announcements

func (g *GraphQL) Query_announcements(ctx context.Context) ([]model.Announcement, error)

func (*GraphQL) Query_cardEngagement

func (g *GraphQL) Query_cardEngagement(ctx context.Context, from *string, to *string) ([]CardEngagement, error)

func (*GraphQL) Query_cards

func (g *GraphQL) Query_cards(ctx context.Context, from *time.Time, to *time.Time, ids []globalid.ID, introCards *bool) (cards []model.Card, err error)

func (*GraphQL) Query_channelEngagements

func (g *GraphQL) Query_channelEngagements(ctx context.Context) ([]model.ChannelEngagement, error)

func (*GraphQL) Query_channels

func (g *GraphQL) Query_channels(ctx context.Context) ([]model.Channel, error)

func (*GraphQL) Query_connections

func (g *GraphQL) Query_connections(ctx context.Context) ([]protocol.Connection, error)

func (*GraphQL) Query_featureSwitches

func (g *GraphQL) Query_featureSwitches(ctx context.Context) ([]model.FeatureSwitch, error)

func (*GraphQL) Query_invites

func (g *GraphQL) Query_invites(ctx context.Context) ([]model.Invite, error)

func (*GraphQL) Query_sessions

func (g *GraphQL) Query_sessions(ctx context.Context) ([]model.Session, error)

func (*GraphQL) Query_settings

func (g *GraphQL) Query_settings(ctx context.Context) (*model.Settings, error)

func (*GraphQL) Query_users

func (g *GraphQL) Query_users(ctx context.Context, usernames []string) ([]model.User, error)

func (*GraphQL) Query_waitlist

func (g *GraphQL) Query_waitlist(ctx context.Context) ([]model.WaitlistEntry, error)

func (*GraphQL) SetupHandler

func (g *GraphQL) SetupHandler(exec graphql.ExecutableSchema) http.Handler

SetupHandler returns a new http.Handler capable of processing GraphQL queries.

func (*GraphQL) User_blocked

func (g *GraphQL) User_blocked(ctx context.Context, obj *model.User) (bool, error)

func (*GraphQL) User_coinBalance

func (g *GraphQL) User_coinBalance(ctx context.Context, obj *model.User) (int, error)

func (*GraphQL) User_engagement

func (g *GraphQL) User_engagement(ctx context.Context, user *model.User, from *string, to *string) (*model.UserEngagement, error)

func (*GraphQL) User_joinedFromInvite

func (g *GraphQL) User_joinedFromInvite(ctx context.Context, obj *model.User) (*model.Invite, error)

func (*GraphQL) User_lastActiveAt

func (g *GraphQL) User_lastActiveAt(ctx context.Context, obj *model.User) (*model.DBTime, error)

func (*GraphQL) User_postCount

func (g *GraphQL) User_postCount(ctx context.Context, obj *model.User, from *time.Time, to *time.Time) (int, error)

func (*GraphQL) User_shadowbanned

func (g *GraphQL) User_shadowbanned(ctx context.Context, obj *model.User) (bool, error)

func (*GraphQL) User_temporaryCoinBalance

func (g *GraphQL) User_temporaryCoinBalance(ctx context.Context, obj *model.User) (int, error)

type InviteResolver

type InviteResolver interface {
	Issuer(ctx context.Context, obj *model.Invite) (model.User, error)
}

type ModelTimeResolver

type ModelTimeResolver interface {
	Time(ctx context.Context, obj *model.DBTime) (*time.Time, error)
}

type MutationResolver

type MutationResolver interface {
	GenerateExampleFeed(ctx context.Context, limitToChannels []globalid.ID, limitToLastNHours *int) ([]globalid.ID, error)
	PreviewUserFeed(ctx context.Context, userID globalid.ID) ([]globalid.ID, error)
	GetCardConfidenceData(ctx context.Context, userID globalid.ID) ([]model.ConfidenceData, error)
	SetUserDefaultStatus(ctx context.Context, id globalid.ID, status bool) (string, error)
	ShadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)
	UnshadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)
	ShadowbanUser(ctx context.Context, id globalid.ID) (string, error)
	UnshadowbanUser(ctx context.Context, id globalid.ID) (string, error)
	RecalculateLeaderboard(ctx context.Context, inviteReward *int) (string, error)
	DeactivateInvite(ctx context.Context, id globalid.ID) (string, error)
	SetCardIntroStatus(ctx context.Context, id globalid.ID, status bool) (string, error)
	BlockUser(ctx context.Context, id globalid.ID, deleteCards *bool) (string, error)
	UnblockUser(ctx context.Context, id globalid.ID) (string, error)
	CreateAnnouncement(ctx context.Context, announcement AnnouncementInput, sendPush *bool) (*model.Announcement, error)
	DeleteAnnouncement(ctx context.Context, id globalid.ID) (string, error)
	DeleteFeatureSwitch(ctx context.Context, featureID globalid.ID) (string, error)
	CreateFeatureSwitch(ctx context.Context, state *string, name string) (string, error)
	SetFeatureSwitchState(ctx context.Context, featureID globalid.ID, state string) (string, error)
	CreateInvite(ctx context.Context, userID globalid.ID, usesAllowed *int) (*model.Invite, error)
	CreateInvitesFromTokens(ctx context.Context, userID globalid.ID, tokens []string) ([]model.Invite, error)
	CreateUser(ctx context.Context, user UserInput) (*model.User, error)
	ResetPasswords(ctx context.Context, usernames []string) (string, error)
	ToggleFeatureForUser(ctx context.Context, username string, featurename string) (string, error)
	UpdateSettings(ctx context.Context, settings SettingsInput) (string, error)
	UpdateWaitlist(ctx context.Context, comment string, email string) (string, error)
	IndexAllUsers(ctx context.Context, clearFirst *bool) (string, error)
	IndexAllChannels(ctx context.Context, clearFirst *bool) (string, error)
	CreateChannel(ctx context.Context, channel ChannelInput) (*model.Channel, error)
	UpdateChannel(ctx context.Context, id globalid.ID, channel ChannelInput) (*model.Channel, error)
	CreateChannelInvite(ctx context.Context, channelID globalid.ID, inviterID globalid.ID) (*model.Invite, error)
	UpdateCoinBalances(ctx context.Context, userID globalid.ID, coinBalance *int, temporaryCoinBalance *int) (string, error)
	SendTestPush(ctx context.Context, userID globalid.ID, forCardID *globalid.ID, message string, typ string, action *string, actionData *string) (string, error)
}

type QueryResolver

type QueryResolver interface {
	Cards(ctx context.Context, from *time.Time, to *time.Time, ids []globalid.ID, introCards *bool) ([]model.Card, error)
	Users(ctx context.Context, usernames []string) ([]model.User, error)
	Sessions(ctx context.Context) ([]model.Session, error)
	Settings(ctx context.Context) (*model.Settings, error)
	Invites(ctx context.Context) ([]model.Invite, error)
	FeatureSwitches(ctx context.Context) ([]model.FeatureSwitch, error)
	Announcements(ctx context.Context) ([]model.Announcement, error)
	Waitlist(ctx context.Context) ([]model.WaitlistEntry, error)
	Connections(ctx context.Context) ([]protocol.Connection, error)
	Channels(ctx context.Context) ([]model.Channel, error)
	ChannelEngagements(ctx context.Context) ([]model.ChannelEngagement, error)
	CardEngagement(ctx context.Context, from *string, to *string) ([]CardEngagement, error)
}

type ResolverRoot

type ResolverRoot interface {
	Announcement() AnnouncementResolver
	Card() CardResolver
	Channel() ChannelResolver
	FeatureSwitch() FeatureSwitchResolver
	Invite() InviteResolver
	ModelTime() ModelTimeResolver
	Mutation() MutationResolver
	Query() QueryResolver
	User() UserResolver
}

type Resolvers

type Resolvers interface {
	Announcement_user(ctx context.Context, obj *model.Announcement) (*model.User, error)
	Announcement_card(ctx context.Context, obj *model.Announcement) (*model.Card, error)

	Card_apparentAuthor(ctx context.Context, obj *model.Card) (*model.Author, error)

	Channel_isPrivate(ctx context.Context, obj *model.Channel) (bool, error)

	FeatureSwitch_state(ctx context.Context, obj *model.FeatureSwitch) (FeatureState, error)
	FeatureSwitch_testingUsers(ctx context.Context, obj *model.FeatureSwitch) ([]globalid.ID, error)

	Invite_issuer(ctx context.Context, obj *model.Invite) (model.User, error)

	ModelTime_time(ctx context.Context, obj *model.DBTime) (*time.Time, error)
	Mutation_generateExampleFeed(ctx context.Context, limitToChannels []globalid.ID, limitToLastNHours *int) ([]globalid.ID, error)
	Mutation_previewUserFeed(ctx context.Context, userID globalid.ID) ([]globalid.ID, error)
	Mutation_getCardConfidenceData(ctx context.Context, userID globalid.ID) ([]model.ConfidenceData, error)
	Mutation_setUserDefaultStatus(ctx context.Context, id globalid.ID, status bool) (string, error)
	Mutation_shadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)
	Mutation_unshadowbanCards(ctx context.Context, ids []globalid.ID) (string, error)
	Mutation_shadowbanUser(ctx context.Context, id globalid.ID) (string, error)
	Mutation_unshadowbanUser(ctx context.Context, id globalid.ID) (string, error)
	Mutation_recalculateLeaderboard(ctx context.Context, inviteReward *int) (string, error)
	Mutation_deactivateInvite(ctx context.Context, id globalid.ID) (string, error)
	Mutation_setCardIntroStatus(ctx context.Context, id globalid.ID, status bool) (string, error)
	Mutation_blockUser(ctx context.Context, id globalid.ID, deleteCards *bool) (string, error)
	Mutation_unblockUser(ctx context.Context, id globalid.ID) (string, error)
	Mutation_createAnnouncement(ctx context.Context, announcement AnnouncementInput, sendPush *bool) (*model.Announcement, error)
	Mutation_deleteAnnouncement(ctx context.Context, id globalid.ID) (string, error)
	Mutation_deleteFeatureSwitch(ctx context.Context, featureID globalid.ID) (string, error)
	Mutation_createFeatureSwitch(ctx context.Context, state *string, name string) (string, error)
	Mutation_setFeatureSwitchState(ctx context.Context, featureID globalid.ID, state string) (string, error)
	Mutation_createInvite(ctx context.Context, userID globalid.ID, usesAllowed *int) (*model.Invite, error)
	Mutation_createInvitesFromTokens(ctx context.Context, userID globalid.ID, tokens []string) ([]model.Invite, error)
	Mutation_createUser(ctx context.Context, user UserInput) (*model.User, error)
	Mutation_resetPasswords(ctx context.Context, usernames []string) (string, error)
	Mutation_toggleFeatureForUser(ctx context.Context, username string, featurename string) (string, error)
	Mutation_updateSettings(ctx context.Context, settings SettingsInput) (string, error)
	Mutation_updateWaitlist(ctx context.Context, comment string, email string) (string, error)
	Mutation_indexAllUsers(ctx context.Context, clearFirst *bool) (string, error)
	Mutation_indexAllChannels(ctx context.Context, clearFirst *bool) (string, error)
	Mutation_createChannel(ctx context.Context, channel ChannelInput) (*model.Channel, error)
	Mutation_updateChannel(ctx context.Context, id globalid.ID, channel ChannelInput) (*model.Channel, error)
	Mutation_createChannelInvite(ctx context.Context, channelID globalid.ID, inviterID globalid.ID) (*model.Invite, error)
	Mutation_updateCoinBalances(ctx context.Context, userID globalid.ID, coinBalance *int, temporaryCoinBalance *int) (string, error)
	Mutation_sendTestPush(ctx context.Context, userID globalid.ID, forCardID *globalid.ID, message string, typ string, action *string, actionData *string) (string, error)
	Query_cards(ctx context.Context, from *time.Time, to *time.Time, ids []globalid.ID, introCards *bool) ([]model.Card, error)
	Query_users(ctx context.Context, usernames []string) ([]model.User, error)
	Query_sessions(ctx context.Context) ([]model.Session, error)
	Query_settings(ctx context.Context) (*model.Settings, error)
	Query_invites(ctx context.Context) ([]model.Invite, error)
	Query_featureSwitches(ctx context.Context) ([]model.FeatureSwitch, error)
	Query_announcements(ctx context.Context) ([]model.Announcement, error)
	Query_waitlist(ctx context.Context) ([]model.WaitlistEntry, error)
	Query_connections(ctx context.Context) ([]protocol.Connection, error)
	Query_channels(ctx context.Context) ([]model.Channel, error)
	Query_channelEngagements(ctx context.Context) ([]model.ChannelEngagement, error)
	Query_cardEngagement(ctx context.Context, from *string, to *string) ([]CardEngagement, error)

	User_blocked(ctx context.Context, obj *model.User) (bool, error)
	User_shadowbanned(ctx context.Context, obj *model.User) (bool, error)

	User_lastActiveAt(ctx context.Context, obj *model.User) (*model.DBTime, error)
	User_joinedFromInvite(ctx context.Context, obj *model.User) (*model.Invite, error)
	User_coinBalance(ctx context.Context, obj *model.User) (int, error)
	User_temporaryCoinBalance(ctx context.Context, obj *model.User) (int, error)
	User_postCount(ctx context.Context, obj *model.User, from *time.Time, to *time.Time) (int, error)
	User_engagement(ctx context.Context, obj *model.User, from *string, to *string) (*model.UserEngagement, error)
}

type SetParameterPayload

type SetParameterPayload struct {
	Changed bool `json:"changed"`
}

type SettingsInput

type SettingsInput struct {
	SignupsFrozen   *bool `json:"signupsFrozen"`
	MaintenanceMode *bool `json:"maintenanceMode"`
}

func UnmarshalSettingsInput

func UnmarshalSettingsInput(v interface{}) (SettingsInput, error)

type UserID

type UserID struct {
	ID       globalid.ID `json:"id"`
	Username string      `json:"username"`
}

type UserInput

type UserInput struct {
	Username          string  `json:"username"`
	Displayname       string  `json:"displayname"`
	Password          string  `json:"password"`
	ProfilePictureURL *string `json:"profilePictureURL"`
	CoverPictureURL   *string `json:"coverPictureURL"`
	Email             string  `json:"email"`
}

func UnmarshalUserInput

func UnmarshalUserInput(v interface{}) (UserInput, error)

type UserResolver

type UserResolver interface {
	Blocked(ctx context.Context, obj *model.User) (bool, error)
	Shadowbanned(ctx context.Context, obj *model.User) (bool, error)

	LastActiveAt(ctx context.Context, obj *model.User) (*model.DBTime, error)
	JoinedFromInvite(ctx context.Context, obj *model.User) (*model.Invite, error)
	CoinBalance(ctx context.Context, obj *model.User) (int, error)
	TemporaryCoinBalance(ctx context.Context, obj *model.User) (int, error)
	PostCount(ctx context.Context, obj *model.User, from *time.Time, to *time.Time) (int, error)
	Engagement(ctx context.Context, obj *model.User, from *string, to *string) (*model.UserEngagement, error)
}

Jump to

Keyboard shortcuts

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