Questions tagged [contentful]

Contentful is a cloud based CMS framework using a RESTful JSON API.

Provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike many other content management systems, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management, and delivery APIs, and a customizable web app that enables developers and content creators to ship digital products faster.

859 questions
43
votes
8 answers

Environment variables not working (Next.JS 9.4.4)

So I'm using the Contentful API to get some content from my account and display it in my Next.Js app (I'm using Next 9.4.4). Very basic here. Now to protect my credentials, I'd like to use environment variables (I've never used it before and I'm new…
Perdixo
  • 1,021
  • 3
  • 15
  • 31
21
votes
2 answers

Use GraphQL to retrieve an object that contains an array of objects with different schemas

I am trying to write a query to retrieve an object with the property linkedCards that contains an array of objects with different schemas. I have 3 different schemas (built in Contentful): CardA example: { id: 42, productName: 'Laptop', …
Christoph Anderson
  • 617
  • 1
  • 6
  • 10
19
votes
2 answers

Contentful Javascript API - looking up an entry by slug

I see how to query an Entry by the ID. Is there a way to lookup by slug?
metahamza
  • 1,405
  • 10
  • 26
17
votes
1 answer

How to use GraphQL fragment on multiple types

I have a Gatsby project with very similar GraphQL queries for two different types of content: regular pages and wiki articles. Page by slug export const query = graphql` query($slug: String!) { page: contentfulPage(slug: {eq: $slug}) { …
Janosh
  • 3,392
  • 2
  • 27
  • 35
17
votes
1 answer

Gatsby.js: Filter GraphQL query by nested object property

I'm working on a news site which will have articles, each with one or multiple respective authors. If you click on an author's name, it will take you to a page displaying their information and a list of articles they have contributed to. So each…
dougmacklin
  • 2,560
  • 10
  • 42
  • 69
16
votes
5 answers

contentful api markdown conversion to HTML

Is there any simple way to convert markdown text from contentful api to render into html code to be display on html page. I have tried using pagedown and some similar techniques , but none seem to work for me .
Vineeta Mehta
  • 458
  • 1
  • 4
  • 10
12
votes
5 answers

Accessing your Contentful space failed with gatsby-source-contentful

gatsby: 2.20.8 gatsbh-source-contentful: 2.2.5 I've verified my spaceId and accessToken are correct, and I've verified that these keys have access to my Contentful development environment. I've tried: Enabling GATSBY_CONTENTFUL_OFFLINE Deleting…
Duderino9000
  • 2,535
  • 4
  • 31
  • 37
12
votes
2 answers

How do you handle an array of multiple types (ex: different content blocks) in GraphQL?

Let's say I have a page builder field that references many different types of content blocks. Video Quote Advertisement etc... From what I've read, having multiple types in an array is discouraged. But what else are you supposed to do in a case…
Andrew Folts
  • 489
  • 1
  • 5
  • 9
11
votes
3 answers

Getting Error "Elements in iteration expect to have 'v-bind:key' directives vue/require-v-for-key" in index.vue

I am new to vue.js. I have a simple index.vue which tries to connect to contentful and display the entries from contentful. My code in index.vue looks like this: