Blog
😲 15 things (you didn’t know) you can do with GraphQL in WordPress
I was invited to present Gato GraphQL on WordCamp Malaysia 2023 last September, and the video of the talk is now live:
15 things (you didn’t know) you can do with GraphQL in WordPress.
Here is the video:
Timestamps:
[00:00] Intro
[00:49] What we usually know about using GraphQL in WordPress
[02:43] Exploring Gato GraphQL in the wp-admin:
- [02:53] Private GraphiQL client
- [04:00] Private Interactive schema client
- [04:36] Public GraphiQL client
- [05:39] Public Interactive schema client
- [06:19] Custom endpoints
- [06:52] Persisted queries
[08:14] 15 things we can do with Gato GraphQL in WordPress:
- [08:51] Intro to Recipes section
- [09:29] (#1) Search WP data (eg: finding posts or users by metadata)
- [12:40] (#2) Complement WP-CLI (eg: selecting on which resources to apply a command)
- [14:10] (#3) Send personalized emails
- [16:18] (#4) Retrieve data for blocks for both CSR and SSR (using DRY logic!) [skip demo]
- [16:40] (#5) Map JavaScript components to blocks [skip demo]
- [16:49] (#6) Duplicate a blog post
- [18:22] (#7) Customize content for different users [skip demo]
- [18:28] (#8) Adapt content in bulk (eg: replacing a string in all posts, as when migrating the site's domain)
- [20:14] (#9) Automate admin tasks (eg: inserting a mandatory block whenever missing) [skip demo]
- [20:53] (#10) Add a custom CTA block before a campaign to all posts, and remove it afterwards [skip demo]
- [20:56] (#11) Translate a blog post (at the block-property level!)
- [23:13] (#12) Send a notification when there's a new post, and a daily summary of activity to your email [skip demo]
- [23:17] (#13) Combine data from Mailchimp subscribers and website users [skip demo]
- [23:24] (#14) Import a post from another WordPress site [skip demo]
- [23:26] (#15) Distribute content to multiple downstream sites (eg: sync data within a multisite) [skip demo]
[23:34] Conclusion
[23:53] Q&A:
- [23:54] "What prompted you to build this plugin? Was there any problem that you encountered as a developer, so you decided to create this plugin?"
- [25:13] "Is it possible to do it with the REST API? For instance Gato REST API?"
- [25:52] "The part with the tables with the relationships [The GraphQL schema], what is that about?"
- [27:58] "[About the GraphQL schema] Is it automated, or do we need to do manual mapping?"
- [29:47] "Can it be used to power an AI assistant? (Using GraphQL instead of the REST API)"
These are the slides:
Enjoy!