Skip to content

nrfta/go-gqlgen-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-gqlgen-helpers

Install

go get -u "github.com/nrfta/go-gqlgen-helpers"

GraphQL gqlgen error handling

// ...
router.Handle("/graphql",
  handler.GraphQL(
    NewExecutableSchema(Config{Resolvers: &Resolver{}}),
    errorhandling.ConfigureErrorPresenterFunc(reportErrorToSentry),
    errorhandling.ConfigureRecoverFunc(),
  ),
)

// ...

func reportErrorToSentry(ctx context.Context, err error) {
  // Whatever
}

License

This project is licensed under the MIT License.