zgql

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2019 License: MIT Imports: 6 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL