package extension
import "github.com/99designs/gqlgen/graphql/handler/extension"
Index ¶
- type ApqStats
- type AutomaticPersistedQuery
- func (a AutomaticPersistedQuery) ExtensionName() string
- func (a AutomaticPersistedQuery) MutateOperationParameters(ctx context.Context, rawParams *graphql.RawParams) *gqlerror.Error
- func (a AutomaticPersistedQuery) Validate(schema graphql.ExecutableSchema) error
- type ComplexityLimit
- func FixedComplexityLimit(limit int) *ComplexityLimit
- func (c ComplexityLimit) ExtensionName() string
- func (c ComplexityLimit) MutateOperationContext(ctx context.Context, opCtx *graphql.OperationContext) *gqlerror.Error
- func (c *ComplexityLimit) Validate(schema graphql.ExecutableSchema) error
- type ComplexityStats
- type Introspection
Types ¶
type ApqStats ¶
type ApqStats struct { // The hash of the incoming query Hash string // SentQuery is true if the incoming request sent the full query SentQuery bool }
func GetApqStats ¶
type AutomaticPersistedQuery ¶
AutomaticPersistedQuery saves client upload by optimistically sending only the hashes of queries, if the server does not yet know what the query is for the hash it will respond telling the client to send the query along with the hash in the next request. see https://github.com/apollographql/apollo-link-persisted-queries
func (AutomaticPersistedQuery) ExtensionName ¶
func (a AutomaticPersistedQuery) ExtensionName() string
func (AutomaticPersistedQuery) MutateOperationParameters ¶
func (a AutomaticPersistedQuery) MutateOperationParameters(ctx context.Context, rawParams *graphql.RawParams) *gqlerror.Error
func (AutomaticPersistedQuery) Validate ¶
func (a AutomaticPersistedQuery) Validate(schema graphql.ExecutableSchema) error
type ComplexityLimit ¶
type ComplexityLimit struct { Func func(ctx context.Context, opCtx *graphql.OperationContext) int // contains filtered or unexported fields }
ComplexityLimit allows you to define a limit on query complexity
If a query is submitted that exceeds the limit, a 422 status code will be returned.
func FixedComplexityLimit ¶
func FixedComplexityLimit(limit int) *ComplexityLimit
FixedComplexityLimit sets a complexity limit that does not change
func (ComplexityLimit) ExtensionName ¶
func (c ComplexityLimit) ExtensionName() string
func (ComplexityLimit) MutateOperationContext ¶
func (c ComplexityLimit) MutateOperationContext(ctx context.Context, opCtx *graphql.OperationContext) *gqlerror.Error
func (*ComplexityLimit) Validate ¶
func (c *ComplexityLimit) Validate(schema graphql.ExecutableSchema) error
type ComplexityStats ¶
type ComplexityStats struct { // The calculated complexity for this request Complexity int // The complexity limit for this request returned by the extension func ComplexityLimit int }
func GetComplexityStats ¶
func GetComplexityStats(ctx context.Context) *ComplexityStats
type Introspection ¶
type Introspection struct{}
EnableIntrospection enables clients to reflect all of the types available on the graph.
func (Introspection) ExtensionName ¶
func (c Introspection) ExtensionName() string
func (Introspection) MutateOperationContext ¶
func (c Introspection) MutateOperationContext(ctx context.Context, opCtx *graphql.OperationContext) *gqlerror.Error
func (Introspection) Validate ¶
func (c Introspection) Validate(schema graphql.ExecutableSchema) error
Source Files ¶
apq.go complexity.go introspection.go
- Version
- v0.17.73 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 3 hours ago –
Tools for package owners.