fix nil userId on getTodo query

This commit is contained in:
gilex-dev 2023-11-17 23:49:50 +01:00
parent 4851da8d19
commit a7c1ebe4b9
1 changed files with 1 additions and 1 deletions

View File

@ -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.