You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
TypeORM @PrimaryColumn supports fields with an arbitrary name, but Squid's codegen only supports a PrimaryColumn named 'id'. If an 'id' value is not included in the schema, then it is added automatically.
This means code comments are required to explain what the entity's id value is, rather than semantic field names. As is evidenced in your own example project!
To Reproduce
Create a schema.graphql file like:
type TestEntity @entity {
someUniqueIdentifier: ID!
foo: boolean;
}
Codegen automatically creates a @PrimaryColumn_() of id. The intended primary column is someUniqueIdentifier
Expected behavior
Schema entity fields typed as ID! should be used for TypeORM's PrimaryColumn instead of id.
No id field should be created unless an ID! is missing.
Describe the bug
TypeORM
@PrimaryColumn
supports fields with an arbitrary name, but Squid's codegen only supports a PrimaryColumn named 'id'. If an 'id' value is not included in the schema, then it is added automatically.This means code comments are required to explain what the entity's
id
value is, rather than semantic field names. As is evidenced in your own example project!To Reproduce
Create a
schema.graphql
file like:Codegen automatically creates a
@PrimaryColumn_()
ofid
. The intended primary column issomeUniqueIdentifier
Expected behavior
ID!
should be used for TypeORM'sPrimaryColumn
instead of id.id
field should be created unless anID!
is missing.i.e. the above example
Should yield:
The text was updated successfully, but these errors were encountered: