Closed capaj closed 6 years ago
I use typegql with objection.js model, on this model I have a Field like this:
@ObjectType class WorkspaceModel extends TimestampedModel { static tableName = 'workspaces' @Field() readonly id!: number @Field() user_id: number @Field() name: string @Field() is_open: boolean }
This is the WorkspaceModel object I am returning in my Query :
Query
{ "id": 3, "is_open": false, "name": "Workspace from test", "openEnrolmentCount": 0, "role": "OWNER", "topicsCount": 0, }
this is what I get from graphql:
{ "id": 3, "is_open": null, "name": "Workspace from test", "openEnrolmentCount": 0, "role": "OWNER", "topicsCount": 0, }
So I ran a test in my boilerplate an indeed using this schema:
@ObjectType({ description: 'Simple product object type' }) class Product extends Model { @Field() is_open: boolean } @SchemaRoot() class SuperSchema { @Query({ type: Product, isNullable: false }) prod(): Product { const product = new Product() product.is_open = false return product } }
when the field is true it is returned correctly.
true
@pie6k I have a fix ready, but it sits on top of prettier branch, can you merge it? I'd open the fix after it's merged.
@capaj I've merged prettier branch
I use typegql with objection.js model, on this model I have a Field like this:
This is the WorkspaceModel object I am returning in my
Query
:this is what I get from graphql:
So I ran a test in my boilerplate an indeed using this schema:
when the field is
true
it is returned correctly.