next-drupal icon indicating copy to clipboard operation
next-drupal copied to clipboard

collection meta info has been dropped.

Open kongkx opened this issue 2 years ago • 1 comments

Package containing the bug

next-drupal (NPM package)

Describe the bug

getResourceCollection, and getSearchIndex returns only array of data when doing deserialize. Not able to handle pagination.

Expected behavior

include extra info like getView

  const results = options.deserialize ? this.deserialize(data) : data

  return {
      id: name,
      results,
      meta: data.meta,
      links: data.links,
    }

kongkx avatar Mar 13 '24 06:03 kongkx

hi,

please activate in the Drupal backend under /admin/config/services/jsonapi/extras the point Include count in collection queries.

After this you can use getResourceCollectionwith the deserialize: false option. Note that you must deserialize your result by yourself.

taskrider2022 avatar Dec 04 '24 12:12 taskrider2022