Queries Library

Explore the collection of 52 GraphQL queries (and counting) to deal with common admin tasks, content workflows and automation.

🔥 Subscribe to our newsletter to be notified when a new query is published.

Queries Library

  1. Add a mandatory comments block to a post

    If missing, add the comments block at the bottom of the post

  2. Add missing links in post

    Search for URLs which have no link in the post's HTML content and add a link around them

  3. Augment data from an external API

    Adapt the response from an external API to anything you need it to be

  4. Correlate user data from WordPress and Mailchimp

    Augment the user data in your WordPress site, by appending extra fields from an external source such as Mailchimp

  5. Extract all links added in the HTML source for all posts

  6. Display different content to different users

    Retrieve a different GraphQL response depending on the role of the logged-in user

  7. Display the URLs from all image blocks in a post

    Extract the URL property for all core/image blocks in a post (including inner blocks)

  8. Display the number of comments for different periods of time

    Analyze the trend of users adding comments to your site, based on several periods of time

  9. Display which posts have a thumbnail, and which have not

    Identify posts that need to add/replace/remove their thumbnail

  10. Distribute content from an upstream to multiple downstream WordPress sites

    Implement a distributed server architecture using Gato GraphQL extensions on the upstream WordPress site only

  11. Duplicate a post

    Create a duplicate of the indicated post

  12. Duplicate multiple posts

    Create duplicates for all the indicated posts

  13. Export post to WordPress site

    Fetch the data for a post from this WordPress site, and replicate it in some downstream WordPress site

  14. Fetch US weather forecast data for a location

    Connect to the US National Weather Service's API to fetch weather forecast data

  15. Fetch US weather forecast data for multiple locations

    Connect to the US National Weather Service's API to fetch weather forecast data

  16. Fetch repositories from GitHub

    Connect to GitHub's API to fetch repository data for some account

  17. Fetch user data from Mailchimp list

    Connect to Mailchimp's API to fetch user data from a list

  18. Fetch users by locale

    Retrieve all users with a certain locale, providing a regex to identify them

  19. Filter data from an external API

    If the API does not allow filtering results that satisfy some condition (such as having a field with a non-empty value), we can implement an API gateway that removes those entries that do not satifsy our condition

  20. Using generative AI to produce images for posts without a featured image, and compress it for the web

  21. Using generative AI to produce images for posts without a featured image, and compress it for the web

  22. Import post from WordPress RSS feed

    Create a new post using the data from some WordPress RSS feed

  23. Import post from another WordPress site

    Create a new post using the data exposed by the GraphQL API on some other WordPress site

  24. Import posts from CSV

    Create a new post using the data from some CSV source

  25. Insert a block in all posts

    Identify the nth block of a given type in all posts, and place a custom block right after it

  26. Regex search and replace multiple strings in a post

    Search and replace multiple strings in the post's title, excerpt and content

  27. Regex search and replace multiple strings in all posts

    Search and replace multiple strings in the posts' title, excerpt and content

  28. Register a newsletter subscriber from InstaWP to Mailchimp

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

  29. Remove a block from posts

    Remove a block of a given type from all posts

  30. Replace "http" with "https" in all image sources in a post

    Switch to incorporating SSL when loading images in your site

  31. Replace an old post slug with a new post slug in all posts

    Convert all content to point to the new URL for some post

  32. Replace the domain for all image blocks in a post (to use a CDN)

    Update image URLs to route them via a CDN

  33. Replace the old domain with a new domain in all posts

    Convert all content to point to the new URL for the site

  34. Retrieve the latest artifact download URLs from GitHub

    Access the latest version of your plugin on your GitHub repo (eg: to install it in your WordPress site using WP-CLI)

  35. Retrieve the latest artifact download URLs from GitHub, passing the access token via a header

    Access the latest version of your plugin on your GitHub repo, while passing the access token via a header (eg: for an API gateway)

  36. Retrieve user data stored in a different WordPress site

    Fetch data corresponding to your users, stored in another WordPress site

  37. Search and replace multiple strings in a post

    Search and replace multiple strings in the post's title, excerpt and content

  38. Search and replace multiple strings in all posts

    Search and replace multiple strings in the posts' title, excerpt and content

  39. Send a farewell email to users who unsubscribe from ConvertKit (via a webhook)

    Receive, process, and execute an action using data submitted by ConvertKit (or any other service)

  40. Send a personalized email to your users

    Iterate over the users on your site, and send a customized email to each of them

  41. Send an email

    Using text and HTML content

  42. Send an email to the admin

    Fetching the admin email from the DB

  43. Send an email to the admin notifying of a new post

    Integrate this query with automation to notify the admin when there's a new post on the site

  44. Send an email using Markdown

    Converting Markdown into HTML content

  45. Send an email with dynamic data

    Fetch data from the DB and dynamically insert it into the email message

  46. Send an email with summary of activity

    Integrate this query with automation to receive updates on your email account

  47. Subscribe an email on a Mailchimp list

    Connect to Mailchimp's API to register an email in a list

  48. Translate a post from the "Classic editor"

    Query to translate a "Classic editor" post to the desired language

  49. Translate a post from the WordPress editor (Gutenberg)

    Query to translate a "Gutenberg" post to the desired language

  50. Translate content from URL

    Fetch the content from any URL, and translate it with Google Translate

  51. Translate posts (in bulk) from the "Classic editor"

    Query to translate multiple "Classic editor" posts to the desired language, executing a single call to the Google Translate API

  52. Translate posts (in bulk) from the WordPress editor (Gutenberg)

    Query to translate multiple "Gutenberg" posts to the desired language, executing a single call to the Google Translate API