Skip to content

Commit

Permalink
docs(www): add sparse fieldset example for view
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn committed Feb 3, 2023
1 parent 7f27653 commit 511a94d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions www/content/docs/reference/getview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ const view = await drupal.getView<T = JsonApiResource>(
const view = await drupal.getView("articles--promoted")
```

- Using sparse fieldsets to only fetch the title and body fields.

```ts
const view = await drupal.getView("articles--promoted", {
params: {
fields: {
"node--article": "title,body",
},
},
})
```

---

## TypeScript
Expand Down

1 comment on commit 511a94d

@vercel
Copy link

@vercel vercel bot commented on 511a94d Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.