Hi! How you serialize one bigint property? I have...
# orm-help
m
Hi! How you serialize one bigint property? I have installed the
graphql-scalars
package and I'm using like this
Copy code
@Field(() => GraphQLScalars.BigIntResolver, {
    nullable: true
  })
  lte?: bigint | undefined;
But when it's not null I recieved an error
Copy code
"message": "Do not know how to serialize a BigInt"
Any approach to fix it or how serialize it properly?
1
This happens since I have upgraded prisma to v4, in last 3.x.x version it was working without any problem.
Previously It was working with this exposed model to graphql
Copy code
export class EntityGroupBy {
    @Field(() => String, {
        nullable: false
      })
      name!: string;

    @Field(() => Int, {
    nullable: false
    })
    numCount!: number;
}
And it's a queryRaw, I have no defined any as bigint. Have you changed the default type for numbers in v4?
Copy code
select ct."name", count(*) "numCount" 
from "Contract" c 
inner join "ContractType" ct on c.type=ct.id 
group by ct."name"
j
m
Thanks @Jared Fraser I will take a look!