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 { 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>; |
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 { 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'; |
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
{ | |
// 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", |