I have a single type called Game that I am trying to access. When I try doing const game = await strapi.services['api::game.game'].find();
, it returns null.
This topic has been created from a Discord post (1237970765555564614) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
Is find
a custom method?
Assuming it’s not, I would try the following instead:
return await strapi.entityService.findOne('api::credential.credential', id);
By default it will populate all of the attributes. For further filtering see the official docs (CRUD operations | Strapi Documentation).
If it is a custom method, could you send it here (removing any sensitive information such as API keys)
Another thing to check would be validating the controller name. e.g. ‘api::games.games’ vs ‘api::game.game’. You can do this via yarn strapi controllers:list
, or npm etc.