从Pimcore的Data Hub API查询中获取图像缩略图的可能方式有哪些?

huangapple go评论94阅读模式
英文:

What are possible ways to fetch image thumbnails from Data hub API query in Pimcore?

问题

I'm trying to get the Pimcore Advanced Certificate.

I've done all chapters, except only one question, I'm trying 2 weeks and I'm confused 从Pimcore的Data Hub API查询中获取图像缩略图的可能方式有哪些?

The question is about to fetch the thumbs with GraphQI:
"What are possible ways to fetch image thumbnails from Data hub API query?"

The four multi-answers are:

  1. Using Transformers for image attribute in the schema definition.
  2. By providing thumbnail parameter on image attribute fullpath in the query.
  3. By using GraphQL inline fragment.
  4. By just requesting fullpath of image attribute.

The transformes I think is not mandatory, but is correct.
The third maybe is correct, because I need to write a queries as inline fragment.

After in video example if I write only fullpath I can't have thumb (i get only url, if there are correctly setted permissions on assets), so I've excluded it.

If I put as correct 2 and 3 are wrong... If I add the 1st as still wrong. The same thing if I add the 4th.

I'm confused..

I need to understand how are possible to fetch image thumbnails from Data Hub API query in Pimcore.

英文:

I'm trying to get the Pimcore Advanced Certificate.

I've done all chapters, except only one question, I'm trying 2 weeks and I'm confused 从Pimcore的Data Hub API查询中获取图像缩略图的可能方式有哪些?

The question is about to fetch the thumbs with GraphQI:
"What are possible ways to fetch image thumbnails from Data hub API query?"

The four multi-answers are:

  1. Using Transformers for image attribute in the schema definition.
  2. By providing thumbnail parameter on image attribute fullpath in the query.
  3. By using GraphQL inline fragment.
  4. By just requesting fullpath of image attribute.

The transformes I think is not mandatory, but is correct.
The third maybe is correct, because I need to write a queries as inline fragment.

After in video example if I write only fullpath I can't have thumb (i get only url, if there are correctly setted permissions on assets), so I've excluded it.

If I put as correct 2 and 3 are wrong... If I add the 1st as still wrong. The same thing if I add the 4th.

I'm confused..

I need to understand how are possible to fetch image thumbnails from Data Hub API query in Pimcore.

答案1

得分: 1

Correct answers are:

  • 使用转换器来处理架构定义中的图像属性。链接

  • 在查询中提供图像属性全路径上的缩略图参数。链接

示例:

{
  getAssetFolder(fullpath: "/Car Images/vw/") {
    children {
      ... on asset {
        thumbnail:fullpath(thumbnail: "my_thumbnail")
      }
    }
  } 
}

您还可以在作弊表中找到其他答案:

英文:

Correct answers are:

Sample:

{
  getAssetFolder(fullpath: "/Car Images/vw/") {
    children {
      ... on asset {
        thumbnail:fullpath(thumbnail: "my_thumbnail")
      }
    }
  } 
}

Another answers you can find in the cheat sheet:

Junior Pimcore Developer Certification

Senior Pimcore Developer Exam Answers

huangapple
  • 本文由 发表于 2023年4月4日 15:19:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75926524.html
  • graphql-pimcore
  • pimcore
  • pimcore-datahub
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定