Open ericdrosas87 opened 1 week ago
Example of sort by descending:
query MyQuery {
entries {
... on galleryItems_galleryItem_Entry {
id
title
albumAsGallery(sortByDesc: "default.DateCreated") {
id
approvalStatus
owner
size
smartTags
url {
HighJPG
}
additional {
AltTextEN
AltTextES
CaptionEN
CaptionES
Credit
Description
}
default {
DateCreated
Author
Copyright
}
}
}
}
}
Example of sorting and filtering:
query MyQuery {
entries {
... on galleryItems_galleryItem_Entry {
id
title
albumAsGallery(sortByDesc: "default.DateCreated",
whereIn: {key: "tag", values: ["Cat", "cybercat"]}
) {
id
approvalStatus
owner
size
smartTags
url {
HighJPG
}
additional {
AltTextEN
AltTextES
CaptionEN
CaptionES
Credit
Description
}
default {
DateCreated
Author
Copyright
}
tag
}
}
}
}
Filtering is case-insensitive:
query MyQuery {
entries {
... on galleryItems_galleryItem_Entry {
id
title
albumAsGallery(
sortByDesc: "default.DateCreated"
whereIn: {key: "tag", values: ["cAt", "CYBERCAT"]}
) {
id
approvalStatus
owner
size
smartTags
url {
HighJPG
}
tag
}
}
}
}
User story
As a developer planning implementation of the gallery pages on the client, I need to first document the graphQL queries necessary to retrieve album data from Craft with filter and sort examples to streamline frontend development.
Definition of done
I've documented the graphQL queries as they align with the graphQL use cases.