-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
10 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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
# A statically generated blog example using Next.js and WordPress | ||
# NextJS client for (headless) WordPress | ||
|
||
A NextJS starter for WordPress with WPGraphQL based on the excellent [NextJS WordPress example](https://github.com/vercel/next.js/tree/canary/examples/cms-wordpress), featuring: | ||
A NextJS starter for WordPress installations with WPGraphQL, including TypeScript and dynamic type generating with graphql-codegen | ||
|
||
- NextJS | ||
- GraphQL (Requires WordPress installation) | ||
- TypeScript | ||
- Prettier, ESLint, etc | ||
## Features | ||
|
||
## Generating Types | ||
- Works out of the box with any WordPress installation including WPGraphQL | ||
- TypeScript and dynamic type generating with graphql-codegen | ||
- Prettier, ESLint, Husky and Lint Staged | ||
- Tailwind CSS | ||
|
||
By running `yarn generate` you can generate types right from your WPGraphQL schema and the operations defined in `.src/graphql/**/*`. You can see and updat the confing in the `codegen.yml` file in the root of your project. The endpoint is loaded from the `.env.local` to | ||
## Installation | ||
|
||
1. Clone this repository to your machine | ||
2. Run `yarn install` | ||
3. Rename `.env.local.example` to `env.local` file | ||
4. Add your `WORDPRESS_API_URL` url to your `.env.local` file | ||
5. Run `yarn generate:codegen` to generate types\* | ||
6. Run `yarn dev` to start a local server and start developing | ||
|
||
- \*Running graphql-codegen on the WPGraphQL schema generates two invalid enum types, `2048X2048` and `1536X1536`. These are invalid because they start numeric. There is currently an issue opened about this right here: https://github.com/dotansimha/graphql-code-generator/issues/4834. | ||
|
||
### Generating Types | ||
|
||
By running `yarn generate:codegen` you can generate types right from your WPGraphQL schema and the operations defined in `.src/graphql/**/*`. You can see and updat the confing in the `codegen.yml` file in the root of your project. The endpoint is loaded from the `.env.local` file. |
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
5658e65
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.
Successfully deployed to the following URLs: