// enum
enum Role {
ADMIN,
READ_ONLY,
AUTHOR
}
// object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from "apollo-client"; | |
import { createHttpLink } from "apollo-link-http"; | |
import { setContext } from "apollo-link-context"; | |
import { InMemoryCache } from "apollo-cache-inmemory"; | |
import { WebSocketLink } from "apollo-link-ws"; | |
import { split } from "apollo-link"; | |
import { getMainDefinition } from "apollo-utilities"; | |
function createApolloClient(idToken: string | undefined) { | |
const cache = new InMemoryCache(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { json } = require("micro"); | |
const axios = require("axios"); | |
module.exports = async (req, res) => { | |
if (req.method !== "POST") { | |
res.end("404 - not found"); | |
} | |
const content = await json(req); |