Since prismic has no concept of required fields, we might end up with null instead of data.
I am looking for a way to pull prismic data in gatsby app, filtering out unwanted entities.
the SQL idea
SELECT *
FROM allPrismicAnnouncement
WHERE quote IS NOT NULL;
actual gql i use
export const query = graphql`
query AnnouncementCardQuery {
allPrismicAnnouncement(sort: {order: DESC, fields: data___date}) {
edges {
node {
uid
id
data {
quote {
text
}
subtitle1 {
text
}
}
}
}
}
}
`
how to use filter, include or similar approach to filter out filtering out articles with no quote. Option 2 - ignore all quotes with length < 100 chars