Licensed to be used in conjunction with basebox, only.
@bb_primaryKey directive specifies that a field in a GraphQL object serves as the primary key for the corresponding database table. A primary key is an identifier in a database table that allows someone to uniquely identify a record in a database table.
If an object type has a single field of type
ID, the compiler will assume that this is the corresponding table's primary key. This will be created as an autogenerated
UUID column in the database. If you would like to create an alternative primary key to the
ID field, have a primary key of a different type (e.g.
externalId: String! in a type) or have multiple
ID fields in an object type then it is essential to use the
Patientobject uses a reference number as the primary key for the corresponding table created in the database. We have also added a
databaseIdthat is of type
ID. This will be created as a
UUIDfield and be autogenerated by the database. It is however not the primary key here.
IDfields. The compiler cannot assume which one is the primary key so the
@bb_primaryKeydirective has to be specified.