Contentful logo

Contentful Community

Exporting all content types despite of setting queryEntries object

Hello, Im consused,
Im setting queryEntries at the moment of use the “contentfulExport” (the one from contentful-export)

const options = {
            spaceId: args.spaceId,
            managementToken: TOKEN,
            env: args.env,
            queryEntries: ['content_type=myContentType']
}
contentfulExport(options);

However, is exporting all content types, all content, webhooks, etc. I thought if I set the queryEntries that was going to export only the content-type that I wanted. Any thoughts ?

Notes : myContentType is the id of the content type that I can notice in the web app of contentful, meaning URL
Nodejs version used: 14.16.1
export version “^7.12.26” >> GitHub - contentful/contentful-export: This tool allows you to export a Contentful space to a JSON dump

Hi @felipe.cardozo ,

The exported JSON contains different sections to ensure the ‘stability’ of an environment if re-imported in another environment/space. The section content-types as well as webhooks, tags, etc. are exported completely. The filtering on queryEntries affects only the entries that are exported (in your case of ‘myContentType’).

Thanks for letting us know this behaviour, I will address your feedback to our team, to try to improve our export/import tooling :smiley:

Hi @Alma thanks for answering. make sense the thing of ensure stability. Understood the filtering purpose. thanks !

So to be clear, even though he has the option queryEntries: ['content_type=myContentType'] this would only apply if he was also fetching entries is that right?

Is it not possible to export just a single Model definition? Not its instances, just one Model.

I’ve tried various options inside queryEntries but always get down All contentTypes instead of just the one I’m referencing.

Hi @joe.santiago

You are correct, the queryEntries filter is only for the entries, and the export tool will automatically export all the Content-types, regardless.