Finally, I also have to fetch images/videos/audio files I have in this topics (and in the “coverImage” field):
LinkToImage: Imgur: The magic of the Internet
Is there a way to fetch this information in just one API call (the current flow takes ~6-7 seconds to fetch all the data), or if not, what are the alternatives I could/should use (e.g. Axios library and construct my own GraphQL calls)?
So, this doesn’t work because the topicList array is an array for Refrences to other records, so the only way to get that entire record, is to loop through the array with a request per record ID.
A better way to design this instead, would be to make so that the topicList, is not a Multiple Links field, but a Modular Field (Or a Structured Text Field) instead. And make the topics, instead of new records as they currently are, new blocks, that can be referenced in the Modular Field.
This way the editing for your articles will become much more simple and streamlined, and you also get the added benefits of having less records, and you will be able to use the nested: 'true' approach i mentioned to get the entire information about the record.
First off - thanks for the suggestion. We improved our structure and now indeed I can fetch nested objects, however, I have another question in order to improve the general performance.
Is it possible to fetch uploaded files URLs as part of the items.all query?
For this, i think using the CDA would be better.
Would doing a graphQL query inside NodeJS be possible for your use case?
This way you could get all records with all the parameters you would like.
Otherwise the only other way would be to access the URLS is through client.uploads