# Golang - GraphQL With Gqlgen

## Create the project skeleton

• gqlgen.yml — The gqlgen config file, knobs for controlling the generated code.
• generated.go — The GraphQL execution runtime, the bulk of the generated code.
• models_gen.go — Generated models required to build the graph. Often you will override these with your own models. Still very useful for input types.
• resolver.go — This is where your application code lives. generated.go will call into this to get the data the user has requested.
• server/server.go — This is a minimal entry point that sets up an http.Handler to the generated GraphQL server.

## Implement the resolvers

generated.go 產生了很多個 resolvers interface，接著就要實作這些，但 resolver.go 這個檔案，再新增新的 method 時，要重新再產生一份

# Query

## Finishing touches

At the top of our resolver.go add the following line:

This magic comment tells go generate what command to run when we want to regenerate our code