-
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.
WPNUX-10 support custom WP post types
- Loading branch information
1 parent
dba766e
commit 88113e2
Showing
3 changed files
with
53 additions
and
4 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,39 @@ | ||
--- | ||
title: Custom Post Types | ||
description: | ||
--- | ||
|
||
## Create CPT in WordPress | ||
|
||
https://developer.wordpress.org/reference/functions/register_post_type/ | ||
https://faustjs.org/guide/setting-up-custom-post-types-cpts-in-faust | ||
|
||
## Check query in GarphiQl IDE | ||
|
||
## | ||
|
||
Create [movies].wql and put it in /queries folder in your project | ||
|
||
``` | ||
fragment Movie on Movie { | ||
...ContentNode | ||
...NodeWithFeaturedImage | ||
content | ||
title | ||
editorBlocks { | ||
name | ||
} | ||
} | ||
query Movies($limit: Int = 10) { | ||
movies(first: $limit) { | ||
nodes { | ||
...Movie | ||
} | ||
} | ||
} | ||
``` | ||
|
||
|
||
``` | ||
const { data } = await useGraphqlQuery('Movies') | ||
``` |
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