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
// | |
// graphql/types/new-card-patch.ts | |
// | |
export const NewCardPatch = ` | |
input NewCardPatch { | |
# title is required | |
title : String! | |
description : String | |
done : Boolean |
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
// | |
// graphql/types/query.ts | |
// | |
export const Query = ` | |
type Query { | |
cards: [Card] | |
card(id: String!): Card | |
} |
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
// | |
// graphql/types.ts | |
// | |
import { Card } from 'graphql/types/card'; | |
export const types = [ | |
Card, |
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'; | |
import { GraphQLSchema } from 'graphql'; | |
import { Query } from 'graphql/types/query'; | |
import { types } from 'graphql/types'; | |
import { resolvers } from 'graphql/resolvers'; | |
const schemaDefinition = ` |
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 * as Router from 'koa-router'; | |
import * as koaBody from 'koa-bodyparser'; | |
import { | |
graphqlKoa, | |
graphiqlKoa, | |
} from 'apollo-server-koa'; | |
import { schema } from 'graphql/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
import * as Koa from 'koa'; | |
import { databaseInitializer } from 'initializers/database'; | |
import { routes } from 'routes'; | |
const bootstrap = async () => { | |
await databaseInitializer(); | |
const app = new Koa(); | |
app |
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
// | |
// entities/card.ts | |
// | |
import { | |
Entity, | |
PrimaryGeneratedColumn, | |
Column, | |
CreateDateColumn, | |
UpdateDateColumn, |
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 * as Koa from 'koa'; | |
import { databaseInitializer } from 'initializers/database'; | |
const bootstrap = async () => { | |
await databaseInitializer(); | |
const app = new Koa(); | |
app.use(async ctx => { | |
ctx.body = "It works!\n"; |
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 * as Koa from 'koa'; | |
const app = new Koa(); | |
app.use(async ctx => { | |
ctx.body = "It works!\n"; | |
}); | |
app.listen(3000); |
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
// | |
// graphql/types/card-patch.ts | |
// | |
export const CardPatch = ` | |
input CardPatch { | |
title : String | |
description : String | |
done : Boolean | |
} |
NewerOlder