im trying to send a graphql query to appsync using amplify v6. Note i use next 14 app router (but just want to do client side calls). Here's how i configure:
Auth: {
region: 'us-east-1',
userPoolId: process.env.NEXT_PUBLIC_USER_POOL_ID,
userPoolWebClientId: process.env.NEXT_PUBLIC_USER_POOL_CLIENT_ID,
oauth: oauth
},
API: {
GraphQL: {
endpoint: "https://endpoint,
region: 'us-east-1',
defaultAuthMode: 'userPool',
},
},
};
export function configureAmplify(config: AmplifyConfig): void {
if (!isConfigured) {
Amplify.configure({...config, ssr: true});
Auth.configure({...config, ssr: true});
console.log("console.log: configured");
isConfigured = true;
}
}```
which I know works for auth because i can get the current session + access token, and can do calls to api gateway. In fact, when i do a graphql query, i can see the id and access token in the cookies:
```Cookie:
CognitoIdentityServiceProvider.5t4jgv...
LastAuthUser=f4b8c4e8...
CognitoIdentityServiceProvider.5t4jgv...
idToken=eyJraWQ....
accessToken=eyJraWQ....
But I get these errors if a query is ran:
WARN] 47:41.429 GraphQLAPI resolveConfig - The API configuration is missing. This is likely due to Amplify.configure() not being called prior to generateClient().```
```Unhandled Runtime Error
Error: No credentials
Source
utils/graphql/messages.ts (81:17) @ async sendMessage
79 | // Send Message
80 | export async function sendMessage(conversationId: string, content: string) {
> 81 | const result = await client.graphql({
| ^
82 | query: SEND_MESSAGE,
83 | variables: { input: { conversationId, content } }
84 | });```
i am 1000% sure it is configuring before calling generateClient. Im dying. Please help