Questions tagged [contentful-api]
83 questions
0
votes
0 answers
How can I migrate from Forestry.io to Contentful CMS
I want to migrate from Forestry.io(https://forestry.io/) to Contentful CMS as Forestry.io will be discontinued in March.
I had used Forestry.io and Hugo as static site generator, but now I want to migrate my CMS to Contentful.
Please help me how…

Ankit Kumar
- 118
- 12
0
votes
1 answer
How to create short URL for Contentful assets
I want to create a short URL for assets on Contentful,
like example.com/image/Image1.
Currently the URL I am getting from Contentful is a very long URL like
images.ctfassets.xxxxxxxxxxxxxx85514b430c28045a3b2930ebeXXXXX/abc.jpg.
Is there some…

Ankit Kumar
- 118
- 12
0
votes
0 answers
Contentful CMS GraphQL Playground GraphQL Mutation Return undefined
I am learning GraphQL mutations in react and Contentful CMS. I am trying to add user data into User model. I am getting error below
"Cannot read properties of undefined ( reading 'name')"
In User Content Model, I am having two field firstname and…

Vishal Tanna
- 1,165
- 2
- 12
- 36
0
votes
1 answer
How to graphql after a certain date in contentful?
I'm using Contentful's GraphQL API. What I want to do is to query all the events that haven't past yet.
I tried using lt, but that doesn't seem to be working. I also found out that the date is a string, so what options do I…

testcoder101
- 23
- 5
0
votes
1 answer
How to make a conditional graphql request in NextJS getstaticprops?
I currently have a black friday page. Only when this black friday page is expired (must get the expired date from a query before) do i want it to query the expired page data.
Essentially i'm looking to make the query more efficient. Where the…

testcoder101
- 23
- 5
0
votes
0 answers
How to use document.ToReactComponents using GatsbyJS and Contentful
I'm trying to get my rich text field to show up as rich text using GatsbyJS with contentful.
Currently it displays as markdown code but not as rich text (screenshot attached).
I believe I need to use 'documentToReactComponents' to solve this but I…

Richy
- 3
- 3
0
votes
1 answer
Will separating graphql query decrease performance?
Is it ideal or bad practice to separate query?
For example, should I query page. Or split this master query and query customer and footer?
Is there a performance difference difference between hitting one vs muliple queries like this?
query page {
…

zippyford
- 11
0
votes
1 answer
Contentful NodeJs SDK, Client.getEntries | Load nested ContentType fields
I have the following structure
User {
image: Asset
...
}
Comment {
author: User
...
}
BlogArticle {
slug: Text
author: User
comments: Comment[]
}
When I pull entries with the following method
const articles = await…

Prémices K
- 65
- 2
- 6
0
votes
1 answer
Contentful | Get unpublished entry's unpublished parent with CDA / CPA through create webhook
I have a 2 Content Models, A & B.
Model A has a 1-many reference to B.
I create A and publish, if I go back in and create B on A, A becomes 'changed' ( draft/unpublished ) and the new B is also unpublished.
I have a webhook that fires off on a B…

ndyr
- 503
- 4
- 20
0
votes
1 answer
Invalid patch error in Contentful CMA client
I am trying to populating an empty field by using patch method in Contentful. The following piece of code works in one cloned environment but does not work in another.
let patchData: OpPatch[] = [
{
op: 'replace',
path:…

AMDN
- 23
- 5
0
votes
1 answer
Not able to iterate over object using map
I am trying to render a table using a data collection "Posts". I want to use the map method returns a new array by applying the callback function on each element of an array, while the forEach method doesn’t return anything. Could someone shed a…

Steve
- 51
- 1
- 7
0
votes
0 answers
Contentful GraphQL filter for filtering entries by linked references
I read this blog post which shows how to filter entries by linked references in contentful Graphql.
https://www.contentful.com/blog/2021/06/15/filter-entries-by-linked-references-in-graphql-api/
But i can't do as it says. Graphql playground only…

Ajmal
- 21
- 5
0
votes
1 answer
Retrieving Array from Contentful GraphQL query for page created by slug build error
I'm using React and Contentful to build an app, this uses GraphQL for data querying and I'm trying to retrieve an array on a 'post' style page created by the slug. I'm able to pull through static data but I need to be able to display content from a…

Sam St Aubyn
- 127
- 1
- 9
0
votes
1 answer
Filtering posts by category on Contentful with GraphQL
I am struggling to find a way to filter tags by category.
I have a category content model that consists of a slug and a title, both are short text fields. This content model is added to my blog posts as a reference object referencing many categories…

fourie_lean
- 47
- 7
0
votes
1 answer
How to update Contentful reference efficiently
I have a Content Model X with 200+ entries.
One of the fields inside my Content Model X is a reference field referencing the Content Model A.
However, I realized that this Content Model A is no longer suitable for my use case so I created another…

Code_Like_a_Newbie
- 138
- 2
- 7