gatsby-uc / gatsby-source-strapi

Gatsby source plugin for building websites using Strapi as a data source
MIT License
354 stars 182 forks source link

How to fetch custom API #339

Closed tansongchen closed 1 year ago

tansongchen commented 2 years ago

I am trying to use a Strapi plugin Navigation which provides API like this:

GET https://<host>/api/navigation/render/1

which did not happen to be the standard collection / single type API routes. How may I use this in Gatsby?

rroslaniec commented 2 years ago

Same problem here 👋

raae commented 2 years ago

I am no Strapi expert, but you can always source content from an API endpoint yourself using the sourceNodes lifecycle hook. You might get an idea on how to do so from my post showing two ways of paginate through API results when sourcing data In Gatsby.

rroslaniec commented 2 years ago

yea, @raae you're right. But in the previous version that was possible :( Now I need to have time to refactor it...

moonmeister commented 1 year ago

Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or join us on Discord if you have questions!