INNER CODE UNIT · TypeScript
collectDeclaringTypeNames
babyfish-ct/graphql-ts-client · api/src/DependencyManager.ts:258
function collectDeclaringTypeNames(fieldName: string, fetchableType: FetchableType<string>, output: Set<string>) {
if (fetchableType.declaredFields.has(fieldName)) {
output.add(fetchableType.name);
} else {
for (const superType of fetchableType.superTypes) {
collectDeclaringTypeNames(fieldName, superType, output);
}
}
}
function getDefaultId(value: any): any {
const id = value.id ?? value._id;
if (id === undefined) {
throw Error(`There is no id/_id in the object ${JSON.stringify(value)}`);
}
return id;
}