-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
795d956
commit 4a20f9b
Showing
11 changed files
with
85 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,5 +1,67 @@ | ||
# @faustwp/experimental-app-router | ||
|
||
## 0.0.3 | ||
|
||
### Patch Changes | ||
|
||
- a1b6fc0: Introduced a new API handler for App router projects called `faustRouteHandler`. It can be used by creating a file `/app/api/faust/[route]/route.js` with the following contents: | ||
|
||
```js | ||
// /app/api/faust/[route]/route.js | ||
import { faustRouteHandler } from '@faustwp/experimental-app-router'; | ||
|
||
const { GET, POST } = faustRouteHandler; | ||
|
||
export { GET, POST }; | ||
``` | ||
|
||
- a1b6fc0: Created `getAuthClient` for making authenticated server side requests in the Next.js App Router. It can be used like: | ||
|
||
```js | ||
import { getAuthClient } from '@faustwp/experimental-app-router'; | ||
|
||
// app/my-account/posts/page.js | ||
export default async function Page() { | ||
const client = await getAuthClient(); | ||
|
||
if (!client) { | ||
return <>You must be authenticated to view this page!</>; | ||
} | ||
|
||
const { data } = await client.query({ | ||
query: gql` | ||
query GetMyPosts { | ||
viewer { | ||
posts { | ||
nodes { | ||
id | ||
title | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
}); | ||
|
||
return( | ||
<> | ||
<h2>My posts</h2> | ||
<ul> | ||
{data.viewer.posts.nodes.map((post) => ( | ||
<li key={post.id}>{post.title}</li> | ||
))} | ||
</ul> | ||
</> | ||
) | ||
``` | ||
**Note:** Our login/logout utils are still in the works. | ||
- Updated dependencies [a419252] | ||
- Updated dependencies [cf887d3] | ||
- Updated dependencies [795d956] | ||
- @faustwp/[email protected] | ||
## 0.0.2 | ||
### Patch Changes | ||
|
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
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
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
4a20f9b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the recent updates to your Atlas environment:
Learn more about building on Atlas in our documentation.