if you run your query in the gql playground what does it return?
@noheadphones
what do you get if you print out "post" to console here?
Maybe that specific article just has no media added?
^ yeah this could be it
one thing to watch out for is if you have the publishing workflow enabled on your media, it'll need to be published as well
i don't added publishing workflow, i think image is already published and accesible : /media/1BF24258-5C5C-4747-88CA-8150BED05C38.jpg
can you verify that
for the exact same postthe
media
is present in the playground but not in your react data?
yeah w8
and the same post in react, if you console log them
does it have
media
?
because the query that runs in your playground is exactly the same that runs locally, so the retrieved data shouldnt be different
@noheadphones
http://up44.ir/previews/0e04664753189600951bc72042eab7a1.png
it returns null
@Alessio š£
Is your access control opened up on your media collection?
no, but added
http://up44.ir/previews/fe92d7ac7192aeaa129986f33c1b175d.png
http://up44.ir/previews/d2bf14774f571c484cea60f9331a8d63.png
http://up44.ir/previews/3f1c92f3a5a19b6ae8b4d9aa1c44236b.png
still won't show the imageURL and alt
http://up44.ir/previews/5ac11d911e920389bd84bcd1e66caf10.png
http://up44.ir/previews/bf0984bae147c8da3e4a4d20d343eadd.png
same error for src
fixed !
Nice! what was it?
wrong queries
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.