graphql

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const IntrospectionQueryField = "_xgen_introspection"

Variables

View Source
var GraphqlContextKey = ContextKey("GRAPHQL_CONTEXT")

Functions

func Generate

func Generate(ctx context.Context, name string) error

Generate generates a graphql set for the project. Using the gqlgen library.

func PrepareContext

func PrepareContext(ctx context.Context, gqlgenContext GraphqlContext) context.Context

PrepareContext returns a new context with the graphql context.

Types

type ContextKey

type ContextKey string

ContextKey is a key for context

type GraphqlContext

type GraphqlContext struct {
	ParentPackageName           string
	GeneratedFilePrefix         string
	ConfigOverrideCallback      func(cfg *config.Config) error
	CustomDirectivesDefinitions []*ast.DirectiveDefinition
	CustomSchemaFiles           config.StringList
	SchemaInjectorHooks         []InjectorHook
	GeneratorApiOptions         []api.Option
}

func GetGraphqlContext

func GetGraphqlContext(ctx context.Context) (*GraphqlContext, error)

GetGraphqlContext returns the graphql context from the context.

type InjectorHook

type InjectorHook func(schema *ast.Schema) generator.SchemaHook

type Plugin

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

func NewPlugin

func NewPlugin(
	name string,
	parentPackageName string,
	generatedFilePrefix string,
	schemaGeneratorHooks ...InjectorHook,
) *Plugin

NewPlugin creates a new plugin

func (*Plugin) Implement

func (m *Plugin) Implement(field *codegen.Field) string

func (*Plugin) InjectSourceLate

func (m *Plugin) InjectSourceLate(schema *ast.Schema) *ast.Source

func (*Plugin) Name

func (m *Plugin) Name() string

Name returns the name of the plugin

Jump to

Keyboard shortcuts

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