Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement resolution to itemsFeedAll method #275

Closed
Simply007 opened this issue Jan 10, 2020 · 1 comment
Closed

Implement resolution to itemsFeedAll method #275

Simply007 opened this issue Jan 10, 2020 · 1 comment
Assignees

Comments

@Simply007
Copy link
Contributor

Motivation

Related to kontent-ai/gatsby-packages#97

From the 1st of February the /items endpoint is limited to 1000 (incl. linked items) as described in Kontent API changes.
After that date, queries resulting in more than 1K content items per language won't load more than that 1K items.

By using alternative endpoint items-feed respectively itemsFeedAll from JS SDK users would lose the ability to relive URLs as well as linked items + components (as described in the issue linked abouve).

Proposed solution

Implement resolution the same way as using the items method.

Additional context

Including the content.item value in URLSlug resolver:

module.exports = class Page extends ContentItem {
  constructor() {
    super({
      urlSlugResolver: (link, context) => {
        const entry = context.item // THIS ONE
        const [parentElement] = entry ? entry.parent_element.value : []

        return {
          url: `${parentElement ? `/${parentElement.url_slug.value}` : ``}/${
            entry.url_slug.value
          }`,
        }
      },
    })
  }
}
@Enngage
Copy link
Member

Enngage commented Jan 21, 2020

fixed by 6e30485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants