Source DatoCMS Single Instance
See original GitHub issueDescription
Single-instance DatoCMS models appear in the playground, but return null
when queried. For instance:
datoCmsHome {
introText
}
returns
"datoCmsHome": null,
However querying -
allDatoCmsHome {
edges {
node {
id
introText
}
}
}
- will return
"allDatoCmsHome": {
"edges": [
{
"node": {
"id": "962827",
"introText": "I am a creative illustrator and graphic designer with more than 10 years of experience.\n\nOriginally from Toronto, currently based in London."
}
}
]
,
Steps to reproduce
https://github.com/thetre97/gridsome-starter-datocms
Simply create a single instance DatoCMS record, and query with the plugin.
Expected result
datoCmsHome { ...
should return the single instance data.
Actual result
"datoCmsHome": null
Environment
"dependencies": {
"@gridsome/source-datocms": "^0.1.0",
"gridsome": "^0.6.6"
},
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Content modelling - Single instance models - DatoCMS Docs
While collection models enable the creation of multiple records, single-instance models allow just a single item to be edited in the administrative area....
Read more >gatsby-source-datocms/README.md at master - GitHub
Official GatsbyJS source plugin to pull content from DatoCMS ... SEO meta tags; Tree-like collections; Single instance models; Localized fields.
Read more >gatsbyjs/gatsby-source-datocms
gatsby-source-datocms Source plugin for pulling models and records into Gatsby from ... Tree-like collections; Single instance models; Localized fields.
Read more >Gatsby JS v4 & DatoCMS Crash Course (2022) - YouTube
Gatsby v4 and DatoCMS tutorial headless CMS - quick and easy crash course to ... Subscribe if you want more free tutorials like...
Read more >Hooking up DatoCMS and Gatsby.js | Alvin Crespo
We'll use DatoCMS to manage our content and Gatsby to display it, ... TL;DR - It brings in the content from a model...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like it’s Gridsome side @matjack1.
I think @hjvedvik was saying it will be added to v0.8 if I read that right…
@matjack1 We can probably make Gridsome just return the first node in the collection if no id argument is provided 😃 I see that the DatoCMS GraphQL API is doing it.
And we have just implemented filters for single node fields. Expect it to be included in v0.8 😃