From 47ab3e1c9c44801b95918017c7be2961dc785e12 Mon Sep 17 00:00:00 2001 From: Jeffrey Horn Date: Wed, 4 May 2022 14:16:22 -0700 Subject: [PATCH] Update eagerly fetching section This fixes the docs so that the generate command will correctly generate the User resolver. --- docs/content/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md index 300463bfb5c..adbca7260da 100644 --- a/docs/content/getting-started.md +++ b/docs/content/getting-started.md @@ -211,7 +211,7 @@ type Todo struct { ID string `json:"id"` Text string `json:"text"` Done bool `json:"done"` - User *User `json:"user"` + UserID string `json:"user"` } ``` @@ -226,7 +226,7 @@ func (r *mutationResolver) CreateTodo(ctx context.Context, input model.NewTodo) todo := &model.Todo{ Text: input.Text, ID: fmt.Sprintf("T%d", rand.Int()), - User: &model.User{ID: input.UserID, Name: "user " + input.UserID}, + UserID: input.UserID, } r.todos = append(r.todos, todo) return todo, nil