Code Generator for Initializing graphql-go server
go get -u github.com/abihf/graphql-codegen
graphql-codegen -dir out/dir -package resolve "source/schema.gql"
It will generate resolvers inside out/dir
.
Use goimports or goreturns to automatically remove unnecessary import and format the generated codes.