gqlserver

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 19 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 ComplexityRoot

type ComplexityRoot struct {
	Dish struct {
		Aliases    func(childComplexity int) int
		ID         func(childComplexity int) int
		NameDe     func(childComplexity int) int
		NameEn     func(childComplexity int) int
		ReviewData func(childComplexity int, filter *models.ReviewFilter) int
	}

	DishAlias struct {
		AliasName           func(childComplexity int) int
		Dish                func(childComplexity int) int
		NormalizedAliasName func(childComplexity int) int
	}

	Image struct {
		ID     func(childComplexity int) int
		Review func(childComplexity int) int
	}

	Location struct {
		ExternalID func(childComplexity int) int
		ID         func(childComplexity int) int
		Name       func(childComplexity int) int
		Visible    func(childComplexity int) int
	}

	Mutation struct {
		AddImagesToReview            func(childComplexity int, input models.AddImagesToReviewInput) int
		AddSideDishToOccurrence      func(childComplexity int, input models.AddSideDishToOccurrenceInput) int
		AddTagToOccurrence           func(childComplexity int, input models.AddTagToOccurrenceInput) int
		CreateDish                   func(childComplexity int, input models.CreateDishInput) int
		CreateDishAlias              func(childComplexity int, input models.CreateDishAliasInput) int
		CreateOccurrence             func(childComplexity int, input models.CreateOccurrenceInput) int
		CreateReview                 func(childComplexity int, input models.CreateReviewInput) int
		CreateTag                    func(childComplexity int, input models.CreateTagInput) int
		DeleteDishAlias              func(childComplexity int, input models.DeleteDishAliasInput) int
		DeleteImagesFromReview       func(childComplexity int, input models.DeleteImagesFromReviewInput) int
		DeleteOccurrence             func(childComplexity int, input models.DeleteOccurrenceInput) int
		DeleteReview                 func(childComplexity int, input models.DeleteReviewInput) int
		LoginUser                    func(childComplexity int, input models.LoginUserInput) int
		RemoveSideDishFromOccurrence func(childComplexity int, input models.RemoveSideDishFromOccurrenceInput) int
		RemoveTagFromOccurrence      func(childComplexity int, input models.RemoveTagFromOccurrenceInput) int
		UpdateDish                   func(childComplexity int, input models.UpdateDishInput) int
		UpdateOccurrence             func(childComplexity int, input models.UpdateOccurrenceInput) int
		UpdateReview                 func(childComplexity int, input models.UpdateReviewInput) int
	}

	Occurrence struct {
		Carbohydrates     func(childComplexity int) int
		Date              func(childComplexity int) int
		Dish              func(childComplexity int) int
		Fat               func(childComplexity int) int
		Fiber             func(childComplexity int) int
		ID                func(childComplexity int) int
		Kcal              func(childComplexity int) int
		Kj                func(childComplexity int) int
		Location          func(childComplexity int) int
		NotAvailableAfter func(childComplexity int) int
		PriceGuest        func(childComplexity int) int
		PriceStaff        func(childComplexity int) int
		PriceStudent      func(childComplexity int) int
		Protein           func(childComplexity int) int
		ReviewData        func(childComplexity int, filter *models.ReviewFilter) int
		Salt              func(childComplexity int) int
		SaturatedFat      func(childComplexity int) int
		SideDishes        func(childComplexity int) int
		Sugar             func(childComplexity int) int
		Tags              func(childComplexity int) int
	}

	OccurrenceSideDish struct {
		Dish       func(childComplexity int) int
		Occurrence func(childComplexity int) int
	}

	OccurrenceTag struct {
		Occurrence func(childComplexity int) int
		Tag        func(childComplexity int) int
	}

	Query struct {
		CurrentUser  func(childComplexity int) int
		Dishes       func(childComplexity int, filter *models.DishFilter) int
		Locations    func(childComplexity int, filter *models.LocationFilter) int
		Occurrences  func(childComplexity int, filter *models.OccurrenceFilter) int
		Reviews      func(childComplexity int, filter *models.ReviewFilter) int
		Tags         func(childComplexity int) int
		VcsBuildInfo func(childComplexity int) int
	}

	Review struct {
		AcceptedAt  func(childComplexity int) int
		CreatedAt   func(childComplexity int) int
		DisplayName func(childComplexity int) int
		ID          func(childComplexity int) int
		Images      func(childComplexity int) int
		Occurrence  func(childComplexity int) int
		Stars       func(childComplexity int) int
		Text        func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
	}

	ReviewDataDish struct {
		Images   func(childComplexity int) int
		Metadata func(childComplexity int) int
		Reviews  func(childComplexity int) int
	}

	ReviewDataOccurrence struct {
		Images   func(childComplexity int) int
		Metadata func(childComplexity int) int
		Reviews  func(childComplexity int) int
	}

	ReviewMetadataDish struct {
		AverageStars func(childComplexity int) int
		ReviewCount  func(childComplexity int) int
	}

	ReviewMetadataOccurrence struct {
		AverageStars func(childComplexity int) int
		ReviewCount  func(childComplexity int) int
	}

	Subscription struct {
		ReviewAccepted func(childComplexity int) int
		ReviewCreated  func(childComplexity int) int
	}

	Tag struct {
		Description func(childComplexity int) int
		IsAllergy   func(childComplexity int) int
		Key         func(childComplexity int) int
		Name        func(childComplexity int) int
		Priority    func(childComplexity int) int
		ShortName   func(childComplexity int) int
	}

	User struct {
		Email func(childComplexity int) int
		ID    func(childComplexity int) int
	}

	VcsBuildInfo struct {
		Commit     func(childComplexity int) int
		CommitTime func(childComplexity int) int
		Modified   func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

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

type DishAliasResolver added in v0.6.0

type DishAliasResolver interface {
	Dish(ctx context.Context, obj *ent.DishAlias) (*ent.Dish, error)
	AliasName(ctx context.Context, obj *ent.DishAlias) (string, error)
}

type DishResolver

type DishResolver interface {
	Aliases(ctx context.Context, obj *ent.Dish) ([]*ent.DishAlias, error)
	ReviewData(ctx context.Context, obj *ent.Dish, filter *models.ReviewFilter) (*models.ReviewDataDish, error)
}

type ImageResolver

type ImageResolver interface {
	Review(ctx context.Context, obj *ent.Image) (*ent.Review, error)
}

type MutationResolver

type MutationResolver interface {
	LoginUser(ctx context.Context, input models.LoginUserInput) (string, error)
	CreateTag(ctx context.Context, input models.CreateTagInput) (*ent.Tag, error)
	CreateDish(ctx context.Context, input models.CreateDishInput) (*ent.Dish, error)
	UpdateDish(ctx context.Context, input models.UpdateDishInput) (*ent.Dish, error)
	CreateDishAlias(ctx context.Context, input models.CreateDishAliasInput) (*ent.DishAlias, error)
	DeleteDishAlias(ctx context.Context, input models.DeleteDishAliasInput) (*ent.DishAlias, error)
	CreateOccurrence(ctx context.Context, input models.CreateOccurrenceInput) (*ent.Occurrence, error)
	UpdateOccurrence(ctx context.Context, input models.UpdateOccurrenceInput) (*ent.Occurrence, error)
	DeleteOccurrence(ctx context.Context, input models.DeleteOccurrenceInput) (*ent.Occurrence, error)
	AddTagToOccurrence(ctx context.Context, input models.AddTagToOccurrenceInput) (*models.OccurrenceTag, error)
	RemoveTagFromOccurrence(ctx context.Context, input models.RemoveTagFromOccurrenceInput) (*models.OccurrenceTag, error)
	AddSideDishToOccurrence(ctx context.Context, input models.AddSideDishToOccurrenceInput) (*models.OccurrenceSideDish, error)
	RemoveSideDishFromOccurrence(ctx context.Context, input models.RemoveSideDishFromOccurrenceInput) (*models.OccurrenceSideDish, error)
	CreateReview(ctx context.Context, input models.CreateReviewInput) (*ent.Review, error)
	UpdateReview(ctx context.Context, input models.UpdateReviewInput) (*ent.Review, error)
	DeleteReview(ctx context.Context, input models.DeleteReviewInput) (*ent.Review, error)
	AddImagesToReview(ctx context.Context, input models.AddImagesToReviewInput) (*ent.Review, error)
	DeleteImagesFromReview(ctx context.Context, input models.DeleteImagesFromReviewInput) (*ent.Review, error)
}

type OccurrenceResolver

type OccurrenceResolver interface {
	Location(ctx context.Context, obj *ent.Occurrence) (*ent.Location, error)
	Dish(ctx context.Context, obj *ent.Occurrence) (*ent.Dish, error)
	SideDishes(ctx context.Context, obj *ent.Occurrence) ([]*ent.Dish, error)

	Tags(ctx context.Context, obj *ent.Occurrence) ([]*ent.Tag, error)
	ReviewData(ctx context.Context, obj *ent.Occurrence, filter *models.ReviewFilter) (*models.ReviewDataOccurrence, error)
}

type QueryResolver

type QueryResolver interface {
	CurrentUser(ctx context.Context) (*ent.User, error)
	Tags(ctx context.Context) ([]*ent.Tag, error)
	Dishes(ctx context.Context, filter *models.DishFilter) ([]*ent.Dish, error)
	Occurrences(ctx context.Context, filter *models.OccurrenceFilter) ([]*ent.Occurrence, error)
	Reviews(ctx context.Context, filter *models.ReviewFilter) ([]*ent.Review, error)
	Locations(ctx context.Context, filter *models.LocationFilter) ([]*ent.Location, error)
	VcsBuildInfo(ctx context.Context) (*utils.VCSBuildInfo, error)
}

type ResolverRoot

type ResolverRoot interface {
	Dish() DishResolver
	DishAlias() DishAliasResolver
	Image() ImageResolver
	Mutation() MutationResolver
	Occurrence() OccurrenceResolver
	Query() QueryResolver
	Review() ReviewResolver
	Subscription() SubscriptionResolver
	Tag() TagResolver
}

type ReviewResolver

type ReviewResolver interface {
	Occurrence(ctx context.Context, obj *ent.Review) (*ent.Occurrence, error)

	Images(ctx context.Context, obj *ent.Review) ([]*ent.Image, error)
}

type SubscriptionResolver added in v0.7.0

type SubscriptionResolver interface {
	ReviewCreated(ctx context.Context) (<-chan *ent.Review, error)
	ReviewAccepted(ctx context.Context) (<-chan *ent.Review, error)
}

type TagResolver added in v0.6.0

type TagResolver interface {
	Key(ctx context.Context, obj *ent.Tag) (string, error)
}

Jump to

Keyboard shortcuts

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