Skip to content

Commit

Permalink
removed stat edit handle on graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedegeofroy committed Oct 20, 2024
1 parent ea7b31b commit 5e0aeee
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/stats/stats.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { Args, Mutation, Query, Resolver, Subscription } from '@nestjs/graphql';
import { Query, Resolver, Subscription } from '@nestjs/graphql';
import { StatsService } from './stats.service';
import { Stat } from './stat.entity';
import { CreateStatInput } from './dto/create-stat.input';
import { PubSubService } from 'src/pub-sub/pub-sub.service';

// todo
// add security features so not anybody can deface the website ;)

@Resolver(() => Stat)
export class StatsResolver {
constructor(
Expand All @@ -19,13 +15,6 @@ export class StatsResolver {
return this.statService.findLatest();
}

@Mutation(() => Stat)
async createStat(
@Args('createStatInput') createStatInput: CreateStatInput
): Promise<Stat> {
return await this.statService.createStat(createStatInput);
}

@Subscription(() => [Stat])
statCreated() {
return this.pubSubService.getPubSub().asyncIterator('statCreated');
Expand Down

0 comments on commit 5e0aeee

Please sign in to comment.