Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global query "deep" non supported #21

Closed
casualmatt opened this issue Apr 12, 2022 · 2 comments
Closed

global query "deep" non supported #21

casualmatt opened this issue Apr 12, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@casualmatt
Copy link
Collaborator

Version

nuxt-directus 1.5.0
nuxt: v3.0.0-27491748.3186841

Reproduction Link

If you pass those parameters to the SDK, it will not stringify the deep, but only the filter.

fields:[
  "*",
  "invoices.number",
  "invoices.id",
  "invoices.total",
  "invoices.hosted_invoice_url",
  "invoices.status",
  "subscriptions.id",
  "subscriptions.status",
  "subscriptions.metadata_title"
],
deep:[
  {
    "invoices":{
      "_limit":3,
      "_sort":"-created",
    }
  }
]

What is Expected?

that all the Global Query Parameters are supported, because i think that [Aggregation & Grouping](Aggregation & Grouping) could have the same issue been a complicated object.

What is actually happening?

The call made to the server have deep=[object+Object] as one of his parameters.

@casualmatt casualmatt added the bug Something isn't working label Apr 12, 2022
@casualmatt
Copy link
Collaborator Author

probably it just need to be added an other if for deep and maybe one for the aggregation and grouping.

const getItems = async <T>(data: DirectusItemRequest): Promise<T[]> => {
if (data.params?.filter) {
(data.params.filter as unknown) = JSON.stringify(data.params.filter);
}

@Intevel
Copy link
Owner

Intevel commented Apr 14, 2022

Thanks for your Issue @casualmatt. Fixed with the newest release 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants