I use graghql to query data from contentful, in gatsby-node.js
exports.createPages = async ({ graphql, actions }) => {
...
const result = await graphql(
`
{
allContentfulArticle(
sort: { order: DESC, fields: date },
limit: 2000
) {
totalCount,
edges {
node {
id
title
excerpt
date
tag
content{
content
}
}
}
}
}
`
)
})
The returned id in node does not match my contentful entry's id. For example, one return id is 32015820-f327-5085-b5c0-27146850a8f5
, but my entry's id is 2pljYDQAJ8umcV5po5TDK8
When I use contentful delivery api I can get the correct id, so, what happed? Who changes the id's format? How to get the correct id? The contentful plugin I use is gatsby-source-contentful.
id
you'd like to retrieve, at least in the query you're showing above. So perhaps looking at the schema to figure out how to retrieve a specific item would help. - goto1