## Fetch the whole collections
const payload = await getPayloadClient();
// Works Perfectly ✅
const projects = await payload.find({
collection: "projects",
});
## Fetch Single project
const payload = await getPayloadClient();
// Doesn't Work ❌
const projects = await payload.find({
collection: "projects",
where: {
slug: {
equals: "adidas",
},
},
});
const project = projects.docs[0]; // undefined, should be { slug: 'adidas', ... }
## Terminal Errors
I'm taking the it's not working because of the attached errors?
Hi @TheBilTheory - your local API requests look correct, I just tested out the 'fetch single project' and it worked as expected.
I also think it is these errors causing the trouble here... Have you installed your dependencies? What version of Payload are you on?
I switched to NPM instead of PNPM and it seems to have solved the problem.
Interesting... glad it's working for you now anyhow 😆
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.