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 {ApolloServer} from 'apollo-server-micro'; | |
import {NextApiRequest, NextApiResponse} from 'next'; | |
import {resolvers} from '@/graphql/resolvers'; | |
import typeDefs from '@/graphql/schema.graphql'; | |
const handler = async (req: NextApiRequest, res: NextApiResponse) => { | |
return new ApolloServer( | |
resolvers, |
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
name: CI | |
on: [push] | |
jobs: | |
schema: | |
name: Schema | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Inspect Schema |
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
type OperatorFn<T> = (value: T) => T; | |
interface PipeFn { | |
<T>(...fns: OperatorFn<T>[]): (value: T) => T; | |
} | |
const pipe: PipeFn = (...fns) => value => | |
fns.reduce((val, fn) => fn(val), value); | |
export default pipe; |
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 {Chart as ChartJsChart, ChartOptions} from 'chart.js'; | |
import {D3DragEvent, drag} from 'd3-drag'; | |
import {select} from 'd3-selection'; | |
type ChartElement = any; | |
type Chart = ChartJsChart & {options: ChartOptions & DraggableOptions}; | |
type DragEvent = D3DragEvent<ChartElement, number, number>; | |
enum DragEventType { | |
Start = 'start', |
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 { | |
format, | |
formatDistance, | |
formatDistanceStrict, | |
formatRelative, | |
} from 'date-fns'; | |
import {useRouter} from 'next/router'; | |
import {useEffect, useState} from 'react'; | |
const noop = () => {}; |
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 React from 'react'; | |
import {Button} from '@/design-system'; | |
import {useModal} from './modal'; | |
export default function ModalExample() { | |
const {Modal, closePortal, openPortal} = useModal(); | |
return ( | |
<> | |
<Button onClick={openPortal}>Open modal</Button> | |
<Modal> |
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 {isProduction} from '@/utils'; | |
import {Executor} from '@graphql-tools/delegate'; | |
import {makeExecutableSchema} from '@graphql-tools/schema'; | |
import {stitchSchemas} from '@graphql-tools/stitch'; | |
import {introspectSchema, wrapSchema} from '@graphql-tools/wrap'; | |
import {graphqlHTTP} from 'express-graphql'; | |
import {GraphQLSchema, print} from 'graphql'; | |
import fetch from 'isomorphic-unfetch'; | |
import {NextApiRequest, NextApiResponse} from 'next'; | |
import getConfig from 'next/config'; |
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
module.exports = { | |
extends: ['./node_modules/gts'], | |
overrides: [ | |
{ | |
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'], | |
files: ['*.ts', '*.tsx'], | |
rules: { | |
'@typescript-eslint/no-explicit-any': 'off', | |
'react-hooks/exhaustive-deps': 'warn', | |
'react-hooks/rules-of-hooks': 'error', |
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
// eslint-disable-next-line node/no-unpublished-import | |
import favicons from 'favicons'; | |
import fs from 'fs'; | |
const [, , source] = process.argv; | |
if (!source) { | |
throw new Error('You need to specify a `source`.'); | |
} |