First of all, this lib is awesome, saves tons of time for the projects which use GraphQL. I really hope it gets to v1 sometime :)
Now, I've found an issue: when doing self-relations, GraphQL schema adds a relation properly, but does not go deeper than that. Example:
export const asset = testSchema.table(
'asset',
{
id: uuid().notNull().primaryKey().defaultRandom(),
templateId: uuid(),
assetTypeId: uuid()
.notNull()
.references(() => assetType.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
name: text().notNull(),
},
(table) => [
foreignKey({
name: 'template',
columns: [table.templateId],
foreignColumns: [table.id],
})
.onDelete('cascade')
.onUpdate('cascade'),
],
)
export const assetRelations = relations(asset, ({ many, one }) => ({
assetType: one(assetType, {
fields: [asset.assetTypeId],
references: [assetType.id],
}),
template: one(asset, { fields: [asset.templateId], references: [asset.id] }),
}))
I've tried (just in case) both Apollo and Yoga, and both behave the same way. I can query the asset, with assetType (and go deeper if there's a relation in other cases), but with a template, I can only query own asset fields, can't go deeper with assetType etc, only assetTypeId.

First of all, this lib is awesome, saves tons of time for the projects which use GraphQL. I really hope it gets to v1 sometime :)
Now, I've found an issue: when doing self-relations, GraphQL schema adds a relation properly, but does not go deeper than that. Example:
I've tried (just in case) both Apollo and Yoga, and both behave the same way. I can query the
asset, withassetType(and go deeper if there's a relation in other cases), but with atemplate, I can only query ownassetfields, can't go deeper withassetTypeetc, onlyassetTypeId.