I have Uploads
table.
Uploads
has many-to-many
relation with Parties
table.
the junction table is Uploads_Parties
, it contains: upload_id
& party_id
as fields.
how can i make postgraphile to consider these relation in the schema generation ?
attempts:
- many-to-many plugin - https://github.com/graphile-contrib/pg-many-to-many. after adding the plugin no effect was taking place.
- smart tags plugin - https://www.graphile.org/postgraphile/make-pg-smart-tags-plugin/ - i tried adding foreign key relation between the
Uploads.upload_id -> Uploads_Parties.upload_id
, but then postgraphile throw an error.
Server init code
const SmartTagsPlugin = makePgSmartTagsFromFilePlugin(
resolve(__dirname, '../../postgraphile.tags.jsonc'),
);
...
appendPlugins: [
SmartTagsPlugin,
PgManyToManyPlugin]
...
tags.jsonc
"config": {
"class": {
"upload_service.upload": {
"tags": {
"foreignKey": [
"(id) references upload_service.uploads_parties (upload_id)|@fieldName uploadDataSet"
]
}
}
}
}