pimcorepimcore-datahubgraphql-pimcore

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 :)

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.


Solution

  • 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