Skip to content

Commit

Permalink
getting started: updating wording around implementing unimpl fns
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronArinder committed Feb 7, 2021
1 parent 997da42 commit ada1b92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ func (r *queryResolver) Todos(ctx context.Context) ([]*model.Todo, error) {

We just need to implement these two methods to get our server working:

First we need somewhere to track our state, lets put it in `graph/resolver.go`:
First we need somewhere to track our state, lets put it in `graph/resolver.go`. `graph/resolver.go` is where we declare any dependencies for our app, like our database. It gets initialized once in `server.go` when we create the graph.

```go
type Resolver struct{
todos []*model.Todo
}
```
This is where we declare any dependencies for our app like our database, it gets initialized once in `server.go` when
we create the graph.

Returning to `graph/schema.resolvers.go`, let's implement our unimplemented function bodies:

```go
func (r *mutationResolver) CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error) {
Expand Down

0 comments on commit ada1b92

Please sign in to comment.