We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b340cf9 + 416b3d6 commit 4275409Copy full SHA for 4275409
handler/graphql.mjs
@@ -10,5 +10,12 @@
10
import { createHandler } from 'graphql-http/lib/use/@netlify/functions';
11
import schema from '../lib/schema';
12
13
+const graphqlHandler = createHandler({ schema: schema.default })
14
+
15
// Create the GraphQL over HTTP native fetch handler
-export const handler = createHandler({ schema: schema.default });
16
+export const handler = async (req, ctx) => {
17
+ if (req.httpMethod === 'OPTIONS') {
18
+ return { statusCode: 200 }
19
+ }
20
+ return graphqlHandler(req, ctx)
21
+};
netlify.toml
@@ -6,3 +6,4 @@
6
for = "/graphql*"
7
[headers.values]
8
Access-Control-Allow-Origin = "*"
9
+ Access-Control-Allow-Headers = "*"
0 commit comments