Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why Strapi dont fetch relationship in retrived data?

I created an API using strapi, and everything work fine until now. A have an "Event" and a "Stand" collection, I set up things in order to have multiple stands in event.

enter image description here

enter image description here

I use Insomnia to try the API and fetch the data, and when I fetch the events, I dont have any clue of the relations.

enter image description here

Everywhere people say relations should appears here, so, if you have any ideas, thank you.

like image 997
Unknow Avatar asked Dec 10 '25 20:12

Unknow


1 Answers

Strapi won't retrieve by default the relations. You must specify in your API call that you want to retrieve everything including the relationships.

For that, at the end of your GET request add : ?populate=*

request: http://localhost:1337/api/events?populate=*

You have more options here is you want to see deeper or not :

https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest/populating-fields.html#relation-media-fields

like image 174
Paul Corbeau Avatar answered Dec 13 '25 10:12

Paul Corbeau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!