Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: getting-started edits #801

Merged
merged 4 commits into from
Aug 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -102,7 +102,7 @@ models:
Regenerate by running:

```bash
$ go run github.com/99designs/gqlgen
$ go run github.com/99designs/gqlgen -v
```

> Note
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down