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
FROM alpine | |
RUN apk add --update --no-cache nodejs | |
RUN npm i -g yarn | |
ADD package.json yarn.lock /tmp/ | |
ADD .yarn-cache.tgz / | |
RUN cd /tmp && yarn | |
RUN mkdir -p /service && cd /service && ln -s /tmp/node_modules |
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const path = require('path'); | |
const https = require('https'); | |
const yargs = require('yargs'); | |
const fetch = require('node-fetch'); | |
const { parse, execute, buildSchema } = require('graphql'); | |
const { makeExecutableSchema } = require('graphql-tools'); |
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
export async function runForAtLeast<T>(fn: (...args: any[]) => Promise<T>, ms?: number, ...args: any[]): Promise<T> { | |
const [res] = await Promise.allSettled([ | |
fn(...args), | |
new Promise(resolve => setTimeout(resolve, ms)), | |
]); | |
switch (res.status) { | |
case 'fulfilled': | |
return res.value; | |
case 'rejected': | |
throw res.reason; |