chapter-three / next-drupal

Next.js for Drupal has everything you need to build a next-generation front-end for your Drupal site: SSG, SSR, and ISR, Multi-site, Authentication, Webforms, Search API, I18n and Preview mode (works with JSON:API and GraphQL).
https://next-drupal.org
MIT License
630 stars 175 forks source link

getMenu with addFields not working #515

Open Kaushikdugar opened 1 year ago

Kaushikdugar commented 1 year ago

I want to pull limited fields and only the tree for the getMenu. What is the way to achieve the same. Tried few things as below but did not worked , it returns all fields under items and tree objects. Is there any way to limit to get only tree results with limited set of fields

const navpageMenuParams = new DrupalJsonApiParams().addFields("menu--menu", [ "id", "title", ]); let navData = await drupal.getMenu("navigation", { params: navpageMenuParams.getQueryObject(), });

MathiasGmeiner commented 1 year ago

@Kaushikdugar try to edit the resource overrides: /admin/config/services/jsonapi/resource_types