Open konsumer opened 4 years ago
I ended up just making my own graphql server:
import { makeExecutableSchema } from 'graphql-tools'
// const typeDefs = ...
// const resolvers = ...
// const playground = `STRING OF PLAYGROUND MINIMAL HTML`
const schema = makeExecutableSchema({ typeDefs, resolvers})
export default async function handle (req, res) {
if (req.method === 'GET') {
return res.send(playground)
}
const { query, variables, operationName } = req.body
const root = {}
const context = { cookies: req.cookies, body: req.body, query: req.query }
const out = await graphql(schema, query, root, context, variables, operationName)
res.json(out)
}
I dunno if this is a problem elsewhere, but if I run dev-server, I can GET the playground, but all POSTs just stay "Pending".
/api/basic and /api/micro work fine, though.