Asset Queries
Asset queries support getting single assets, single asset folders and asset listings.
Get Single Asset
Base structure for getting single asset:
{
getAsset(id: 4) {
...
}
}
See also following examples:
Get Single Asset Folder
Base structure for getting single asset folder (same as for assets):
{
getAssetFolder(id: 4) {
...
}
}
Get List of Assets
Base structure for getting a list of assets, restricted by IDs:
{
getAssetListing(ids: "4,5") {
edges {
...
See also following examples:
Pagination
Pagination can be applied as query parameters.
{
# 'first' is the limit
# 'after' the offset
getAssetListing(first: 3, after: 1) {
edges {
...
}
}
}
Simple Sorting
Sorting can be applied as query parameters, for example sort by filename, descending.
{
getManufacturerListing(sortBy: "filename", sortOrder: "DESC") {
edges {
node {
id
name
}
}
}
}
Filtering
You can use Pimcore's webservice filter logic as described here for filtering listing requests.
For details see filtering documentation page
Localization of Queries
Queries can be localized For details see the localization documentation page.
Thumbnails
You can request thumbnails for assets using a simple query like this:
Video assets thumbnails
You need to specify the name of the video thumbnail configuration you want to use.
Additionally, you can use the format
parameter to request a specific format.
query {
getAsset(id:353) {
id,
thumbnail:fullpath(thumbnail: "content"),
}
}
Image assets thumbnails
You need to specify the name of the video thumbnail configuration you want to use.
Use the format
parameter to request a specific format.
Specifying the deferred
parameter will defer the thumbnail generation until it gets requested for the first time.
query {
getAsset(id:289) {
id,
thumbnail:fullpath(thumbnail: "events_header", deferred:true)
}
}