graph

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 27 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 BalanceResolver

type BalanceResolver interface {
	ID(ctx context.Context, obj *model.Balance) (string, error)

	Metadata(ctx context.Context, obj *model.Balance) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Balance) (string, error)
	Updated(ctx context.Context, obj *model.Balance) (string, error)
	UID(ctx context.Context, obj *model.Balance) (string, error)
}

type BenefitResolver

type BenefitResolver interface {
	ID(ctx context.Context, obj *model.Benefit) (string, error)

	Name(ctx context.Context, obj *model.Benefit) (string, error)
	Description(ctx context.Context, obj *model.Benefit) (string, error)

	Metadata(ctx context.Context, obj *model.Benefit) (map[string]interface{}, error)
	Created(ctx context.Context, obj *model.Benefit) (string, error)
	Updated(ctx context.Context, obj *model.Benefit) (string, error)
}

type CompanyResolver

type CompanyResolver interface {
	ID(ctx context.Context, obj *model.Company) (string, error)

	Currency(ctx context.Context, obj *model.Company) (*string, error)

	Metadata(ctx context.Context, obj *model.Company) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Company) (string, error)
	Updated(ctx context.Context, obj *model.Company) (string, error)
	UID(ctx context.Context, obj *model.Company) (string, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Address struct {
		City    func(childComplexity int) int
		Country func(childComplexity int) int
		State   func(childComplexity int) int
		Street  func(childComplexity int) int
		Zip     func(childComplexity int) int
	}

	Balance struct {
		Created  func(childComplexity int) int
		Credits  func(childComplexity int) int
		ID       func(childComplexity int) int
		Metadata func(childComplexity int) int
		Notes    func(childComplexity int) int
		Status   func(childComplexity int) int
		Type     func(childComplexity int) int
		UID      func(childComplexity int) int
		Updated  func(childComplexity int) int
	}

	Balances struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Benefit struct {
		Created     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Status      func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Benefits struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Companies struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Company struct {
		Address     func(childComplexity int) int
		Created     func(childComplexity int) int
		Currency    func(childComplexity int) int
		Description func(childComplexity int) int
		Email       func(childComplexity int) int
		Employees   func(childComplexity int) int
		ID          func(childComplexity int) int
		Industry    func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Phone       func(childComplexity int) int
		Revenue     func(childComplexity int) int
		Status      func(childComplexity int) int
		Type        func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
		Website     func(childComplexity int) int
	}

	Contact struct {
		Address      func(childComplexity int) int
		Birthday     func(childComplexity int) int
		Company      func(childComplexity int) int
		Created      func(childComplexity int) int
		Email        func(childComplexity int) int
		FirstName    func(childComplexity int) int
		ID           func(childComplexity int) int
		JobTitle     func(childComplexity int) int
		Labels       func(childComplexity int) int
		Language     func(childComplexity int) int
		LastActivity func(childComplexity int) int
		LastName     func(childComplexity int) int
		Metadata     func(childComplexity int) int
		Notes        func(childComplexity int) int
		Phone        func(childComplexity int) int
		Picture      func(childComplexity int) int
		Rating       func(childComplexity int) int
		Source       func(childComplexity int) int
		Status       func(childComplexity int) int
		Subscribed   func(childComplexity int) int
		Timezone     func(childComplexity int) int
		UID          func(childComplexity int) int
		Updated      func(childComplexity int) int
	}

	Contacts struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Coupon struct {
		Amount      func(childComplexity int) int
		Code        func(childComplexity int) int
		Created     func(childComplexity int) int
		Currency    func(childComplexity int) int
		Description func(childComplexity int) int
		Expires     func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		MaxDiscount func(childComplexity int) int
		MaxUses     func(childComplexity int) int
		Metadata    func(childComplexity int) int
		MinPurchase func(childComplexity int) int
		Name        func(childComplexity int) int
		Products    func(childComplexity int) int
		Starts      func(childComplexity int) int
		Status      func(childComplexity int) int
		Type        func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
		Uses        func(childComplexity int) int
	}

	Coupons struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Entity struct {
		FindCompanyByID    func(childComplexity int, id string) int
		FindContactByID    func(childComplexity int, id string) int
		FindMembershipByID func(childComplexity int, id string) int
		FindProductByID    func(childComplexity int, id string) int
		FindUserByID       func(childComplexity int, id string) int
	}

	Item struct {
		Code        func(childComplexity int) int
		Created     func(childComplexity int) int
		Currency    func(childComplexity int) int
		Description func(childComplexity int) int
		Discount    func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Package     func(childComplexity int) int
		Price       func(childComplexity int) int
		Quantity    func(childComplexity int) int
		Status      func(childComplexity int) int
		Type        func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Items struct {
		Count func(childComplexity int) int
		Items func(childComplexity int) int
	}

	Membership struct {
		Billing  func(childComplexity int) int
		Created  func(childComplexity int) int
		ID       func(childComplexity int) int
		Metadata func(childComplexity int) int
		Number   func(childComplexity int) int
		Payment  func(childComplexity int) int
		Since    func(childComplexity int) int
		Status   func(childComplexity int) int
		Tier     func(childComplexity int) int
		UID      func(childComplexity int) int
		Until    func(childComplexity int) int
		Updated  func(childComplexity int) int
	}

	Memberships struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Mutation struct {
		CreateBalance     func(childComplexity int, input model.NewBalance) int
		CreateBenefit     func(childComplexity int, input model.NewBenefit) int
		CreateCompany     func(childComplexity int, input model.NewCompany) int
		CreateContact     func(childComplexity int, input model.NewContact) int
		CreateCoupon      func(childComplexity int, input model.NewCoupon) int
		CreateItem        func(childComplexity int, input model.NewItem) int
		CreateMembership  func(childComplexity int, input model.NewMembership) int
		CreateOrder       func(childComplexity int, input model.NewOrder) int
		CreatePackage     func(childComplexity int, input model.NewPackage) int
		CreateProduct     func(childComplexity int, input model.NewProduct) int
		CreatePromotion   func(childComplexity int, input model.NewPromotion) int
		CreateQuote       func(childComplexity int, input *model.NewQuote) int
		CreateReward      func(childComplexity int, input model.NewReward) int
		CreateTier        func(childComplexity int, input model.NewTier) int
		CreateVoucher     func(childComplexity int, input model.NewVoucher) int
		CreateWishlist    func(childComplexity int, input model.NewWishlist) int
		DeleteBalance     func(childComplexity int, id string) int
		DeleteBalances    func(childComplexity int, ids []string) int
		DeleteBenefit     func(childComplexity int, id string) int
		DeleteBenefits    func(childComplexity int, ids []string) int
		DeleteCompanies   func(childComplexity int, ids []*string) int
		DeleteCompany     func(childComplexity int, id string) int
		DeleteContact     func(childComplexity int, id string) int
		DeleteContacts    func(childComplexity int, ids []string) int
		DeleteCoupon      func(childComplexity int, id string) int
		DeleteCoupons     func(childComplexity int, ids []string) int
		DeleteItem        func(childComplexity int, id string) int
		DeleteItems       func(childComplexity int, filter map[string]interface{}) int
		DeleteMembership  func(childComplexity int, id string) int
		DeleteMemberships func(childComplexity int, ids []string) int
		DeleteOrder       func(childComplexity int, id string) int
		DeleteOrders      func(childComplexity int, ids []string) int
		DeletePackage     func(childComplexity int, id string) int
		DeleteProduct     func(childComplexity int, id string) int
		DeletePromotion   func(childComplexity int, id string) int
		DeletePromotions  func(childComplexity int, ids []string) int
		DeleteQuote       func(childComplexity int, id string) int
		DeleteQuotes      func(childComplexity int, ids []string) int
		DeleteReward      func(childComplexity int, id string) int
		DeleteRewards     func(childComplexity int, ids []string) int
		DeleteTier        func(childComplexity int, id string) int
		DeleteTiers       func(childComplexity int, ids []string) int
		DeleteVoucher     func(childComplexity int, id string) int
		DeleteVouchers    func(childComplexity int, ids []string) int
		DeleteWishlist    func(childComplexity int, id string) int
		DeleteWishlists   func(childComplexity int, ids []string) int
		ImportContacts    func(childComplexity int, file string) int
		UpdateBalance     func(childComplexity int, id string, input model.UpdateBalance) int
		UpdateBenefit     func(childComplexity int, id string, input model.UpdateBenefit) int
		UpdateCompany     func(childComplexity int, id string, input model.UpdateCompany) int
		UpdateContact     func(childComplexity int, id string, input model.UpdateContact) int
		UpdateCoupon      func(childComplexity int, id string, input model.UpdateCoupon) int
		UpdateItem        func(childComplexity int, id string, input model.UpdateItem) int
		UpdateMembership  func(childComplexity int, id string, input model.UpdateMembership) int
		UpdateOrder       func(childComplexity int, id string, input model.UpdateOrder) int
		UpdatePackage     func(childComplexity int, id string, input model.UpdatePackage) int
		UpdateProduct     func(childComplexity int, id string, input model.UpdateProduct) int
		UpdatePromotion   func(childComplexity int, id string, input model.UpdatePromotion) int
		UpdateQuote       func(childComplexity int, id string, input model.UpdateQuote) int
		UpdateReward      func(childComplexity int, id string, input model.UpdateReward) int
		UpdateTier        func(childComplexity int, id string, input model.UpdateTier) int
		UpdateVoucher     func(childComplexity int, id string, input model.UpdateVoucher) int
	}

	Order struct {
		Cancellable func(childComplexity int) int
		Code        func(childComplexity int) int
		Contact     func(childComplexity int) int
		Coupon      func(childComplexity int) int
		Created     func(childComplexity int) int
		ID          func(childComplexity int) int
		Items       func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Payment     func(childComplexity int) int
		Shares      func(childComplexity int) int
		Status      func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Orders struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Package struct {
		Cancellation func(childComplexity int) int
		Created      func(childComplexity int) int
		Description  func(childComplexity int) int
		Excludes     func(childComplexity int) int
		ID           func(childComplexity int) int
		Includes     func(childComplexity int) int
		Instant      func(childComplexity int) int
		Locale       func(childComplexity int) int
		Metadata     func(childComplexity int) int
		Name         func(childComplexity int) int
		Product      func(childComplexity int) int
		Redeem       func(childComplexity int) int
		Status       func(childComplexity int) int
		Updated      func(childComplexity int) int
		Vouchers     func(childComplexity int) int
	}

	Packages struct {
		Data  func(childComplexity int) int
		Total func(childComplexity int) int
	}

	Product struct {
		Created     func(childComplexity int) int
		Description func(childComplexity int) int
		Duration    func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Place       func(childComplexity int) int
		Places      func(childComplexity int) int
		Reviewable  func(childComplexity int) int
		Slug        func(childComplexity int) int
		Status      func(childComplexity int) int
		Terms       func(childComplexity int) int
		Type        func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Products struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Promotion struct {
		Created     func(childComplexity int) int
		Credits     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Type        func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Promotions struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Query struct {
		Balance     func(childComplexity int, id string) int
		Balances    func(childComplexity int, stages map[string]interface{}) int
		Benefit     func(childComplexity int, id string) int
		Benefits    func(childComplexity int, stages map[string]interface{}) int
		Companies   func(childComplexity int, stages map[string]interface{}) int
		Company     func(childComplexity int, id string) int
		Contact     func(childComplexity int, id string) int
		Contacts    func(childComplexity int, stages map[string]interface{}) int
		Coupon      func(childComplexity int, id string) int
		Coupons     func(childComplexity int, stages map[string]interface{}) int
		Item        func(childComplexity int, id string) int
		Items       func(childComplexity int, stages map[string]interface{}) int
		Membership  func(childComplexity int, id string) int
		Memberships func(childComplexity int, args map[string]interface{}) int
		Order       func(childComplexity int, id string) int
		Orders      func(childComplexity int, stages map[string]interface{}) int
		Package     func(childComplexity int, id string) int
		Packages    func(childComplexity int, stages map[string]interface{}) int
		Product     func(childComplexity int, id string) int
		Products    func(childComplexity int, stages map[string]interface{}) int
		Promotion   func(childComplexity int, id string) int
		Promotions  func(childComplexity int, stages map[string]interface{}) int
		Quote       func(childComplexity int, id string) int
		Quotes      func(childComplexity int, stages map[string]interface{}) int
		Reward      func(childComplexity int, id string) int
		Rewards     func(childComplexity int, stages map[string]interface{}) int
		Tier        func(childComplexity int, id string) int
		Tiers       func(childComplexity int, stages map[string]interface{}) int
		Voucher     func(childComplexity int, id string) int
		Vouchers    func(childComplexity int, stages map[string]interface{}) int
		Wishlist    func(childComplexity int, id string) int
		Wishlists   func(childComplexity int, stages map[string]interface{}) int
		// contains filtered or unexported fields
	}

	Quote struct {
		Amount      func(childComplexity int) int
		Billing     func(childComplexity int) int
		Code        func(childComplexity int) int
		Contact     func(childComplexity int) int
		Created     func(childComplexity int) int
		Currency    func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Notes       func(childComplexity int) int
		Payment     func(childComplexity int) int
		Purchase    func(childComplexity int) int
		Shares      func(childComplexity int) int
		Status      func(childComplexity int) int
		Template    func(childComplexity int) int
		Terms       func(childComplexity int) int
		UID         func(childComplexity int) int
		Updated     func(childComplexity int) int
		ValidUntil  func(childComplexity int) int
	}

	Quotes struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Reward struct {
		Cost        func(childComplexity int) int
		Created     func(childComplexity int) int
		Description func(childComplexity int) int
		Expires     func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Status      func(childComplexity int) int
		Tier        func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Rewards struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Tier struct {
		Benefits    func(childComplexity int) int
		Cost        func(childComplexity int) int
		Created     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Rewards     func(childComplexity int) int
		Status      func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Tiers struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	User struct {
		Companies   func(childComplexity int) int
		Contacts    func(childComplexity int) int
		Coupons     func(childComplexity int) int
		Credits     func(childComplexity int) int
		ID          func(childComplexity int) int
		Memberships func(childComplexity int) int
		Orders      func(childComplexity int) int
		Quotes      func(childComplexity int) int
		Wishlists   func(childComplexity int) int
	}

	Voucher struct {
		Code        func(childComplexity int) int
		Created     func(childComplexity int) int
		Currency    func(childComplexity int) int
		Description func(childComplexity int) int
		Discount    func(childComplexity int) int
		End         func(childComplexity int) int
		ID          func(childComplexity int) int
		Locale      func(childComplexity int) int
		Metadata    func(childComplexity int) int
		Name        func(childComplexity int) int
		Package     func(childComplexity int) int
		Price       func(childComplexity int) int
		Start       func(childComplexity int) int
		Status      func(childComplexity int) int
		Supplier    func(childComplexity int) int
		Type        func(childComplexity int) int
		Updated     func(childComplexity int) int
	}

	Vouchers struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}

	Wishlist struct {
		Content  func(childComplexity int) int
		Created  func(childComplexity int) int
		ID       func(childComplexity int) int
		Metadata func(childComplexity int) int
		Status   func(childComplexity int) int
		UID      func(childComplexity int) int
		Updated  func(childComplexity int) int
	}

	Wishlists struct {
		Count func(childComplexity int) int
		Data  func(childComplexity int) int
	}
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type ContactResolver

type ContactResolver interface {
	ID(ctx context.Context, obj *model.Contact) (string, error)

	Birthday(ctx context.Context, obj *model.Contact) (*string, error)
	Company(ctx context.Context, obj *model.Contact) (*model.Company, error)

	Metadata(ctx context.Context, obj *model.Contact) (map[string]interface{}, error)
	LastActivity(ctx context.Context, obj *model.Contact) (*string, error)
	Created(ctx context.Context, obj *model.Contact) (string, error)
	Updated(ctx context.Context, obj *model.Contact) (string, error)
	UID(ctx context.Context, obj *model.Contact) (string, error)
}

type CouponResolver

type CouponResolver interface {
	ID(ctx context.Context, obj *model.Coupon) (string, error)

	Name(ctx context.Context, obj *model.Coupon) (string, error)
	Description(ctx context.Context, obj *model.Coupon) (*string, error)

	Metadata(ctx context.Context, obj *model.Coupon) (map[string]interface{}, error)

	Starts(ctx context.Context, obj *model.Coupon) (*string, error)
	Expires(ctx context.Context, obj *model.Coupon) (*string, error)
	Created(ctx context.Context, obj *model.Coupon) (string, error)
	Updated(ctx context.Context, obj *model.Coupon) (string, error)
	UID(ctx context.Context, obj *model.Coupon) (*string, error)
	Products(ctx context.Context, obj *model.Coupon) ([]*model.Product, error)
}

type DirectiveRoot

type DirectiveRoot struct {
	Api              func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	Auth             func(ctx context.Context, obj interface{}, next graphql.Resolver, roles []string) (res interface{}, err error)
	ComposeDirective func(ctx context.Context, obj interface{}, next graphql.Resolver, name string) (res interface{}, err error)
	HasScope         func(ctx context.Context, obj interface{}, next graphql.Resolver, scope []string) (res interface{}, err error)
	InterfaceObject  func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type EntityResolver

type EntityResolver interface {
	FindCompanyByID(ctx context.Context, id string) (*model.Company, error)
	FindContactByID(ctx context.Context, id string) (*model.Contact, error)
	FindMembershipByID(ctx context.Context, id string) (*model.Membership, error)
	FindProductByID(ctx context.Context, id string) (*model.Product, error)
	FindUserByID(ctx context.Context, id string) (*model.User, error)
}

type ItemResolver

type ItemResolver interface {
	ID(ctx context.Context, obj *model.Item) (string, error)
	UID(ctx context.Context, obj *model.Item) (string, error)
	Package(ctx context.Context, obj *model.Item) (*model.Package, error)

	Name(ctx context.Context, obj *model.Item) (string, error)
	Description(ctx context.Context, obj *model.Item) (*string, error)
	Quantity(ctx context.Context, obj *model.Item) (int, error)

	Metadata(ctx context.Context, obj *model.Item) (map[string]interface{}, error)
	Status(ctx context.Context, obj *model.Item) (*string, error)
	Created(ctx context.Context, obj *model.Item) (string, error)
	Updated(ctx context.Context, obj *model.Item) (string, error)
}

type MembershipResolver

type MembershipResolver interface {
	ID(ctx context.Context, obj *model.Membership) (string, error)
	Tier(ctx context.Context, obj *model.Membership) (*model.Tier, error)

	Billing(ctx context.Context, obj *model.Membership) (map[string]interface{}, error)
	Payment(ctx context.Context, obj *model.Membership) (map[string]interface{}, error)
	Metadata(ctx context.Context, obj *model.Membership) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Membership) (string, error)
	Updated(ctx context.Context, obj *model.Membership) (string, error)
	UID(ctx context.Context, obj *model.Membership) (string, error)
}

type MutationResolver

type MutationResolver interface {
	CreateBalance(ctx context.Context, input model.NewBalance) (*model.Balance, error)
	UpdateBalance(ctx context.Context, id string, input model.UpdateBalance) (*model.Balance, error)
	DeleteBalance(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteBalances(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateBenefit(ctx context.Context, input model.NewBenefit) (*model.Benefit, error)
	UpdateBenefit(ctx context.Context, id string, input model.UpdateBenefit) (*model.Benefit, error)
	DeleteBenefit(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteBenefits(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateCompany(ctx context.Context, input model.NewCompany) (*model.Company, error)
	UpdateCompany(ctx context.Context, id string, input model.UpdateCompany) (*model.Company, error)
	DeleteCompany(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteCompanies(ctx context.Context, ids []*string) (map[string]interface{}, error)
	CreateContact(ctx context.Context, input model.NewContact) (*model.Contact, error)
	UpdateContact(ctx context.Context, id string, input model.UpdateContact) (*model.Contact, error)
	ImportContacts(ctx context.Context, file string) (map[string]interface{}, error)
	DeleteContact(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteContacts(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateCoupon(ctx context.Context, input model.NewCoupon) (*model.Coupon, error)
	UpdateCoupon(ctx context.Context, id string, input model.UpdateCoupon) (*model.Coupon, error)
	DeleteCoupon(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteCoupons(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateItem(ctx context.Context, input model.NewItem) (*model.Item, error)
	UpdateItem(ctx context.Context, id string, input model.UpdateItem) (*model.Item, error)
	DeleteItem(ctx context.Context, id string) (*model.Item, error)
	DeleteItems(ctx context.Context, filter map[string]interface{}) ([]*model.Item, error)
	CreateMembership(ctx context.Context, input model.NewMembership) (*model.Membership, error)
	UpdateMembership(ctx context.Context, id string, input model.UpdateMembership) (*model.Membership, error)
	DeleteMembership(ctx context.Context, id string) (*model.Membership, error)
	DeleteMemberships(ctx context.Context, ids []string) ([]*model.Membership, error)
	CreateOrder(ctx context.Context, input model.NewOrder) (*model.Order, error)
	UpdateOrder(ctx context.Context, id string, input model.UpdateOrder) (*model.Order, error)
	DeleteOrder(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteOrders(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreatePackage(ctx context.Context, input model.NewPackage) (*model.Package, error)
	UpdatePackage(ctx context.Context, id string, input model.UpdatePackage) (*model.Package, error)
	DeletePackage(ctx context.Context, id string) (*model.Package, error)
	CreateProduct(ctx context.Context, input model.NewProduct) (*model.Product, error)
	UpdateProduct(ctx context.Context, id string, input model.UpdateProduct) (*model.Product, error)
	DeleteProduct(ctx context.Context, id string) (*bool, error)
	CreatePromotion(ctx context.Context, input model.NewPromotion) (*model.Promotion, error)
	UpdatePromotion(ctx context.Context, id string, input model.UpdatePromotion) (*model.Promotion, error)
	DeletePromotion(ctx context.Context, id string) (*model.Promotion, error)
	DeletePromotions(ctx context.Context, ids []string) (*bool, error)
	CreateQuote(ctx context.Context, input *model.NewQuote) (*model.Quote, error)
	UpdateQuote(ctx context.Context, id string, input model.UpdateQuote) (*model.Quote, error)
	DeleteQuote(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteQuotes(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateReward(ctx context.Context, input model.NewReward) (*model.Reward, error)
	UpdateReward(ctx context.Context, id string, input model.UpdateReward) (*model.Reward, error)
	DeleteReward(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteRewards(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateTier(ctx context.Context, input model.NewTier) (*model.Tier, error)
	UpdateTier(ctx context.Context, id string, input model.UpdateTier) (*model.Tier, error)
	DeleteTier(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteTiers(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateVoucher(ctx context.Context, input model.NewVoucher) (*model.Voucher, error)
	UpdateVoucher(ctx context.Context, id string, input model.UpdateVoucher) (*model.Voucher, error)
	DeleteVoucher(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteVouchers(ctx context.Context, ids []string) (map[string]interface{}, error)
	CreateWishlist(ctx context.Context, input model.NewWishlist) (*model.Wishlist, error)
	DeleteWishlist(ctx context.Context, id string) (map[string]interface{}, error)
	DeleteWishlists(ctx context.Context, ids []string) (map[string]interface{}, error)
}

type OrderResolver

type OrderResolver interface {
	ID(ctx context.Context, obj *model.Order) (string, error)

	UID(ctx context.Context, obj *model.Order) (string, error)
	Contact(ctx context.Context, obj *model.Order) (*model.Contact, error)
	Items(ctx context.Context, obj *model.Order) ([]*model.Item, error)
	Metadata(ctx context.Context, obj *model.Order) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Order) (string, error)
	Updated(ctx context.Context, obj *model.Order) (string, error)
	Shares(ctx context.Context, obj *model.Order) ([]*string, error)
}

type PackageResolver

type PackageResolver interface {
	ID(ctx context.Context, obj *model.Package) (string, error)

	Name(ctx context.Context, obj *model.Package) (string, error)
	Description(ctx context.Context, obj *model.Package) (string, error)
	Includes(ctx context.Context, obj *model.Package) (string, error)
	Excludes(ctx context.Context, obj *model.Package) (string, error)
	Redeem(ctx context.Context, obj *model.Package) (string, error)
	Cancellation(ctx context.Context, obj *model.Package) (string, error)

	Metadata(ctx context.Context, obj *model.Package) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Package) (string, error)
	Updated(ctx context.Context, obj *model.Package) (string, error)
	Product(ctx context.Context, obj *model.Package) (*model.Product, error)
	Vouchers(ctx context.Context, obj *model.Package) ([]*model.Voucher, error)
}

type ProductResolver

type ProductResolver interface {
	ID(ctx context.Context, obj *model.Product) (string, error)
	UID(ctx context.Context, obj *model.Product) (string, error)

	Name(ctx context.Context, obj *model.Product) (string, error)
	Description(ctx context.Context, obj *model.Product) (string, error)

	Metadata(ctx context.Context, obj *model.Product) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Product) (string, error)
	Updated(ctx context.Context, obj *model.Product) (string, error)
	Terms(ctx context.Context, obj *model.Product) ([]*string, error)
	Place(ctx context.Context, obj *model.Product) (*string, error)
	Places(ctx context.Context, obj *model.Product) ([]*string, error)
}

type PromotionResolver

type PromotionResolver interface {
	ID(ctx context.Context, obj *model.Promotion) (string, error)

	Name(ctx context.Context, obj *model.Promotion) (string, error)
	Description(ctx context.Context, obj *model.Promotion) (string, error)

	Metadata(ctx context.Context, obj *model.Promotion) (map[string]interface{}, error)
	Created(ctx context.Context, obj *model.Promotion) (string, error)
	Updated(ctx context.Context, obj *model.Promotion) (string, error)
}

type QueryResolver

type QueryResolver interface {
	Balance(ctx context.Context, id string) (*model.Balance, error)
	Balances(ctx context.Context, stages map[string]interface{}) (*model.Balances, error)
	Benefits(ctx context.Context, stages map[string]interface{}) (*model.Benefits, error)
	Benefit(ctx context.Context, id string) (*model.Benefit, error)
	Companies(ctx context.Context, stages map[string]interface{}) (*model.Companies, error)
	Company(ctx context.Context, id string) (*model.Company, error)
	Contacts(ctx context.Context, stages map[string]interface{}) (*model.Contacts, error)
	Contact(ctx context.Context, id string) (*model.Contact, error)
	Coupon(ctx context.Context, id string) (*model.Coupon, error)
	Coupons(ctx context.Context, stages map[string]interface{}) (*model.Coupons, error)
	Items(ctx context.Context, stages map[string]interface{}) (*model.Items, error)
	Item(ctx context.Context, id string) (*model.Item, error)
	Membership(ctx context.Context, id string) (*model.Membership, error)
	Memberships(ctx context.Context, args map[string]interface{}) (*model.Memberships, error)
	Order(ctx context.Context, id string) (*model.Order, error)
	Orders(ctx context.Context, stages map[string]interface{}) (*model.Orders, error)
	Package(ctx context.Context, id string) (*model.Package, error)
	Packages(ctx context.Context, stages map[string]interface{}) (*model.Packages, error)
	Product(ctx context.Context, id string) (*model.Product, error)
	Products(ctx context.Context, stages map[string]interface{}) (*model.Products, error)
	Promotion(ctx context.Context, id string) (*model.Promotion, error)
	Promotions(ctx context.Context, stages map[string]interface{}) (*model.Promotions, error)
	Quotes(ctx context.Context, stages map[string]interface{}) (*model.Quotes, error)
	Quote(ctx context.Context, id string) (*model.Quote, error)
	Rewards(ctx context.Context, stages map[string]interface{}) (*model.Rewards, error)
	Reward(ctx context.Context, id string) (*model.Reward, error)
	Tiers(ctx context.Context, stages map[string]interface{}) (*model.Tiers, error)
	Tier(ctx context.Context, id string) (*model.Tier, error)
	Voucher(ctx context.Context, id string) (*model.Voucher, error)
	Vouchers(ctx context.Context, stages map[string]interface{}) (*model.Vouchers, error)
	Wishlist(ctx context.Context, id string) (*model.Wishlist, error)
	Wishlists(ctx context.Context, stages map[string]interface{}) (*model.Wishlists, error)
}

type QuoteResolver

type QuoteResolver interface {
	ID(ctx context.Context, obj *model.Quote) (string, error)

	Contact(ctx context.Context, obj *model.Quote) (*model.Contact, error)

	ValidUntil(ctx context.Context, obj *model.Quote) (int, error)
	Amount(ctx context.Context, obj *model.Quote) (float64, error)
	Currency(ctx context.Context, obj *model.Quote) (string, error)
	Metadata(ctx context.Context, obj *model.Quote) (map[string]interface{}, error)
	Billing(ctx context.Context, obj *model.Quote) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Quote) (string, error)
	Updated(ctx context.Context, obj *model.Quote) (string, error)
	UID(ctx context.Context, obj *model.Quote) (string, error)
	Shares(ctx context.Context, obj *model.Quote) ([]*string, error)
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(db *mongo.Database, rdb *redis.Client, ts *typesense.Client) *Resolver

func (*Resolver) Balance

func (r *Resolver) Balance() BalanceResolver

Balance returns BalanceResolver implementation.

func (*Resolver) Benefit

func (r *Resolver) Benefit() BenefitResolver

Benefit returns BenefitResolver implementation.

func (*Resolver) Company

func (r *Resolver) Company() CompanyResolver

Company returns CompanyResolver implementation.

func (*Resolver) Contact

func (r *Resolver) Contact() ContactResolver

Contact returns ContactResolver implementation.

func (*Resolver) Coupon

func (r *Resolver) Coupon() CouponResolver

Coupon returns CouponResolver implementation.

func (*Resolver) Entity

func (r *Resolver) Entity() EntityResolver

Entity returns EntityResolver implementation.

func (*Resolver) Item

func (r *Resolver) Item() ItemResolver

Item returns ItemResolver implementation.

func (*Resolver) Membership

func (r *Resolver) Membership() MembershipResolver

Membership returns MembershipResolver implementation.

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Order

func (r *Resolver) Order() OrderResolver

Order returns OrderResolver implementation.

func (*Resolver) Package

func (r *Resolver) Package() PackageResolver

Package returns PackageResolver implementation.

func (*Resolver) Product

func (r *Resolver) Product() ProductResolver

Product returns ProductResolver implementation.

func (*Resolver) Promotion

func (r *Resolver) Promotion() PromotionResolver

Promotion returns PromotionResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

func (*Resolver) Quote

func (r *Resolver) Quote() QuoteResolver

Quote returns QuoteResolver implementation.

func (*Resolver) Reward

func (r *Resolver) Reward() RewardResolver

Reward returns RewardResolver implementation.

func (*Resolver) Tier

func (r *Resolver) Tier() TierResolver

Tier returns TierResolver implementation.

func (*Resolver) User

func (r *Resolver) User() UserResolver

User returns UserResolver implementation.

func (*Resolver) Voucher

func (r *Resolver) Voucher() VoucherResolver

Voucher returns VoucherResolver implementation.

func (*Resolver) Wishlist

func (r *Resolver) Wishlist() WishlistResolver

Wishlist returns WishlistResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Balance() BalanceResolver
	Benefit() BenefitResolver
	Company() CompanyResolver
	Contact() ContactResolver
	Coupon() CouponResolver
	Entity() EntityResolver
	Item() ItemResolver
	Membership() MembershipResolver
	Mutation() MutationResolver
	Order() OrderResolver
	Package() PackageResolver
	Product() ProductResolver
	Promotion() PromotionResolver
	Query() QueryResolver
	Quote() QuoteResolver
	Reward() RewardResolver
	Tier() TierResolver
	User() UserResolver
	Voucher() VoucherResolver
	Wishlist() WishlistResolver
}

type RewardResolver

type RewardResolver interface {
	ID(ctx context.Context, obj *model.Reward) (string, error)
	Tier(ctx context.Context, obj *model.Reward) (*model.Tier, error)

	Name(ctx context.Context, obj *model.Reward) (string, error)
	Description(ctx context.Context, obj *model.Reward) (string, error)

	Metadata(ctx context.Context, obj *model.Reward) (map[string]interface{}, error)
	Expires(ctx context.Context, obj *model.Reward) (*string, error)
	Created(ctx context.Context, obj *model.Reward) (string, error)
	Updated(ctx context.Context, obj *model.Reward) (string, error)
}

type TierResolver

type TierResolver interface {
	ID(ctx context.Context, obj *model.Tier) (string, error)

	Name(ctx context.Context, obj *model.Tier) (string, error)
	Description(ctx context.Context, obj *model.Tier) (string, error)
	Benefits(ctx context.Context, obj *model.Tier) ([]*model.Benefit, error)

	Rewards(ctx context.Context, obj *model.Tier) ([]*model.Reward, error)

	Metadata(ctx context.Context, obj *model.Tier) (map[string]interface{}, error)
	Created(ctx context.Context, obj *model.Tier) (string, error)
	Updated(ctx context.Context, obj *model.Tier) (string, error)
}

type UserResolver

type UserResolver interface {
	Memberships(ctx context.Context, obj *model.User) ([]*model.Membership, error)
	Wishlists(ctx context.Context, obj *model.User) ([]*model.Wishlist, error)
	Coupons(ctx context.Context, obj *model.User) ([]*model.Coupon, error)
	Companies(ctx context.Context, obj *model.User) ([]*model.Company, error)
	Contacts(ctx context.Context, obj *model.User) ([]*model.Contact, error)
	Quotes(ctx context.Context, obj *model.User) ([]*model.Quote, error)
	Orders(ctx context.Context, obj *model.User) ([]*model.Order, error)
	Credits(ctx context.Context, obj *model.User) (*int, error)
}

type VoucherResolver

type VoucherResolver interface {
	ID(ctx context.Context, obj *model.Voucher) (string, error)

	Name(ctx context.Context, obj *model.Voucher) (string, error)
	Description(ctx context.Context, obj *model.Voucher) (string, error)
	Start(ctx context.Context, obj *model.Voucher) (string, error)
	End(ctx context.Context, obj *model.Voucher) (string, error)

	Metadata(ctx context.Context, obj *model.Voucher) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Voucher) (string, error)
	Updated(ctx context.Context, obj *model.Voucher) (string, error)
	Package(ctx context.Context, obj *model.Voucher) (string, error)
	Supplier(ctx context.Context, obj *model.Voucher) (string, error)
}

type WishlistResolver

type WishlistResolver interface {
	ID(ctx context.Context, obj *model.Wishlist) (string, error)
	Metadata(ctx context.Context, obj *model.Wishlist) (map[string]interface{}, error)

	Created(ctx context.Context, obj *model.Wishlist) (string, error)
	Updated(ctx context.Context, obj *model.Wishlist) (string, error)
	Content(ctx context.Context, obj *model.Wishlist) (string, error)
	UID(ctx context.Context, obj *model.Wishlist) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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