플러그인 데이터 쿼리
플러그인 데이터 쿼리Elementor

Elementor

가이드 Working with Elementor에서 자세한 내용을 확인하세요.

Elementor 플러그인의 데이터를 조작하는 쿼리 예시를 소개합니다.

Elementor 데이터 가져오기

이 쿼리는 게시물에서 Elementor 데이터를 가져옵니다(DB에 _elementor_data라는 메타 항목으로 저장되어 있으며, DB에 저장된 데이터 구조를 그대로 유지합니다):

{
  post(by: { id: 1 }) {
    elementorData
  }
}

이 쿼리는 게시물에서 Elementor 데이터를 가져와 단일 수준으로 평탄화합니다:

{
  post(by: { id: 1 }) {
    elementorFlattenedDataItems
  }
}

Elementor 데이터 업데이트

이 mutation은 Elementor 데이터 내의 특정 요소를 병합합니다:

mutation {
  elementorMergeCustomPostElementDataItem(input: {
    customPostID: 1
    elements: [
      {
        id: "164e55c4",
        settings: {
          title: "Updated title"
        }
      }
    ]
  }) {
    status
    errors {
      __typename
      ...on ErrorPayload {
        message
      }
    }
    customPost {
      __typename
      ...on CustomPost {
        id
        elementorData
      }
    }
  }
}