searchgen

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package searchgen provides the the ability to generate a search resolver

Index

Constants

This section is empty.

Variables

View Source
var SearchDirective = entgql.NewDirective("search")

Functions

This section is empty.

Types

type Object

type Object struct {
	// Name of the object
	Name string
	// Fields of the object that are searchable
	Fields []genhooks.Field
	// AdminFields of the object that are searchable
	AdminFields []genhooks.Field
}

Object is a struct to hold the object name for the bulk resolver

type SearchPlugin

type SearchPlugin struct {
	EntGeneratedPackage string
}

SearchPlugin is a gqlgen plugin to generate search functions

func New

func New(entPackage string) *SearchPlugin

NewSearchPlugin returns a new search plugin

func (SearchPlugin) GenerateCode

func (r SearchPlugin) GenerateCode(data *codegen.Data) error

GenerateCode implements api.CodeGenerator to generate the search resolver and it's helper functions

func (SearchPlugin) Name

func (r SearchPlugin) Name() string

Name returns the name of the plugin This name must match the upstream resolvergen to replace during code generation

type SearchResolverBuild

type SearchResolverBuild struct {
	// Name of the search type
	Name string
	// Objects is a list of objects to generate bulk resolvers for
	Objects []Object
	// EntPackageName is the ent generated package that holds the generated types
	EntPackageName string
}

SearchResolverBuild is a struct to hold the objects for the bulk resolver

Jump to

Keyboard shortcuts

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