Skip to content
Permalink
Browse files

feat(config): allows all apollo config settings (#159)

  • Loading branch information...
goldcaddy77 committed Jul 3, 2019
1 parent 7de1144 commit 88314086a9b909c33ecff743ee5a2661bb9a3b05
@@ -1,5 +1,5 @@
/**/node_modules/**/*
/examples/**/coverage/**/*
/examples/**/node_modules/**/*
/examples/**/generated/**/*
/**/generated/**/*
!.eslintrc.js
@@ -20,3 +20,7 @@ dist

# Generated files
tmp

warthog.sqlite.tmp

examples/**/generated/*
@@ -1,11 +1,11 @@
// This file has been auto-generated by Warthog. Do not update directly as it
// will be re-written. If you need to change this file, update models or add
// new TypeGraphQL objects
import { GraphQLID as ID } from "graphql";
import {
ArgsType,
Field as TypeGraphQLField,
Float,
ID,
InputType as TypeGraphQLInputType,
Int
} from "type-graphql";
@@ -15,8 +15,10 @@ import { registerEnumType } from "type-graphql";
const { GraphQLJSONObject } = require("graphql-type-json");

import { BaseWhereInput, PaginationArgs } from "../../../src";
import { User } from "../src/user.model";
import { Post } from "../src/post.model";
// @ts-ignore
import { User } from "../src/modules/user/user.model";
// @ts-ignore
import { Post } from "../src/modules/post/post.model";

export enum UserOrderByEnum {
createdAt_ASC = "createdAt_ASC",
@@ -1,35 +1,3 @@
import { getBaseConfig } from '../../../src';

import {
getDatabaseName,
getDatabaseEntityPaths,
getDatabaseHost,
getDatabaseLoggingLevel,
getDatabaseMigrationPaths,
getDatabaseSubscriberPaths,
getDatabasePassword,
getDatabasePort,
shouldSchronizeDatabaseSchema,
getDatabaseType,
getDatabaseUsername,
SnakeNamingStrategy } from '../../../src';

module.exports = {
cli: {
entitiesDir: 'src/models',
migrationsDir: 'db/migrations',
subscribersDir: 'src/subscribers'
},
database: getDatabaseName(),
entities: getDatabaseEntityPaths(),
host: getDatabaseHost(),
logger: 'advanced-console',
logging: getDatabaseLoggingLevel(),
migrations: getDatabaseMigrationPaths(),
namingStrategy: new SnakeNamingStrategy(),
password: getDatabasePassword(),
port: getDatabasePort(),
subscribers: getDatabaseSubscriberPaths(),
synchronize: shouldSchronizeDatabaseSchema(),
type: getDatabaseType(),
username: getDatabaseUsername()
};
module.exports = getBaseConfig();
@@ -2,7 +2,7 @@ import 'reflect-metadata';

import { logger } from '../../../src';

import { loadConfig } from '../src/config';
import { loadConfig } from './config';
import { getServer } from './server';

async function bootstrap() {
@@ -1,6 +1,6 @@
import { BaseModel, ManyToOne, Model, StringField } from '../../../src';
import { BaseModel, ManyToOne, Model, StringField } from '../../../../../src';

import { User } from './user.model';
import { User } from '../user/user.model';

@Model()
export class Post extends BaseModel {
@@ -1,17 +1,17 @@
import { Arg, Args, Ctx, FieldResolver, Mutation, Query, Resolver, Root } from 'type-graphql';
import { Inject } from 'typedi';

import { BaseContext, Fields, StandardDeleteResponse, UserId } from '../../../src';
import { BaseContext, Fields, StandardDeleteResponse, UserId } from '../../../../../src';
import {
PostCreateInput,
PostCreateManyArgs,
PostUpdateArgs,
PostWhereArgs,
PostWhereInput,
PostWhereUniqueInput
} from '../generated';
} from '../../../generated';

import { User } from './user.model';
import { User } from '../user/user.model';

import { Post } from './post.model';
import { PostService } from './post.service';
@@ -2,8 +2,7 @@ import { Service } from 'typedi';
import { Repository } from 'typeorm';
import { InjectRepository } from 'typeorm-typedi-extensions';

import { BaseService } from '../../../src';

import { BaseService } from '../../../../../src';
import { Post } from './post.model';

@Service('PostService')
@@ -1,6 +1,6 @@
import { BaseModel, Model, OneToMany, StringField } from '../../../src';
import { BaseModel, Model, OneToMany, StringField } from '../../../../../src';

import { Post } from './post.model';
import { Post } from '../post/post.model';

@Model()
export class User extends BaseModel {
@@ -1,16 +1,16 @@
import { Arg, Args, Ctx, FieldResolver, Mutation, Query, Resolver, Root } from 'type-graphql';
import { Inject } from 'typedi';

import { BaseContext, StandardDeleteResponse, UserId } from '../../../src';
import { BaseContext, StandardDeleteResponse, UserId } from '../../../../../src';
import {
UserCreateInput,
UserUpdateArgs,
UserWhereArgs,
UserWhereInput,
UserWhereUniqueInput
} from '../generated';
} from '../../../generated';

import { Post } from './post.model';
import { Post } from '../post/post.model';

import { User } from './user.model';
import { UserService } from './user.service';
@@ -2,7 +2,7 @@ import { Service } from 'typedi';
import { Repository } from 'typeorm';
import { InjectRepository } from 'typeorm-typedi-extensions';

import { BaseService } from '../../../src';
import { BaseService } from '../../../../../src';

import { User } from './user.model';

0 comments on commit 8831408

Please sign in to comment.
You can’t perform that action at this time.