gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

How to fetch custom API

Open tansongchen opened this issue 1 year ago • 3 comments

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?

tansongchen avatar Jul 24 '22 18:07 tansongchen

Same problem here 👋

rroslaniec avatar Aug 01 '22 09:08 rroslaniec

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.

raae avatar Aug 01 '22 10:08 raae

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

rroslaniec avatar Aug 01 '22 14:08 rroslaniec

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!

moonmeister avatar Dec 27 '22 18:12 moonmeister