We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5ea005 commit 2ba4a18Copy full SHA for 2ba4a18
src/server/templates/typescript.ts
@@ -171,9 +171,8 @@ export const apply = async ({
171
172
if (tablesNamesByTableId[relationId]) return tablesNamesByTableId[relationId]
173
// if it's a composite type we use the type name as relation name to allow sub-selecting fields of the composite type
174
- if (returnTypeId && typesById[returnTypeId] && typesById[returnTypeId].attributes.length > 0)
175
- return typesById[returnTypeId].name
176
- return null
+ const reltype = returnTypeId ? relationTypeByIds.get(returnTypeId) : null
+ return reltype ? reltype.name : null
177
}
178
179
for (const func of functions) {
0 commit comments