Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 597 Bytes

README.md

File metadata and controls

35 lines (22 loc) · 597 Bytes

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.