Documentation
¶
Overview ¶
Package graphql provides Ridu's optional, manifest-derived GraphQL transport. Applications that do not import this package do not link a GraphQL runtime.
Index ¶
Constants ¶
View Source
const Key = "graphql"
Variables ¶
This section is empty.
Functions ¶
func GenerateSDL ¶
GenerateSDL returns the deterministic schema definition for a resolved Ridu manifest. It does not enable network introspection or require a running app.
Types ¶
type ExtensionContext ¶
type ExtensionContext struct {
Context context.Context
Args map[string]interface{}
Info enginegraphql.ResolveInfo
Actor *store.Document
ActorCollection riduschema.CollectionSlug
Local *ridu.LocalAPI
App *ridu.App
}
ExtensionContext is scoped to one GraphQL field execution.
type ExtensionField ¶
type ExtensionField struct {
Name string
Description string
Type enginegraphql.Output
Args enginegraphql.FieldConfigArgument
Cost int
Resolve ExtensionResolver
}
ExtensionField adds one trusted compiled root field. Resolvers receive the authenticated actor and Ridu's public APIs, not a store adapter.
type ExtensionResolver ¶
type ExtensionResolver func(ExtensionContext) (interface{}, error)
ExtensionResolver executes one custom query or mutation.
type Options ¶
type Options struct {
Path string
MaxBodyBytes int64
MaxVariableBytes int
MaxDepth int
MaxAliases int
MaxComplexity int
MaxListLimit int
AllowIntrospection bool
// Resources optionally renames or suppresses generated surfaces by
// collection/global slug. Omitted resources use their manifest labels and
// expose both queries and mutations.
Resources map[string]ResourceOptions
Queries []ExtensionField
Mutations []ExtensionField
ValidationRules []enginegraphql.ValidationRuleFn
}
Options controls the exact GraphQL route and resource safeguards. Zero values select secure defaults.
Click to show internal directories.
Click to hide internal directories.