Hi everyone,
I'm working on an Electron project and I'm trying to integrate AWS Amplify for GraphQL operations. However, I'm encountering an issue when running the following function:
export async function getTodos() {
try {
const { data, errors } = await client.models.Todo.list();
console.log("List todo errors", errors);
console.log("List todo data", data);
return { data, errors };
} catch (error) {
console.log("Error listing todos", error);
return { error };
}
}
I keep getting the following error in the main process:
Client could not be generated. This is likely due to `Amplify.configure()` not being called prior to `generateClient()` or because the configuration passed to `Amplify.configure()` is missing GraphQL provider configuration.
Here are the steps I've taken so far:
- I've called
Amplify.configure()with the appropriate configuration in my project. - I've verified that the configuration includes the GraphQL provider details.
Despite these steps, the error persists. Has anyone faced a similar issue or could provide guidance on properly configuring and using AWS Amplify in an Electron project? Any help would be greatly appreciated!
Thanks in advance!