Multiple calls are done to fetch all entries of a certain content type
Opened this issue · 0 comments
renannprado commented
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.