Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): removes some dead code #174

Merged
merged 1 commit into from Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/1-simple-model/package.json
Expand Up @@ -2,7 +2,8 @@
"name": "example1",
"version": "0.0.0",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen",
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn clean && yarn db:create && yarn codegen",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
Expand Down
1 change: 1 addition & 0 deletions examples/2-complex-example/package.json
Expand Up @@ -4,6 +4,7 @@
"license": "MIT",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen && yarn db:seed:dev",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "yarn warthog codegen",
"db:create": "yarn warthog db:create",
"db:drop": "yarn warthog db:drop",
Expand Down
2 changes: 1 addition & 1 deletion examples/3-one-to-many-relationship/generated/binding.ts
Expand Up @@ -222,8 +222,8 @@ export interface Post extends BaseGraphQLObject {
deletedById?: String | null
version: Int
title: String
userId: String
user: User
userId: String
}

export interface StandardDeleteResponse {
Expand Down
Expand Up @@ -83,8 +83,8 @@ type Post implements BaseGraphQLObject {
deletedById: String
version: Int!
title: String!
userId: String!
user: User!
userId: String!
}

input PostCreateInput {
Expand Down
1 change: 1 addition & 0 deletions examples/3-one-to-many-relationship/package.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
Expand Down
4 changes: 2 additions & 2 deletions examples/4-many-to-many-relationship/generated/binding.ts
Expand Up @@ -425,10 +425,10 @@ export interface UserRole extends BaseGraphQLObject {
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
userId: String
user?: User | null
roleId: String
userId: String
role?: Role | null
roleId: String
otherMetadata?: String | null
}

Expand Down
4 changes: 2 additions & 2 deletions examples/4-many-to-many-relationship/generated/schema.graphql
Expand Up @@ -306,10 +306,10 @@ type UserRole implements BaseGraphQLObject {
deletedAt: DateTime
deletedById: String
version: Int!
userId: String!
user: User
roleId: String!
userId: String!
role: Role
roleId: String!
otherMetadata: String
}

Expand Down
1 change: 1 addition & 0 deletions examples/4-many-to-many-relationship/package.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
Expand Down
1 change: 1 addition & 0 deletions examples/5-migrations/package.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
Expand Down
1 change: 1 addition & 0 deletions examples/6-base-service/package.json
Expand Up @@ -4,6 +4,7 @@
"license": "MIT",
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen && yarn db:seed:dev",
"clean": "rm -f ./warthog.sqlite.tmp",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
Expand Down
2 changes: 1 addition & 1 deletion examples/8-performance/generated/binding.ts
Expand Up @@ -223,8 +223,8 @@ export interface Post extends BaseGraphQLObject {
deletedById?: String | null
version: Int
title: String
userId: String
user: User
userId: String
}

export interface StandardDeleteResponse {
Expand Down
2 changes: 1 addition & 1 deletion examples/8-performance/generated/schema.graphql
Expand Up @@ -84,8 +84,8 @@ type Post implements BaseGraphQLObject {
deletedById: String
version: Int!
title: String!
userId: String!
user: User!
userId: String!
}

input PostCreateInput {
Expand Down
6 changes: 3 additions & 3 deletions examples/9-production/package.json
Expand Up @@ -4,9 +4,9 @@
"scripts": {
"bootstrap": "cd ../.. && yarn && yarn link && cd - && yarn && yarn db:create && yarn codegen && yarn db:seed:dev",
"codegen": "warthog codegen",
"db:create": "warthog db:create",
"db:drop": "warthog db:drop",
"db:seed:dev": "ts-node tools/seed.ts",
"db:create": "WARTHOG_DB_OVERRIDE=true warthog db:create",
"db:drop": "WARTHOG_DB_OVERRIDE=true warthog db:drop",
"db:seed:dev": "WARTHOG_DB_OVERRIDE=true ts-node tools/seed.ts",
"playground": "warthog playground",
"start": "yarn start:ts",
"start:ts": "ts-node --type-check src/index.ts",
Expand Down
12 changes: 6 additions & 6 deletions src/metadata/metadata-storage.ts
Expand Up @@ -32,12 +32,12 @@ export class MetadataStorage {
return this.enumMap[tableName][columnName] || undefined;
}

getModel(tableName: string) {
if (!this.enumMap[tableName]) {
return undefined;
}
return this.enumMap[tableName];
}
// getModel(tableName: string) {
// if (!this.enumMap[tableName]) {
// return undefined;
// }
// return this.enumMap[tableName];
// }
}

export function getMetadataStorage(): MetadataStorage {
Expand Down
16 changes: 8 additions & 8 deletions src/schema/TypeORMConverter.ts
Expand Up @@ -54,19 +54,19 @@ export function columnToGraphQLType(column: ColumnMetadata): GraphQLScalarType |
const type = (column.type as any).name ? (column.type as any).name : column.type;

switch (type) {
case String:
// case String:
case 'String':
case 'varchar':
case 'text':
case 'uuid':
return GraphQLString;
case Boolean:
case 'Boolean':
// case Boolean:
// case 'Boolean':
case 'boolean':
case 'bool':
return GraphQLBoolean;
case Number:
case 'Number':
// case Number:
// case 'Number':
case 'float':
case 'float4':
case 'float8':
Expand All @@ -89,9 +89,9 @@ export function columnToGraphQLType(column: ColumnMetadata): GraphQLScalarType |
case 'int4':
case 'int8':
return GraphQLInt;
case Date:
case 'Date':
case 'timestamp':
// case Date:
// case 'Date':
// case 'timestamp':
case 'datetime':
return GraphQLISODateTime;
case 'json':
Expand Down