| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repo is an example of how to add error types (a.k.a error codes) to your gqlgen GraphQL server for Go.
The project demonstrates two features:
For a further explanation, check out my blog post: Who Moved My Error Codes? Adding error types to your GoLang GraphQL Server
Run the project to see how it works, then have a look at the implementation to understand how it uses error types for its functionality.
Then, try disabling the error type and error masking features by editing the server/main.go file and comment out the srv.SetErrorPresenter(GqlErrorPresenter) line, and rerun the server. Repeat the demo to see how it is affected.
Run the server:
cd server
go run .Then run the server by running the client:
cd client
go run .You can also work against the server using the GraphQL playground at http://localhost:8080/playground
| Back | FazBrowse Home | New Git URL |