From 88a84f83320c19fb01b6935af8d4fd34652344fc Mon Sep 17 00:00:00 2001 From: John Curley Date: Fri, 29 Jun 2018 20:34:29 +1200 Subject: [PATCH] Updated mutation to take correct argument --- docs/content/getting-started.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/getting-started.md b/docs/content/getting-started.md index 6f9ac21844..1947e1cbc6 100644 --- a/docs/content/getting-started.md +++ b/docs/content/getting-started.md @@ -167,11 +167,11 @@ func (a *MyApp) Query_todos(ctx context.Context) ([]Todo, error) { return a.todos, nil } -func (a *MyApp) Mutation_createTodo(ctx context.Context, text string) (Todo, error) { +func (a *MyApp) Mutation_createTodo(ctx context.Context, input NewTodo) (Todo, error) { todo := Todo{ - Text: text, + Text: input.Text, ID: fmt.Sprintf("T%d", rand.Int()), - UserID: fmt.Sprintf("U%d", rand.Int()), + UserID: input.UserId, } a.todos = append(a.todos, todo) return todo, nil @@ -214,7 +214,7 @@ go run main.go then open http://localhost:8080 in a browser. here are some queries to try: ```graphql mutation createTodo { - createTodo(input:{text:"todo", user:"1"}) { + createTodo(input:{text:"todo", userId:"1"}) { user { id }