Skip to content

Commit

Permalink
Merge pull request 99designs#157 from johncurley/fix-docs-argument
Browse files Browse the repository at this point in the history
Updated mutation to take correct argument
  • Loading branch information
vektah authored Jul 1, 2018
2 parents 6e7f134 + 1a9c794 commit 5071c71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5071c71

Please sign in to comment.