I have a media relationship field that populates in a block, but then a "service" relation that does not.
[
{
service: '67d37caea183b42b8ba4908c',
image: {
id: '67d1bda33ad7c5cef0ae4380',
alt: 'A room in a house that needs the Junk Removal service that Big Trash Panda offers.',
flipX: false,
enableCoolStuff: false,
filename: 'high-angle-house-interior-with-clutter.jpg',
mimeType: 'image/jpeg',
filesize: 404916,
width: 2000,
height: 1333,
focalX: 50,
focalY: 50,
sizes: [Object],
createdAt: '2025-03-12T17:00:19.344Z',
updatedAt: '2025-03-12T17:00:19.344Z',
url: '/api/media/file/high-angle-house-interior-with-clutter.jpg',
thumbnailURL: '/api/media/file/high-angle-house-interior-with-clutter-400x267.jpg'
},
colSpan: '2',
rowSpan: '2',
id: '67d380015bc5db28f21d941d'
},
{
service: '67d37e6da183b42b8ba491dc',
image: {
id: '67d1bdbf3ad7c5cef0ae43a2',
alt: 'A lot of miscellanies junk and debris clutters a property.',
flipX: false,
enableCoolStuff: false,
filename: 'old-rusty-junk-garbage-steel-rubber.jpg',
mimeType: 'image/jpeg',
filesize: 624200,
width: 2000,
height: 1333,
focalX: 50,
focalY: 50,
sizes: [Object],
createdAt: '2025-03-12T17:00:47.143Z',
updatedAt: '2025-03-12T17:00:47.143Z',
url: '/api/media/file/old-rusty-junk-garbage-steel-rubber.jpg',
thumbnailURL: '/api/media/file/old-rusty-junk-garbage-steel-rubber-400x267.jpg'
},
colSpan: '1',
rowSpan: '1',
id: '67d3801c5bc5db28f21d941f'
}
]service: '67d37caea183b42b8ba4908c',
image: {...
The image data comes through but not the service
Different access on the collection with the service ?
Yep.
I had not enabled read access.
So if you have a relationship to, be sure to config read access
access: {
read: () => true,
},Or authenticate. The default access is that you need to be authenticated. With the above change you make the data public readable for anyone. Which may be fine, just be aware.
^ Totally get that. I actually have failed to understand implementing even the basic API key auth or the user login.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.