2

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
})
Michael Edwards
  • 6,308
  • 6
  • 44
  • 75

1 Answers1

1

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
})

Hosni Bona
  • 185
  • 2
  • 11