verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Error when querying asset in a block twice with an alias #43

Closed devinpitcher closed 3 years ago

devinpitcher commented 3 years ago

Description When attempting to query an asset field from inside a block, if you try to query it again with an alias, the following error is thrown:

Call to a member function andWhere() on null.

... on blogArticleContent_image_BlockType {
    blockTypeHandle
    image @transform(width: 700) {
        ... on assets_Asset {
            url
            srcset(sizes: ["1x", "2x"])
            width
            height
        }
    }
    imageWebp: image @transform(width: 700, format: "webp") {
        ... on assets_Asset {
            srcset(sizes: ["1x", "2x"])
        }
    }
}

Steps to reproduce

  1. Add an asset field to a block
  2. Attempt to query the image twice, once using an alias

Additional info

Additional context

engram-design commented 3 years ago

Fixed for the next release. To get the fix early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.2",
  "...": "..."
}

Then run composer update.

engram-design commented 3 years ago

Fixed in 1.0.3