Open marcalj opened 2 years ago
If you are adding new field which is not in prisma schema, I think it's better to generate abstract object https://github.com/unlight/prisma-nestjs-graphql#objecttype, than inherit it and add your additional fields, see https://docs.nestjs.com/graphql/resolvers#generics
I'm using a MariaDB JSON field to store an array of
CandleInfo
, which is not created in Prisma schema.CandleInfo
is created manually in a dedicated file. The problem is that I can't set array types correctly using@FieldType
and@PropertyType
.For
@PropertyType
, I've solved creating a custom typeArray<CandleInfo>
, but can't figure it out a way to fix@FieldType
array definition:Prisma schema:
Generated file
order.model.ts
:File:
src/orders/entities/candle-info.entity.ts
Any chance to detect/parse
[typeNameExample]
in@FieldType.name
as an array automatically or provide a new parameter to flag as an array? Thanks!PD: I'm new to GraphQL and Prisma, so maybe there's a workaround I can't find and I would appreciate any guidance.
Thanks for creating this project! ❤️