Skip to content

Instantly share code, notes, and snippets.

View vacom's full-sized avatar
🌍
Space the final frontier

Vitor Amaral vacom

🌍
Space the final frontier
View GitHub Profile
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);
@vacom
vacom / Apollo.config.ts
Created May 2, 2020 17:29
Apollo config
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();
@vacom
vacom / ts.md
Created April 21, 2020 12:58 — forked from antoniojps/ts.md
Typescript cheatsheet

Core types

// enum
enum Role {
  ADMIN,
  READ_ONLY,
  AUTHOR
}

// object