Skip to content

Multiple calls are done to fetch all entries of a certain content type #301

Description

I'm currently debugging a production issue, which may or may not be related to Contentful, but what I found interesting is that the client, in order to fetch all entries of a certain content type, does 3 calls under the hood.

This is the code:

            contentfulClient
                .fetch(CDAEntry::class.java)
                .withContentType("<content type>")
                .all()

This is the log:

2024-03-22 17:15:56.014 INFO  [http-nio-8080-exec-1] INFO  d.d.a.c.c.configuration.OkHttpLogger     R: 5cfe86ba-8639-4d72-ab59-6d2078cb0239 U:   : --> GET https://preview.contentful.com/spaces/<space>/environments/master/locales

2024-03-22 17:15:56.398 INFO  [http-nio-8080-exec-1] INFO  d.d.a.c.c.configuration.OkHttpLogger     R: 5cfe86ba-8639-4d72-ab59-6d2078cb0239 U:   : --> GET https://preview.contentful.com/spaces/<space>/environments/master/content_types

2024-03-22 17:15:56.610 INFO  [http-nio-8080-exec-1] INFO  d.d.a.c.c.configuration.OkHttpLogger     R: 5cfe86ba-8639-4d72-ab59-6d2078cb0239 U:   : --> GET https://preview.contentful.com/spaces/<space>/environments/master/entries?content_type=<content type>

Subsequent calls seem to call only the /entries endpoint, but still I have the question:

Is it possible to configure the client to always just do the last call? Is there any downsides to that?

If I didn't misunderstand anything, it should be possible according to the API documentation.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions