i am in a phase of converting from another headless cms.to payloadjs.
i would need to convert the below to payloadjs, but i could find how to do fragments nor a way to define the SearchInput type.
can you please give me some directions on how to start implementing this on payloadjs:
export const searchResultFragment = `
fragment SearchResult on SearchResult {
productId
productName
description
slug
sku
currencyCode
productAsset {
id
preview
}
priceWithTax {
... on SinglePrice {
value
}
... on PriceRange {
min
max
}
}
}
`
export const searchQuery = `
query search($input: SearchInput!) {
search(input: $input) {
docs {
...SearchResult
}
totalDocs
}
}
${searchResultFragment}
`