Skip to content
Snippets Groups Projects
Commit 5a98e94d authored by Marco Wettstein's avatar Marco Wettstein
Browse files

fix: stuff

parent 2e21f6a2
No related branches found
No related tags found
No related merge requests found
import { makeSchema, queryType } from "nexus";
import { nexusPrisma } from "nexus-plugin-prisma";
import prismaClient from "../../prisma/prismaClient";
import * as userTypes from "./types/User";
import { join } from "path";
export const schema = makeSchema({
......
import { ApolloServer } from "apollo-server-micro";
import { context } from "./context";
import { schema } from "./schema";
const {
ApolloServerPluginLandingPageGraphQLPlayground,
} = require("apollo-server-core");
export const server = new ApolloServer({
schema,
context,
plugins: [ApolloServerPluginLandingPageGraphQLPlayground()],
});
......@@ -5,16 +5,12 @@ const allowCors = (fn: any) => async (req: any, res: any) => {
"Access-Control-Allow-Origin",
"https://studio.apollographql.com"
);
// another common pattern
// res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
res.setHeader(
"Access-Control-Allow-Methods",
"GET,OPTIONS,PATCH,DELETE,POST,PUT"
);
res.setHeader(
"Access-Control-Allow-Headers",
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version"
);
res.setHeader("Access-Control-Allow-Headers", "*");
if (req.method === "OPTIONS") {
res.status(200).end();
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment