Skip to content

Instantly share code, notes, and snippets.

View ccpacillos's full-sized avatar
🎯
Focusing

Christopher Pacillos ccpacillos

🎯
Focusing
View GitHub Profile
import { Document, FilterQuery, Model } from 'mongoose';
import R from 'ramda';
export async function paginate<TDocument extends Document>(params: {
model: Model<TDocument>;
first?: number;
after?: Buffer;
last?: number;
before?: Buffer;
filter?: FilterQuery<TDocument>;
import { makeExecutableSchema } from '@graphql-tools/schema';
import { getDirectives, MapperKind, mapSchema } from '@graphql-tools/utils';
import cors from '@koa/cors';
import {
ApolloServerPluginLandingPageGraphQLPlayground,
gql,
} from 'apollo-server-core';
import { AuthenticationError } from 'apollo-server-errors';
import { ApolloServer } from 'apollo-server-koa';
import { GraphQLSchema, defaultFieldResolver } from 'graphql';
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",