Skip to content
Permalink
Browse files

Add bytea to TypeORMConverter, mapping to GraphQLString (#229)

* Add bytea to TypeORMConverter, mapping to GraphQLString

* adding bytea to example
  • Loading branch information
Ghost-in-a-Jar authored and goldcaddy77 committed Oct 31, 2019
1 parent 677d04c commit 01458db8a0a7f5c4463a71a3e16e4448596f0784
Showing with 5 additions and 1 deletion.
  1. +4 −1 examples/02-complex-example/src/modules/user/user.model.ts
  2. +1 −0 src/schema/TypeORMConverter.ts
@@ -1,5 +1,5 @@
import { Authorized } from 'type-graphql';
import { Unique } from 'typeorm';
import { Unique, Column } from 'typeorm';
import {
BaseModel,
DateField,
@@ -44,4 +44,7 @@ export class User extends BaseModel {

@JSONField({ nullable: true })
jsonField?: JSON;

@Column('bytea')
serialized?: Buffer;
}
@@ -66,6 +66,7 @@ export function columnToGraphQLType(column: ColumnMetadata): GraphQLScalarType |
case 'varchar':
case 'text':
case 'uuid':
case 'bytea':
return GraphQLString;
// TODO: clean up unused types (Boolean and 'Boolean')
case Boolean:

0 comments on commit 01458db

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