Skip to content

Commit

Permalink
feat: Setup the discover query for all the current entertainment quer…
Browse files Browse the repository at this point in the history
…y types
  • Loading branch information
AlexMachin1997 committed Oct 28, 2024
1 parent 75e332a commit 32651c9
Show file tree
Hide file tree
Showing 31 changed files with 1,149 additions and 630 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"source.fixAll.eslint": "explicit"
},
"editor.cursorSmoothCaretAnimation": "on",
"editor.fontSize": 20,
"editor.fontSize": 15,

"editor.minimap.enabled": false,
"editor.tabSize": 2,
Expand Down Expand Up @@ -65,8 +65,8 @@
"*.react.js": "javascriptreact",
"*.jsx": "javascriptreact"
},
"terminal.integrated.fontSize": 20,
"terminal.integrated.fontSize": 15,
"screencastMode.fontSize": 59,
"scm.inputFontSize": 20,
"scm.inputFontSize": 15,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"joi": "^17.13.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"ts-morph": "^22.0.0"
"ts-morph": "^22.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ConfigModule } from '@nestjs/config';
import { GraphQLModule } from '@nestjs/graphql';
import joi from 'joi';

import { DiscoverFilteringModule } from './discover-filtering/discover-filtering.module';
import { DiscoverFormDataModule } from './discover-form-data/discover-form-data.module';
import { FilteringOptionsModule } from './filtering-options/filtering-options.module';
import { MovieModule } from './movie/movie.module';
Expand All @@ -26,6 +27,7 @@ import { ShowModule } from './show/show.module';
typePaths: [
// Enums used by all the graphql schemas
'./src/models/enum.graphql',
'./src/models/Pagination.graphql',

// Entertainment specific models, used for the Movie and Show schemas
'./src/models/entertainment/BelongsToCollection.graphql',
Expand All @@ -52,7 +54,8 @@ import { ShowModule } from './show/show.module';
MovieModule,
PersonModule,
DiscoverFormDataModule,
FilteringOptionsModule
FilteringOptionsModule,
DiscoverFilteringModule
]
})
export class AppModule {}
13 changes: 13 additions & 0 deletions src/discover-filtering/discover-filtering.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';

import { DiscoverFilteringResolver } from './discover-filtering.resolver';
import { DiscoverFilteringService } from './discover-filtering.service';
import { FilteringOptionsModule } from '../filtering-options/filtering-options.module';
import { UtilsModule } from '../utils/utils.module';

@Module({
providers: [DiscoverFilteringService, DiscoverFilteringResolver],
imports: [FilteringOptionsModule, HttpModule, UtilsModule, FilteringOptionsModule]
})
export class DiscoverFilteringModule {}
25 changes: 25 additions & 0 deletions src/discover-filtering/discover-filtering.resolver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Args, Query, Resolver } from '@nestjs/graphql';

import { DiscoverFilteringService } from './discover-filtering.service';
import { DiscoverFormDataInput } from '../graphql.schema';

@Resolver()
export class DiscoverFilteringResolver {
constructor(private readonly discoverFilteringService: DiscoverFilteringService) {}

@Query()
discoverMovies(
@Args('filterValues') filters: DiscoverFormDataInput,
@Args('pageNumber') pageNumber: number
) {
return this.discoverFilteringService.getDiscoverMovies({ filters, pageNumber });
}

@Query()
discoverShows(
@Args('filterValues') filters: DiscoverFormDataInput,
@Args('pageNumber') pageNumber: number
) {
return this.discoverFilteringService.getDiscoverShows({ filters, pageNumber });
}
}
Loading

0 comments on commit 32651c9

Please sign in to comment.