Cannot read property 'queryContext' of undefined


#1

Hi,

I have a problem with query builder, I have this error:

TypeError: Cannot read property ‘queryContext’ of undefined

const user = await auth.getUser()`

    const posts = await Post.query()
            .where('user_id', user.id)
            .orderBy('id', 'desc')
            .withCount('comments')
            .paginate(page, 10)

    response.status(200).send(posts)

#2

Can you upgrade to @adonisjs/lucid to 5.0.2. It happened due to a breaking change shipped by knex recently


#3

Thank you for help!