Nuxt · Content

NUXT0005Use queryCollection instead of queryContent

Flags querycontent legacy API in Nuxt project code before it leaks into runtime behavior.

Why it happens

Nuxt gives this pattern a specific contract. Staying inside that contract makes the code easier to test, refactor, and run across server and client runtimes.

Fix

Remove querycontent legacy API, or move it to the Nuxt runtime/API that owns that behavior.

Example

Use queryCollection

Before

const posts = await queryContent('/blog').find()

After

const posts = await queryCollection('blog').all()

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm nuxt doctor --rules nuxt-content/no-querycontent-legacy-api
Copyright © 2026