Q: Fetching content from an external API and creating custom posts with custom fields and taxonomies
Can your tool fetch data from an external, third-party API and then periodically create custom posts with custom fields and taxonomies (for example set up in ACF or Meta Box)? The values of custom fields and taxonomies should be mapped from the data provided by the API. It should run automatically in specified intervals.
If this is possible, which extensions would be needed and is there a chance for a tutorial?
Leonardo_GatoGraphQL
Mar 6, 2025A: I'm currently working on meta field mutations, it should be ready in.a few weeks. Other than that, yes that's all possible right now.
You'll need the extensions from tier 3/4.
On the Gato GraphQL website there are multiple demos/guides, combining them you can satisfy your use case:
- Running a query automatically at specified intervals: https://gatographql.com/demos/automatically-importing-new-posts-from-any-wordpress-rss-feed-daily
- Fetch data from external API using REST: https://gatographql.com/library/fetch-user-data-from-mailchimp-list
- Create a new post using external data: https://gatographql.com/library/import-post-from-wordpress-site
Thank you for your quick answer. How about mapping and assigning taxonomy terms based on API data? Will it be together with "meta field mutations" or is it already possible?
yes you can do that already, examples here:
https://gatographql.com/guides/query/custom-tags#creating-updating-and-deleting-a-custom-tag
https://gatographql.com/guides/query/custom-categories#creating-updating-and-deleting-a-custom-category
Btw, notice that there are no integrations with ACF/MetaBox currently, but still can mutate CPTs. Check:
https://gatographql.com/guides/query/custom-posts