Skip to content

Instantly share code, notes, and snippets.

View govorov's full-sized avatar

Stanislav E. Govorov govorov

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