Gqlgen: docs: Getting start is broken

Created on 21 Jun 2018  路  5Comments  路  Source: 99designs/gqlgen

https://gqlgen.com/getting-started/

Expected Behaviour

I can finish until the end.

Actual Behavior

Un compile error occured.

Minimal graphql.schema and models to reproduce

Resolvers interface doesn't have Todo_user method and Todo struct doesn't have UserID field... 馃憖

Most helpful comment

All 5 comments

relates to #138

make sense.
I should replace User User to UserID string manually and its on types.json.

type Todo struct {
    ID      string     `json:"id"`
    Text    string     `json:"text"`
    Done    bool       `json:"done"`
    UserID string   `json:"-"`
}
{
  "Todo": "github.com/vvakame/til/graphql/try-go-gqlgen/graph.Todo"
}

Yeah your on the right track, but A todo probably only has one user:

type Todo struct {
    ID     string
    Text   string
    Done   bool
    UserID string
}

I wish there was a better way to write those tutorials, such that CI would complain when they broke. So easy to forget about them :-/

Ill run through it and update it.

sounds good!
If there is a missing field, add a method to resolve it to Resolver.
It seems like a pretty good way. 馃樃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewmunro picture andrewmunro  路  4Comments

cajax picture cajax  路  4Comments

huanghantao picture huanghantao  路  3Comments

sumanthakannantha picture sumanthakannantha  路  3Comments

kevinmbeaulieu picture kevinmbeaulieu  路  3Comments