Documentation ¶
Overview ¶
This package is inspired by the work of Ravil Galaktionov on https://github.com/ravilushqa/otelgqlgen project
The project is rewritted on s42 app due to the fact of how otel is used. On August 2022, this option is not possible with the package of ravilushqa, that the motivation of the rewrite. All credits to Ravil Galaktionov
This package is inspired by the work of Ravil Galaktionov on https://github.com/ravilushqa/otelgqlgen project
The project is rewritted on s42 app due to the fact of how otel is used. On August 2022, this option is not possible with the package of ravilushqa, that the motivation of the rewrite. All credits to Ravil Galaktionov
Index ¶
- func GetOperationName(ctx context.Context) string
- func RequestComplexityLimit(complexityLimit int64) attribute.KeyValue
- func RequestOperationComplexity(complexityLimit int64) attribute.KeyValue
- func RequestQuery(requestQuery string) attribute.KeyValue
- func RequestVariables(requestVariables map[string]interface{}) []attribute.KeyValue
- func ResolverAlias(resolverAlias string) attribute.KeyValue
- func ResolverArgs(argList ast.ArgumentList) []attribute.KeyValue
- func ResolverErrors(errorList gqlerror.List) []attribute.KeyValue
- func ResolverField(resolverField string) attribute.KeyValue
- func ResolverObject(resolverObject string) attribute.KeyValue
- func ResolverPath(resolverPath string) attribute.KeyValue
- func SetOperationName(ctx context.Context, name string) context.Context
- type RequestVariablesBuilderFunc
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperationName ¶
GetOperationName gets the operation name from the context.
func RequestComplexityLimit ¶
RequestComplexityLimit sets the complexity limit.
func RequestOperationComplexity ¶
RequestOperationComplexity sets the operation complexity.
func RequestQuery ¶
RequestQuery sets the request query.
func RequestVariables ¶
RequestVariables sets request variables.
func ResolverAlias ¶
ResolverAlias sets resolver alias.
func ResolverArgs ¶
func ResolverArgs(argList ast.ArgumentList) []attribute.KeyValue
ResolverArgs sets resolver args.
func ResolverErrors ¶
ResolverErrors sets errors.
func ResolverField ¶
ResolverField sets resolver field.
func ResolverObject ¶
ResolverObject sets resolver object.
func ResolverPath ¶
ResolverPath sets resolver path.
func SetOperationName ¶
SetOperationName adds the operation name to the context so that the interceptors can use it. It will replace the operation name if it already exists in the context. example:
ctx = otelgqlgen.SetOperationName(r.Context(), "my-operation") r = r.WithContext(ctx)
Types ¶
type RequestVariablesBuilderFunc ¶
RequestVariablesBuilderFunc is the signature of the function used to build the request variables attributes.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func Middleware ¶
Middleware sets up a handler to start tracing the incoming requests. The service parameter should describe the name of the (virtual) server handling the request. extension parameter may be empty string.
func (Tracer) InterceptField ¶
func (Tracer) InterceptResponse ¶
func (Tracer) Validate ¶
func (a Tracer) Validate(_ graphql.ExecutableSchema) error