@nestjs/graphql#Root TypeScript Examples
The following examples show how to use
@nestjs/graphql#Root.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tag.resolver.ts From whispr with MIT License | 5 votes |
/**
* Field resolver
*/
@ResolveField()
async tagGroup(@Root() tag: Tag): Promise<ITagGroup> {
// eslint-disable-next-line no-underscore-dangle
return this.tagGroupService.findOne(tag.tagGroup._id);
}
Example #2
Source File: tagGroup.resolver.ts From whispr with MIT License | 5 votes |
/**
* Field resolver
*/
@ResolveField(() => [Tag])
async tags(@Root() tagGroup: TagGroup): Promise<ITag[]> {
// eslint-disable-next-line no-underscore-dangle
return this.tagService.findAll({ tagGroup: { _id: tagGroup._id } });
}
Example #3
Source File: whisp.resolver.ts From whispr with MIT License | 5 votes |
/**
* Field resolver
*/
@ResolveField(() => [Tag])
async tags(@Root() whisp: Whisp): Promise<TagInputType[]> {
// eslint-disable-next-line no-underscore-dangle
return this.whispService.findTagsByWhispId(whisp._id);
}