content icon indicating copy to clipboard operation
content copied to clipboard

query prop is inconsistent between ContentList and ContentNavigation

Open sudoLife opened this issue 3 years ago • 1 comments

Environment

- Operating System: `Linux`
- Node Version:     `v16.15.1`
- Nuxt Version:     `3.0.0-rc.4`
- Package Manager:  `[email protected]`
- Builder:          `vite`
- User Config:      `target`, `head`, `modules`, `components`
- Runtime Modules:  `@nuxt/[email protected]`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`
- Build Modules:    `-`

Reproduction

No reproduction is needed in this case.

Describe the bug

According to the documentation, for ContentNavigation, it's

  • query: A query to be passed to fetchContentNavigation().
    • Type: QueryBuilderParams | QueryBuilder
    • Default: undefined

For ContentList it's different:

  • query: A query to be passed to queryContent().
    • Type: QueryBuilderParams
    • Default: undefined

It's quite confusing. Also, in the case of ContentList, the query is not passed to queryContent(), it's passed to ContentQuery, so either the docs or the code has to be changed.

My two cents is that it'd be great to have the same API in these two cases as it'd be much more intuitive.

Thanks to @tomaszal for helping to pinpoint the issue.

Additional context

No response

Logs

No response

sudoLife avatar Jul 09 '22 18:07 sudoLife

I also have this issue, it's confusing and makes the creation helper functions e.g. to share queries hard to implement.

itpropro avatar Sep 19 '22 20:09 itpropro