contentful / contentful-management.js

JavaScript library for Contentful's Management API (node & browser)
https://contentful.github.io/contentful-management.js
MIT License
264 stars 97 forks source link

plain client 'getMany' and 'getPublished' return unexpected results #2281

Open athomas-octoberthree opened 2 months ago

athomas-octoberthree commented 2 months ago

Problem Description

The getPublished function returns more entities than the getMany function, when specifying the same content type in both functions.

Both functions should return the same number of entities.

System Details

contentful-management 11.25.4

Example code demonstrating issue

// ...
const entries1 = await client.entry.getMany({
    spaceId      : mySpaceId,
    environmentId: myEnvironmentId,
    query: {
        content_type: myContentType,
    }
})

const entries2 = await client.entry.getPublished({
    spaceId      : mySpaceId,
    environmentId: myEnvironmentId,
    contentTypeId: myContentType
})

// length of entries1 != entries2, but should be