Skip to content

Commit

Permalink
Change ApolloError GraphQLError
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Sep 11, 2023
1 parent a3c9052 commit 7b2e521
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/modules/admins/admin-operations.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { MarketplacesReindexService } from '../marketplaces/marketplaces-reindex
import { ReportsService } from '../reports/reports.service';
import { ClearReportCollectionInput, ClearReportInput } from './models/clear-report.input';
import { MarketplaceReindexDataArgs } from '../marketplaces/models/MarketplaceReindexDataArgs';
import { GraphQLError } from 'graphql';

@Resolver(() => Boolean)
export class AdminOperationsResolver {
Expand Down Expand Up @@ -69,7 +70,7 @@ export class AdminOperationsResolver {
try {
return await this.nftRarityService.updateCollectionRarities(collectionTicker);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -82,7 +83,7 @@ export class AdminOperationsResolver {
try {
return await this.nftRarityService.validateRarities(collectionTicker);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -95,7 +96,7 @@ export class AdminOperationsResolver {
try {
return await this.nftTraitService.updateCollectionTraits(collectionTicker);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -114,7 +115,7 @@ export class AdminOperationsResolver {
);
return true;
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -127,7 +128,7 @@ export class AdminOperationsResolver {
try {
return await this.nftTraitService.updateNftTraits(identifier);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/modules/scam/collection-scam.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CollectionScamService } from './collection-scam.service';
import { UseGuards } from '@nestjs/common';
import { GqlAdminAuthGuard } from '../auth/gql-admin.auth-guard';
import { JwtOrNativeAuthGuard } from '../auth/jwt.or.native.auth-guard';
import { GraphQLError } from 'graphql';

@Resolver(() => Boolean)
export class CollectionScamResolver {
Expand All @@ -14,7 +15,7 @@ export class CollectionScamResolver {
try {
return await this.collectionScamService.manuallySetCollectionScamInfo(collection);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -24,7 +25,7 @@ export class CollectionScamResolver {
try {
return await this.collectionScamService.manuallyClearCollectionScamInfo(collection);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}
}
5 changes: 3 additions & 2 deletions src/modules/scam/nft-scam.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { NftScamService } from './nft-scam.service';
import { GqlAdminAuthGuard } from '../auth/gql-admin.auth-guard';
import { ScamInfoTypeEnum } from '../assets/models';
import { JwtOrNativeAuthGuard } from '../auth/jwt.or.native.auth-guard';
import { GraphQLError } from 'graphql';

@Resolver(() => Boolean)
export class NftScamResolver {
Expand All @@ -15,7 +16,7 @@ export class NftScamResolver {
try {
return await this.nftScamService.validateNftScamInfoForIdentifier(identifier);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand All @@ -30,7 +31,7 @@ export class NftScamResolver {
try {
return await this.nftScamService.manuallySetNftScamInfo(identifier, type, info);
} catch (error) {
throw error;
throw new GraphQLError(error);
}
}

Expand Down

0 comments on commit 7b2e521

Please sign in to comment.