-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: created a dynamic page that requests dpl-cms data and paragraphs
- Loading branch information
1 parent
6ab61d6
commit 515f9f2
Showing
6 changed files
with
503 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react" | ||
|
||
import { fetcher } from "@/lib/graphql/fetchers/dpl-cms.fetcher" | ||
import { GetPageByPathDocument, GetPageByPathQuery } from "@/lib/graphql/generated/dpl-cms/graphql" | ||
|
||
async function page(props: { params: Promise<{ path: string[] }> }) { | ||
const params = await props.params | ||
|
||
const { path } = params | ||
|
||
const data = await fetcher<GetPageByPathQuery, { path: string }>(GetPageByPathDocument, { | ||
path: path.join("/"), | ||
})() | ||
|
||
return ( | ||
<div> | ||
page | ||
<pre>{JSON.stringify(data, null, 2)}</pre> | ||
</div> | ||
) | ||
} | ||
|
||
export default page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.