Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Transforms seem to be unavailable #19

Closed
jesuismaxime opened this issue Oct 20, 2020 · 3 comments
Closed

GraphQL Transforms seem to be unavailable #19

jesuismaxime opened this issue Oct 20, 2020 · 3 comments
Labels

Comments

@jesuismaxime
Copy link

jesuismaxime commented Oct 20, 2020

Description

It may be more of a question, but image transforms dont seem to be accessible with the plugin (I try only with GraphQL, and yes my volume is available in my Public Schema).

Steps to reproduce

  1. I test this query:
{
  asset(id: 458) {
    uid
    ...on AssetInterface {
      title
      width
      height
      square: url @ transform (width: 300, height: 300)
    }
  }
}
  1. And got that result :
{
  "data": {
    "asset": {
      "uid": "24cfef8f-11f2-4013-9c2b-4073ab6f3d00",
      "title": "Test",
      "width": 498,
      "height": 306,
      "square": null
    }
  }
}

I tested the query with a local asset id (not handle by GCS) and it works well. Do I need to specify some permissions in GCS to make Craft able to create new sub-folders?

Edit/Update:

I try directly in my index twig template, and with that I was able to have some relevant logs (I add no error logs with the GraphQL query):

Google\Cloud\Core\Exception\BadRequestException: {
  "error": {
    "code": 400,
    "message": "Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access",
    "errors": [
      {
        "message": "Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

I switch back to 'Fine-grained'* and it works fine with Twig, but still have a null with GQL.

*It may be a nice detail to add to the plugin documentation!

Additional info

  • Craft version: 3.5.11.1
  • PHP version: 7.4.2
  • Database driver & version: MySQL 5.7.26
  • Plugins & versions: Google Cloud Storage 1.4.0
    --
@jesuismaxime
Copy link
Author

Had to explicitly specify the 'mode' within the query to get the url as wanted, example:

{
  asset(id: 458) {
    uid
    ...on AssetInterface {
      title
      width
      height
      square: url @ transform (mode: "crop", width: 300, height: 300)
    }
  }
}

Having a default/fallback mode value as the core Image Transforms component would be great!

@andris-sevcenko
Copy link
Contributor

@andris-sevcenko
Copy link
Contributor

Actually, image transforms do default to crop, so not sure what happened there. Is this on a public environment where it's possible to get access?

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

No branches or pull requests

2 participants