fix nil userId on getTodo query
This commit is contained in:
parent
4851da8d19
commit
a7c1ebe4b9
|
@ -138,7 +138,7 @@ func (r *queryResolver) User(ctx context.Context, id string) (*model.User, error
|
||||||
|
|
||||||
// Todo is the resolver for the todo field.
|
// Todo is the resolver for the todo field.
|
||||||
func (r *queryResolver) Todo(ctx context.Context, id string) (*model.Todo, error) {
|
func (r *queryResolver) Todo(ctx context.Context, id string) (*model.Todo, error) {
|
||||||
return globals.DB.GetTodo(&model.Todo{ID: id})
|
return globals.DB.GetTodo(&model.Todo{ID: id, User: &model.User{ID: auth.ForContext(ctx).UserId}})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Role is the resolver for the role field.
|
// Role is the resolver for the role field.
|
||||||
|
|
Loading…
Reference in New Issue