Samar HayatOriginal post
Web Developer
Getting CORS error when making GraphQL queries using Appwrite's SDK in Next.js (client-side).
Login/signup works fine. Only GraphQL is failing on both localhost and Vercel.
✅ Tried:
Added localhost + Vercel URLs in Appwrite project settings
Used setDevKey() in client config
API key + permissions are set correctly
Regular Appwrite SDK calls work – only GraphQL fails
code snippet:
```const query = query { databasesListDocuments( databaseId: "${process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID}", collectionId: "6894bf11000015b5ba60" ) { title } };
const res = await graphql.query({ query });
❓Question:
Is Appwrite GraphQL not supported on client-side yet? Or is any extra CORS config needed?
Summary
Developers are experiencing CORS error when making GraphQL queries in Next.js using Appwrite's SDK. Login/signup are working but GraphQL is failing on both localhost and Vercel.
Solution:
Appwrite GraphQL is supported on the client-side. Additional CORS configuration might be needed. Ensure to check Appwrite's documentation for potential troubleshooting steps.