쿼리 라이브러리Bricks 페이지에서 모든 이미지 URL 추출하기
Bricks 페이지에서 모든 이미지 URL 추출하기
이 쿼리는 Bricks 페이지에 포함된 모든 image 요소에서 이미지 URL을 추출합니다.
이 쿼리를 사용하려면 Bricks 확장 기능이 활성화되어 있어야 합니다.
이 쿼리에는 다음 변수가 필요합니다.
$customPostId: 분석할 Bricks 커스텀 포스트의 ID
query GetBricksImageURLs($customPostId: ID!) {
customPost(by:{ id: $customPostId }, status: any) {
id
title
bricksData(filterBy: { include: ["image"] })
@underEachArrayItem(
passValueOnwardsAs: "elementJSON"
affectDirectivesUnderPos: [1, 2]
)
@applyField(
name: "_objectProperty",
arguments: {
object: $elementJSON,
by: { path: "settings.image.url" }
},
passOnwardsAs: "imageURL"
)
@applyField(
name: "_echo",
arguments: {
value: $imageURL
}
setResultInResponse: true
)
}
}