diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md index 6f3690ea88e..7f7d0dfd018 100644 --- a/docs/content/getting-started.md +++ b/docs/content/getting-started.md @@ -33,7 +33,7 @@ $ go mod init github.com/[username]/gqlgen-todos ### Define the schema gqlgen is a schema-first library — before writing code, you describe your API using the GraphQL -[Schema Definition Language](http://graphql.org/learn/schema/). This usually goes into a file called `schema.graphql`: +[Schema Definition Language](http://graphql.org/learn/schema/). This usually goes into a file called `schema.graphql`. A basic example as follows will be generated by the `init` command: ```graphql type Todo { @@ -102,7 +102,7 @@ models: Regenerate by running: ```bash -$ go run github.com/99designs/gqlgen +$ go run github.com/99designs/gqlgen -v ``` > Note @@ -195,7 +195,7 @@ func (r *mutationResolver) CreateTodo(ctx context.Context, input NewTodo) (*Todo type queryResolver struct{ *Resolver } -func (r *queryResolver) Todos(ctx context.Context) ([]Todo, error) { +func (r *queryResolver) Todos(ctx context.Context) ([]*Todo, error) { return r.todos, nil } @@ -237,7 +237,7 @@ query findTodos { ## Finishing touches -At the top of our `resolver.go` add the following line: +At the top of our `resolver.go`, between `package` and `import`, add the following line: ```go //go:generate go run github.com/99designs/gqlgen