Documentation

Overview

Package zgql provides zap extensions and middleware for `99designs/gqlgen` (https://github.com/99designs/gqlgen).

TODO: examples

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphCtxHandler

func GraphCtxHandler(next http.Handler) http.Handler

GraphCtxHandler injects request fields into context for use with the GraphQL request logger. Should wrap the mux used to handle the GraphQL resolver.

func NewMiddleware

func NewMiddleware(l *zap.Logger, f LogFields) graphql.RequestMiddleware

NewMiddleware returns a logger for use with GraphQL queries

Types

type LogFields

type LogFields map[string]func(context.Context) string

LogFields customizes the fields logged

Source Files