This is part of a series. It is not suited for beginners, but they are welcome too! You can check out the other parts here:
And review how to get up to this part. As always, all the code is at GitHub for part 4.
Let’s add Goth to our project:
$ go get -u github.com/markbates/goth
We can start referencing Goth into our server code, there are a few…
This piece is part of a series. It’s not suited to beginners but you can check it out from the start with part 1
You can review how to get up to this part.
As always, the code is in GitHub.
And, you can also check out part 2, in case you’ve missed it. …
Now, we can use gqlgen to initialize our server’s gqlgen generated files:
go run github.com/99designs/gqlgen init
This will initialize the gqlgen server. We have to make modifications to fit our project layout, however. Move a couple of files and edit the
generated.go(file that holds the gqlgen's generated GraphQL server code.)
resolver.go(holds the resolvers for the queries and mutations.)
schema.graphql(example schema that gqlgen generates, we'll modify this.)
This project assumes you have at least basic Go knowledge, Go 1.12+ installed, and VSCode (preferred) or similar IDE.
We’ll follow the Go standard project layout for this service. Take a look at the specification. It is opinionated and serves as a good base, though we might stray a little bit from its guidelines.
Start by creating a directory anywhere we want to:
Let’s create the whole project layout with:
internal/gql-server will hold…