🔥 Subscribe to our newsletter to be notified when a new recipe becomes available.


  1. Recipes - Intro

    Gato GraphQL is a productivity tool for interacting with data in your WordPress site. You can think of it as a Swiss Army knife for dealing with data in a WordPress site, as it allows to retrieve, manipulate and store again any piece of data, in any desired way.

  2. Searching WordPress data

    Examples on using Gato GraphQL to search for posts (and also users, comments, and taxonomies) by meta key and value.

  3. Querying dynamic data

    Gato GraphQL allows us to dynamically compute data, input it back into the query, and affect the response with granular control. Here is how.

  4. Exposing public and private endpoints

    Gato GraphQL expands enables exposing multiple custom endpoints, each of them tailored to some specific need, and these can be made private and public. When should we use each?

  5. Complementing WP-CLI

    Recipe on how to use Gato GraphQL to find the data we need, and then inject it into WP-CLI.

  6. Injecting multiple resources into WP-CLI

    Recipe on retrieving multiple user IDs while executing a single GraphQL query, and injecting these into WP-CLI.

  7. Feeding data to blocks in the editor

    Content in the the WordPress editor is created via (Gutenberg) blocks, which fetch their data from the server via an API. WordPress core uses the WP REST API, but we can also use Gato GraphQL to power our own blocks.

  8. DRY code for blocks in Javascript and PHP

    Recipe showing how to use Gato GraphQL to have a single source of truth to fetch data for both the client and server-sides when rendering Gutenberg blocks.

  9. Mapping JS components to (Gutenberg) blocks

    Recipe presenting an example Preact app that queries for block data and maps it into customized JavaScript components.

  10. Duplicating a blog post

    Duplicating a post is an example of Gato GraphQL's ability to retrieve, manipulate and store again data in the site.

  11. Duplicating multiple blog posts at once

    Recipe on duplicating multiple posts with a single GraphQL request.

  12. Customizing content for different users

    Recipe on retrieving a different response in a field depending on some piece of queried data, such as the roles of the logged-in user.

  13. Search, replace, and store again

    Examples of content adaptations involving search and replace, and then storing the resource back to the DB.

  14. Adapting content in bulk

    Recipe on adapting content in bulk, updating the title and excerpt for multiple posts with a single GraphQL request.

  15. Site migrations

    We can execute a batch of GraphQL queries to adapt the content in the site when migrating it to a new domain, moving pages to a different URL, or others.

  16. Inserting/Removing a (Gutenberg) block in bulk

    Recipe on updating posts by modifying their (Gutenberg) block's HTML content, useful for adding a block to all posts in the site before a campaign, and removing it right afterwards.

  17. Retrieving structured data from blocks

    Recipe on iterating the (Gutenberg) blocks in the post and extracting the attributes from deep within the block structure, as to unlock these attributes to be fed into any functionality in our site.

  18. Translating block content in a post to a different language

    Recipe on translating a post to the desired language, with full support for (Gutenberg) blocks.

  19. Bulk translating block content in multiple posts to a different language

    Recipe for translating multiple posts at once (in bulk), while executing a single call to the Google Translate API containing all text to translate from all the posts.

  20. Modifying (and storing again) the image URLs from all Image blocks in a post

    Recipe on iterating the inner structure of (Gutenberg) blocks, extracting desired items, modifying them, and storing them again in the DB.

  21. Sending emails with pleasure

    Recipes demonstrating several capabilities by Gato GraphQL to send emails.

  22. Sending a daily summary of activity

    Integrating Gato GraphQL with WP-Cron, as to automate the execution GraphQL queries that perform admin tasks, with some time interval.

  23. Sending a notification when there is a new post

    Examples on automating tasks in the application, such as sending a notification email to the admin when there is a new post.

  24. Automatically adding a mandatory block

    Whenever a new post is created, we can use the automation features to validate and modify the content of the post. This recipe checks if a certain mandatory block is present in the post and, whenever missing, it adds it.

  25. Interacting with external services via webhooks

    Recipe on creating Persisted Queries that act as webhooks.

  26. Retrieving data from an external API

    Recipe on fetching data from an external API using the HTTP Client fields.

  27. Not leaking credentials when connecting to services

    Recipe on retrieving credentials from an environment value, as to avoid them getting printed in the response or logs, thus avoiding security risks.

  28. Combining user data from different sources

    Recipe on combining the data from two or more sources, and then executing some operation with the combined data.

  29. Handling errors when connecting to services

    How to skip executing the rest of the GraphQL query after an error occurs.

  30. Creating an API gateway

    Recipe on creating an API gateway that retrieves the latest artifacts from the GitHub Actions API, and extracts their URL to be downloaded, avoiding the need for the client to be signed in to GitHub.

  31. Translating content from URL

    Combining HTTP requests with calling the Google Translate API, we can translate the content from any URL.

  32. Transforming data from an external API

    Examples on adapting the response from an external API to anything we need it to be.

  33. Filtering data from an external API

    If the external API does not allow filtering by a certain property that we need, we can use Gato GraphQL to iterate over the entries in the API response, and remove those ones that do not satifsy our condition.

  34. Pinging external services

    Recipe on pinging external services about new resources added to our website, passing along data both stored in the website and/or provided via parameters or headers.

  35. Updating large sets of data

    How to update thousands of resources in a single action.

  36. Importing a post from another WordPress site

    Recipe on how we can keep WordPress sites in sync, by importing a post from some WordPress site into our local WordPress site.

  37. Distributing content from an upstream to multiple downstream sites

    Recipe on implementing a distributed server architecture using Gato GraphQL extensions on the upstream WordPress site only.

  38. Automatically sending newsletter subscribers from InstaWP to Mailchimp

    Using InstaWP + Gato GraphQL to forward webhook data into an API.