Created
July 6, 2023 14:36
-
-
Save Vetrivel-VP/d306f6886265106ad11c2d4cb925cf51 to your computer and use it in GitHub Desktop.
Graph QL - Sanity Schema Data Fetch Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const fetchQuery = `*[_type == 'products'] | order(_createdAt desc){ | |
_id, | |
title, | |
productType, | |
mainImage { | |
asset -> { | |
url | |
} | |
}, | |
bgImage { | |
asset -> { | |
url | |
} | |
}, | |
shortDescription, | |
description, | |
price, | |
categories[] -> { | |
_id, | |
title, | |
mainImage { | |
asset -> { | |
url | |
} | |
}, | |
} | |
}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment