Skip to content

Commit

Permalink
tutorial fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Jun 23, 2018
1 parent 0a85d4f commit f48cbf0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type Todo struct {
ID string
Text string
Done bool
UserID User
UserID string
}

```
Expand All @@ -91,6 +91,7 @@ This simply says, `User` in schema is backed by `graph.User` in go.


gqlgen then follows some pretty simple rules to match up all the fields:

1. If there is a property with that name and type, use it
2. If there is a method with that name and type, use it
3. Otherwise, add it to the Resolvers interface. This is the magic.
Expand All @@ -103,7 +104,7 @@ Lets generate the server now:
```bash
mkdir graph
cd graph
gqlgen -schema ../schema.graphql
gqlgen -types types.json -schema ../schema.graphql
```

gqlgen should have created two new files `generated.go` and `models_gen.go`. If we take a peek in both we can see what the server has generated:
Expand Down

0 comments on commit f48cbf0

Please sign in to comment.