Contentful Unknown Content Type

Viewed 143

We are trying to query for content in Contentful CMS and we are receiving the following error:

errors: [ { name: 'unknownContentType', value: 'DOESNOTEXIST' } ]

This query had been previously work and the Content Type does exist in the backend.

Anyone experienced this problem before?

This is out query:

const result = await client
.getEntries({
  content_type: "page",
  "fields.path": context.params.slug,
})
.then((response) => {
  return response.items
})
1 Answers

I am trying to locate my solution in the docs but, JSON stringifying the query worked for me:

const query = JSON.stringify({
  content_type: "page",
  "fields.path": context.params.slug,
})

const result = await client
.getEntries(query)
.then((response) => {
  return response.items
})

Related