ent
ent copied to clipboard
generate EntQuery for global queries
recently had to manually create the query but it seems like we should generate it
the main reason not to is that's it unclear what the source id is
export class FooEdge extends AssocEdge {}
export const countLoaderFactory = new AssocEdgeCountLoaderFactory(
EdgeType.Foo,
);
export const edgeLoaderFactory = new AssocEdgeLoaderFactory(
EdgeType.Foo,
() => FooEdge,
);
export class FooQuery extends AssocEdgeQueryBase<
Ent<Viewer>,
Profile,
FooEdge,
Viewer
> {
constructor(viewer: Viewer) {
super(
viewer,
GLOBAL_SOURCE,
countLoaderFactory,
edgeLoaderFactory,
Profile.loaderOptions(),
);
}
static query(viewer: Viewer): GlobalOnlineProfilesQuery {
return new GlobalOnlineProfilesQuery(viewer);
}
withoutTransformations(): this {
this.configureEdgeQueryableDataOptions({ disableTransformations: true });
return this;
}
async sourceEnt(_id: ID) {
return null;
}
}