- Mainly kontent-ai/gatsby-packages#106
- Might fix kontent-ai/gatsby-packages#107 as well
Queries with complicated filter:
query BeltIdentifierTypeQuery(
$url_slug: String!
$language: String!
) {
pitches: allKontentItemBeltPitch(
filter: {
usedByContentItems: {
elemMatch: {
system: { type: { eq: "belt_series" } }
elements: {
belt_type: {
linked_items: {
elemMatch: {
elements: { url_slug: { value: { eq: $url_slug } } }
}
}
}
}
}
}
}
...
Could be extracted to isUsedInBeltSeries
and beltTypeUrlSlug
fields precalculated in gatsby-node.js and then use in the filter:
query getPitchesInBeltSeriesByUrlSlug($url_slug: String!) {
allKontentItemBeltPitch(filter: {fields: {beltTypeUrlSlug: {eq: $url_slug}, isUsedInBeltSeries: {eq: true}}}) {
nodes {
internal {
type
}
system {
name
codename
}
...
}
}
}
i.e. with query variables:
{
"url_slug": "belt-type-1"
}
git clone --recurse-submodules github.com/Simply007/schema-definition-changes
# this automatically clones the plugin sub module to /plugins/@kentico/gatsby-source-kontent
cd schema-definition-changes
cd plugins/@kentico/gatsby-source-kontent
# (optional) checkout proper version
# git checkout tags/4.3.0
npm install
npm run build
cd ../../..
npm install
npm run develop
- Perform steps from How to run (except of the
gatsby develop
) - Register on Kentico Kontent
- Create an empty project
- Enable Content Management API
- Import content.zip data using Template manager
- Use
Project Id
andContent Management API key
from previously generated project.
- Use
- Place the
ProjectId
to the/gatsby-config.js
configuration file. - run
npm run develop