Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶ added in v0.11.0
type File struct {
// These are separated because the type definition of the resolver object may live in a
// different file from the resolver method implementations, for example when extending a type in
// a different graphql schema file
Objects []*codegen.Object
Resolvers []*Resolver
RemainingSource string
// contains filtered or unexported fields
}
type Resolver ¶ added in v0.11.0
type Resolver struct {
Object *codegen.Object
Field *codegen.Field
PrevDecl *ast.FuncDecl
Comment string
ImplementationStr string
ImplementationRender func(prevImplementation string, r *codegen.Field) string
}
func (*Resolver) Implementation ¶ added in v0.11.0
type ResolverBuild ¶
type ResolverBuild struct {
*File
HasRoot bool
PackageName string
ResolverType string
OmitTemplateComment bool
}
func (*ResolverBuild) ResolverTypeDeclarations ¶ added in v0.17.93
func (b *ResolverBuild) ResolverTypeDeclarations() string
ResolverTypeDeclarations renders the unexported per-object resolver implementation types — e.g. "queryResolver struct{ *Resolver }".
When more than one type is declared they are emitted as a single grouped "type ( ... )" block: gofumpt requires adjacent single-line type declarations to be grouped, so producing the group (already column-aligned) here keeps the generated file gofumpt-compliant without relying on a gofmt/gofumpt pass over the codegen output. A lone type is emitted as a single declaration, and the empty string is returned when there are no resolver objects.
Click to show internal directories.
Click to hide internal directories.