Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Show only active CMS Blocks #176

Closed
artKozynets opened this issue Sep 9, 2018 · 3 comments
Closed

Show only active CMS Blocks #176

artKozynets opened this issue Sep 9, 2018 · 3 comments

Comments

@artKozynets
Copy link

artKozynets commented Sep 9, 2018

Preconditions

  1. Magento 2.3-develop + sample data (sample data not necessary)
  2. Php 7.1
  3. MariaDB 10.1.17

Steps to reproduce

  1. Checkout to branch 31-cms-page-graphql-support
    Pull request #31 CMS page/block coverage #105
  2. Disable some CMS block: MagentoAdmin > Content > Blocks > choose_your_block ->
    Enable Block: NO -> Save
  3. Run this GraphQL query:
{
  cmsBlocks (identifiers: ["disabled_cms_block", "enabled_cms_block"]){
    items{
      title
      identifier
      content
    }
  }
}

disabled_cms_block: identifier of the disabled cms_block
enabled_cms_block: identifier of the enabled cms_block

Expected result

  1. Get only cms_blocks with status: enabled.
{
  "data": {
    "cmsBlocks": {
      "items": [
        {
          "title": "Home banner 1"
        }
      ]
    }
  }
}

Actual result

{
  "errors": [
    {
      "message": "No such entity.",
      "category": "graphql-no-such-entity",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "cmsBlocks"
      ]
    }
  ],
  "data": {
    "cmsBlocks": null
  }
}

Visualization

error

Settings

settings

Test

With GraphQL query for one cms_block it works in a right way!

awesome

awesome2

@artKozynets
Copy link
Author

Same behaviour in branch 2.3-develop

@artKozynets
Copy link
Author

Same with NOT_EXISTING_ IDENTIFIRE

@naydav
Copy link
Contributor

naydav commented Nov 22, 2018

Result:

Request

{
  cmsBlocks (identifiers: ["disabled_block", "enabled_block"]){
    items{
      title
      identifier
      content
    }
  }
}

Response

{
  "errors": [
    {
      "message": "The CMS block with the \"disabled_block\" ID doesn't exist.",
      "category": "graphql-no-such-entity",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ],
      "path": [
        "cmsBlocks",
        "items",
        0
      ]
    }
  ],
  "data": {
    "cmsBlocks": {
      "items": [
        null,
        {
          "title": "enabled_block",
          "identifier": "enabled_block",
          "content": "<p>enabled_block enabled_block enabled_block</p>"
        }
      ]
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants