Skip to content

Commit

Permalink
feat: add pages router example to client intro page
Browse files Browse the repository at this point in the history
  • Loading branch information
backlineint committed Nov 5, 2024
1 parent 9dcc592 commit 11a18fc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion www/content/docs/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,18 @@ const article = await drupal.getResource(

### Pages Router

TODO
```ts
import { NextDrupalPages } from "next-drupal"

// Create a new DrupalClient.
const drupal = new NextDrupalPages("https://example.com")

// Fetch articles.
const articles = await drupal.getResourceCollection("node--article")

// Fetch one article by id.
const article = await drupal.getResource(
"node--article",
"f4c61473-8297-4bf3-bab7-21c9633a7ca7"
)
```

0 comments on commit 11a18fc

Please sign in to comment.