Can the ID field on the single-entity generated resolvers be extended to be an object? (Multiple Primary Columns) #338
Unanswered
MateoGuerreroE
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Maybe checkout IDField. Not sure if it works with multiple fields, but you can always try |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey! So I'm having an issue while trying to use the single-entity generated endpoint from Nestjs-Query. I understand the basic structure of that endpoint would be
entity (id: "id") {...}
. However since the entity I'm working has several @PrimaryColumn decorators, TypeORM will complain with:Cannot use given entity id \"id\" because \"EntityRecord\" contains multiple primary columns, you must provide object in following form: {\"id1\":1,\"id2\":2,\"id3\":3} as an id.
This error comes from TypeORM, but looks like (and as per my investigation) It's expecting an object there, which can be extended If the resolver is manually made but since these resolvers are generated, is there a way for me to tell the generated resolver to extend the ID to an object, so It can process that object? (Bwt I already tried with stringify JSON and does nto work either, typeorm It's expecting an actual object)
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions