How To Get CMS Block Data Using GraphQL in Magento 2.x

The following below Magento 2.x GraphQL Query

Syntax

To Get One CMS Block

cmsBlocks(identifiers: String): CmsBlocks

To Get One Multiple CMS Block

cmsBlocks(identifiers: [String,String]): CmsBlocks

[1] To Get Home Page Block Data

{
  cmsBlocks(identifiers: "home-page-block") {
    items {
      identifier
      title
      content
    }
  }
}

[2] To Get Contact Us Block Data

{
  cmsBlocks(identifiers: "contact-us-info") {
    items {
      identifier
      title
      content
    }
  }
}

[3] To Get Login Block Data

{
  cmsBlocks(identifiers: "login-data") {
    items {
      identifier
      title
      content
    }
  }
}

[4] To Get Gift Card Block Data

{
  cmsBlocks(identifiers: "giftcard-block") {
    items {
      identifier
      title
      content
    }
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *