├── .circleci └── config.yml ├── .commitlintrc ├── .czrc ├── .editorconfig ├── .env.example ├── .env.production.example ├── .env.test.example ├── .eslintignore ├── .eslintrc.js ├── .github ├── dependabot.yml ├── mergify.yml └── workflows │ ├── build.yml │ ├── lint.yml │ └── unit-tests.yml ├── .gitignore ├── .husky ├── .gitignore └── pre-commit ├── .prettierignore ├── .prettierrc ├── .travis.yml ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── docker-compose.production.yml ├── docker-compose.test.yml ├── docker-compose.yml ├── docker ├── Dockerfile ├── Dockerfile.prod └── nginx │ ├── .env.nginx.example │ ├── Dockerfile.nginx │ └── nginx.conf ├── docs ├── .gitkeep └── img │ ├── GraphQL_Logo.svg │ ├── logo1.png │ ├── logo2.png │ ├── pgadmin-2.png │ ├── pgadmin.png │ ├── prisma-seeklogo.com.svg │ └── prisma-studio.png ├── jest.config.js ├── nest-cli.json ├── package.json ├── prisma ├── dbml │ └── schema.dbml ├── migrations │ ├── 20210211125911_init_db │ │ └── migration.sql │ └── migration_lock.toml ├── schema.prisma └── seed.ts ├── src ├── @types │ ├── env.d.ts │ └── http.d.ts ├── app.module.ts ├── app │ ├── app.controller.ts │ ├── app.resolver.ts │ ├── app.service.ts │ └── test │ │ ├── app.controller.spec.ts │ │ ├── app.resolver.spec.ts │ │ └── app.service.spec.ts ├── common │ ├── @generated │ │ ├── category │ │ │ ├── aggregate-category.args.ts │ │ │ ├── aggregate-category.output.ts │ │ │ ├── category-count-aggregate.input.ts │ │ │ ├── category-count-aggregate.output.ts │ │ │ ├── category-create-many-without-posts.input.ts │ │ │ ├── category-create-many.input.ts │ │ │ ├── category-create-or-connect-without-posts.input.ts │ │ │ ├── category-create-or-connect-withoutposts.input.ts │ │ │ ├── category-create-without-posts.input.ts │ │ │ ├── category-create.input.ts │ │ │ ├── category-group-by.output.ts │ │ │ ├── category-list-relation-filter.input.ts │ │ │ ├── category-max-aggregate.input.ts │ │ │ ├── category-max-aggregate.output.ts │ │ │ ├── category-min-aggregate.input.ts │ │ │ ├── category-min-aggregate.output.ts │ │ │ ├── category-order-by.input.ts │ │ │ ├── category-scalar-field.enum.ts │ │ │ ├── category-scalar-where-with-aggregates.input.ts │ │ │ ├── category-scalar-where.input.ts │ │ │ ├── category-unchecked-create-without-posts.input.ts │ │ │ ├── category-unchecked-create.input.ts │ │ │ ├── category-unchecked-update-many-without-categories.input.ts │ │ │ ├── category-unchecked-update-many.input.ts │ │ │ ├── category-unchecked-update-without-posts.input.ts │ │ │ ├── category-unchecked-update.input.ts │ │ │ ├── category-update-many-mutation.input.ts │ │ │ ├── category-update-many-with-where-without-posts.input.ts │ │ │ ├── category-update-many-without-categories.input.ts │ │ │ ├── category-update-many-without-posts.input.ts │ │ │ ├── category-update-many.input.ts │ │ │ ├── category-update-with-where-unique-without-posts.input.ts │ │ │ ├── category-update-without-posts.input.ts │ │ │ ├── category-update.input.ts │ │ │ ├── category-upsert-with-where-unique-without-posts.input.ts │ │ │ ├── category-where-unique.input.ts │ │ │ ├── category-where.input.ts │ │ │ ├── category.model.ts │ │ │ ├── find-first-category.args.ts │ │ │ ├── find-many-category.args.ts │ │ │ ├── find-one-category.args.ts │ │ │ ├── find-unique-category.args.ts │ │ │ ├── group-by-category.args.ts │ │ │ └── index.ts │ │ ├── post │ │ │ ├── aggregate-post.args.ts │ │ │ ├── aggregate-post.output.ts │ │ │ ├── find-first-post.args.ts │ │ │ ├── find-many-post.args.ts │ │ │ ├── find-one-post.args.ts │ │ │ ├── find-unique-post.args.ts │ │ │ ├── group-by-post.args.ts │ │ │ ├── index.ts │ │ │ ├── post-count-aggregate.input.ts │ │ │ ├── post-count-aggregate.output.ts │ │ │ ├── post-create-many-author-envelope.input.ts │ │ │ ├── post-create-many-author.input.ts │ │ │ ├── post-create-many-without-author.input.ts │ │ │ ├── post-create-many-without-categories.input.ts │ │ │ ├── post-create-many.input.ts │ │ │ ├── post-create-or-connect-without-author.input.ts │ │ │ ├── post-create-or-connect-without-categories.input.ts │ │ │ ├── post-create-or-connect-withoutauthor.input.ts │ │ │ ├── post-create-or-connect-withoutcategories.input.ts │ │ │ ├── post-create-without-author.input.ts │ │ │ ├── post-create-without-categories.input.ts │ │ │ ├── post-create.input.ts │ │ │ ├── post-group-by.output.ts │ │ │ ├── post-list-relation-filter.input.ts │ │ │ ├── post-max-aggregate.input.ts │ │ │ ├── post-max-aggregate.output.ts │ │ │ ├── post-min-aggregate.input.ts │ │ │ ├── post-min-aggregate.output.ts │ │ │ ├── post-order-by.input.ts │ │ │ ├── post-scalar-field.enum.ts │ │ │ ├── post-scalar-where-with-aggregates.input.ts │ │ │ ├── post-scalar-where.input.ts │ │ │ ├── post-unchecked-create-many-without-author.input.ts │ │ │ ├── post-unchecked-create-nested-many-without-author.input.ts │ │ │ ├── post-unchecked-create-without-author.input.ts │ │ │ ├── post-unchecked-create-without-categories.input.ts │ │ │ ├── post-unchecked-create.input.ts │ │ │ ├── post-unchecked-update-many-without-author.input.ts │ │ │ ├── post-unchecked-update-many-without-posts.input.ts │ │ │ ├── post-unchecked-update-many.input.ts │ │ │ ├── post-unchecked-update-without-author.input.ts │ │ │ ├── post-unchecked-update-without-categories.input.ts │ │ │ ├── post-unchecked-update.input.ts │ │ │ ├── post-update-many-mutation.input.ts │ │ │ ├── post-update-many-with-where-without-author.input.ts │ │ │ ├── post-update-many-with-where-without-categories.input.ts │ │ │ ├── post-update-many-without-author.input.ts │ │ │ ├── post-update-many-without-categories.input.ts │ │ │ ├── post-update-many-without-posts.input.ts │ │ │ ├── post-update-many.input.ts │ │ │ ├── post-update-with-where-unique-without-author.input.ts │ │ │ ├── post-update-with-where-unique-without-categories.input.ts │ │ │ ├── post-update-without-author.input.ts │ │ │ ├── post-update-without-categories.input.ts │ │ │ ├── post-update.input.ts │ │ │ ├── post-upsert-with-where-unique-without-author.input.ts │ │ │ ├── post-upsert-with-where-unique-without-categories.input.ts │ │ │ ├── post-where-unique.input.ts │ │ │ ├── post-where.input.ts │ │ │ └── post.model.ts │ │ ├── prisma │ │ │ ├── affected-rows-output.output.ts │ │ │ ├── affected-rows.output.ts │ │ │ ├── batch-payload.output.ts │ │ │ ├── bool-filter.input.ts │ │ │ ├── bool-with-aggregates-filter.input.ts │ │ │ ├── boolean-filter.input.ts │ │ │ ├── boolean-with-aggregates-filter.input.ts │ │ │ ├── category-create-nested-many-without-posts.input.ts │ │ │ ├── date-time-filter.input.ts │ │ │ ├── date-time-with-aggregates-filter.input.ts │ │ │ ├── enum-role-filter.input.ts │ │ │ ├── enum-role-with-aggregates-filter.input.ts │ │ │ ├── index.ts │ │ │ ├── int-filter.input.ts │ │ │ ├── post-create-nested-many-without-author.input.ts │ │ │ ├── post-create-nested-many-without-categories.input.ts │ │ │ ├── profile-create-nested-one-without-user.input.ts │ │ │ ├── query-mode.enum.ts │ │ │ ├── role.enum.ts │ │ │ ├── sort-order.enum.ts │ │ │ ├── string-filter.input.ts │ │ │ ├── string-with-aggregates-filter.input.ts │ │ │ ├── user-create-nested-one-without-posts.input.ts │ │ │ └── user-create-nested-one-without-profile.input.ts │ │ ├── profile │ │ │ ├── aggregate-profile.args.ts │ │ │ ├── aggregate-profile.output.ts │ │ │ ├── find-first-profile.args.ts │ │ │ ├── find-many-profile.args.ts │ │ │ ├── find-one-profile.args.ts │ │ │ ├── find-unique-profile.args.ts │ │ │ ├── group-by-profile.args.ts │ │ │ ├── index.ts │ │ │ ├── profile-count-aggregate.input.ts │ │ │ ├── profile-count-aggregate.output.ts │ │ │ ├── profile-create-many.input.ts │ │ │ ├── profile-create-one-without-user.input.ts │ │ │ ├── profile-create-or-connect-without-user.input.ts │ │ │ ├── profile-create-or-connect-withoutuser.input.ts │ │ │ ├── profile-create-without-user.input.ts │ │ │ ├── profile-create.input.ts │ │ │ ├── profile-group-by.output.ts │ │ │ ├── profile-max-aggregate.input.ts │ │ │ ├── profile-max-aggregate.output.ts │ │ │ ├── profile-min-aggregate.input.ts │ │ │ ├── profile-min-aggregate.output.ts │ │ │ ├── profile-order-by.input.ts │ │ │ ├── profile-relation-filter.input.ts │ │ │ ├── profile-scalar-field.enum.ts │ │ │ ├── profile-scalar-where-with-aggregates.input.ts │ │ │ ├── profile-unchecked-create-nested-one-without-user.input.ts │ │ │ ├── profile-unchecked-create-one-without-user.input.ts │ │ │ ├── profile-unchecked-create-without-user.input.ts │ │ │ ├── profile-unchecked-create.input.ts │ │ │ ├── profile-unchecked-update-many.input.ts │ │ │ ├── profile-unchecked-update-one-without-user.input.ts │ │ │ ├── profile-unchecked-update-without-user.input.ts │ │ │ ├── profile-unchecked-update.input.ts │ │ │ ├── profile-update-many-mutation.input.ts │ │ │ ├── profile-update-many.input.ts │ │ │ ├── profile-update-one-without-user.input.ts │ │ │ ├── profile-update-without-user.input.ts │ │ │ ├── profile-update.input.ts │ │ │ ├── profile-upsert-without-user.input.ts │ │ │ ├── profile-where-unique.input.ts │ │ │ ├── profile-where.input.ts │ │ │ └── profile.model.ts │ │ └── user │ │ │ ├── aggregate-user.args.ts │ │ │ ├── aggregate-user.output.ts │ │ │ ├── find-first-user.args.ts │ │ │ ├── find-many-user.args.ts │ │ │ ├── find-one-user.args.ts │ │ │ ├── find-unique-user.args.ts │ │ │ ├── group-by-user.args.ts │ │ │ ├── index.ts │ │ │ ├── user-count-aggregate.input.ts │ │ │ ├── user-count-aggregate.output.ts │ │ │ ├── user-create-many.input.ts │ │ │ ├── user-create-one-without-posts.input.ts │ │ │ ├── user-create-one-without-profile.input.ts │ │ │ ├── user-create-or-connect-without-posts.input.ts │ │ │ ├── user-create-or-connect-without-profile.input.ts │ │ │ ├── user-create-or-connect-withoutposts.input.ts │ │ │ ├── user-create-or-connect-withoutprofile.input.ts │ │ │ ├── user-create-without-posts.input.ts │ │ │ ├── user-create-without-profile.input.ts │ │ │ ├── user-create.input.ts │ │ │ ├── user-group-by.output.ts │ │ │ ├── user-max-aggregate.input.ts │ │ │ ├── user-max-aggregate.output.ts │ │ │ ├── user-min-aggregate.input.ts │ │ │ ├── user-min-aggregate.output.ts │ │ │ ├── user-order-by.input.ts │ │ │ ├── user-relation-filter.input.ts │ │ │ ├── user-scalar-field.enum.ts │ │ │ ├── user-scalar-where-with-aggregates.input.ts │ │ │ ├── user-unchecked-create-without-posts.input.ts │ │ │ ├── user-unchecked-create-without-profile.input.ts │ │ │ ├── user-unchecked-create.input.ts │ │ │ ├── user-unchecked-update-many.input.ts │ │ │ ├── user-unchecked-update-without-posts.input.ts │ │ │ ├── user-unchecked-update-without-profile.input.ts │ │ │ ├── user-unchecked-update.input.ts │ │ │ ├── user-update-many-mutation.input.ts │ │ │ ├── user-update-many.input.ts │ │ │ ├── user-update-one-without-posts.input.ts │ │ │ ├── user-update-one-without-profile.input.ts │ │ │ ├── user-update-without-posts.input.ts │ │ │ ├── user-update-without-profile.input.ts │ │ │ ├── user-update.input.ts │ │ │ ├── user-upsert-without-posts.input.ts │ │ │ ├── user-upsert-without-profile.input.ts │ │ │ ├── user-where-unique.input.ts │ │ │ ├── user-where.input.ts │ │ │ └── user.model.ts │ ├── abstract-model │ │ ├── base.model.ts │ │ └── date.scalar.ts │ ├── configs │ │ ├── env.config.ts │ │ ├── graphql-module.factory.ts │ │ ├── i18n-module.factory.ts │ │ ├── index.ts │ │ ├── session-config.ts │ │ └── setup-swagger.ts │ ├── environment │ │ ├── environment.interface.ts │ │ └── index.ts │ ├── global-exceptions-filter │ │ └── all-exceptions.filter.ts │ ├── global-interceptors │ │ ├── errors.interceptor.ts │ │ ├── exclude-null.interceptor.ts │ │ ├── logging.interceptor.ts │ │ └── transform.interceptor.ts │ ├── global-interfaces │ │ ├── http.interface.ts │ │ └── index.ts │ ├── i18n │ │ ├── en │ │ │ ├── category.json │ │ │ ├── global.json │ │ │ └── user.json │ │ └── fr │ │ │ ├── category.json │ │ │ ├── global.json │ │ │ └── user.json │ ├── types │ │ └── node.d.ts │ └── utils │ │ └── decorator-factory.ts ├── main.ts ├── modules │ ├── auth │ │ ├── .gitkeep │ │ ├── auth.interface.ts │ │ ├── auth.module.ts │ │ ├── auth.resolver.ts │ │ ├── dto │ │ │ ├── change-password.input.ts │ │ │ ├── index.ts │ │ │ ├── login.input.ts │ │ │ ├── register-user.input.ts │ │ │ ├── request-forgot-password.input.ts │ │ │ └── reset-password.input.ts │ │ ├── guards │ │ │ ├── index.ts │ │ │ ├── jwt-refresh-token.guard.ts │ │ │ └── jwt.guard.ts │ │ ├── services │ │ │ ├── auth.service.ts │ │ │ └── password.service.ts │ │ ├── strategies │ │ │ ├── jwt-refresh-token.strategy.ts │ │ │ └── jwt.strategy.ts │ │ └── test │ │ │ ├── jwt-refresh-token.guard.spec.ts │ │ │ └── jwt.guard.spec.ts │ ├── category │ │ ├── category.model.ts │ │ ├── category.module.ts │ │ ├── category.resolver.ts │ │ ├── category.service.ts │ │ ├── dto │ │ │ ├── create-category.input.ts │ │ │ ├── create-multiple-category.input.ts │ │ │ ├── index.ts │ │ │ └── update-category.input.ts │ │ └── test │ │ │ ├── category.resolver.spec.ts │ │ │ └── category.service.spec.ts │ ├── post │ │ ├── dto │ │ │ ├── create-post.input.ts │ │ │ ├── index.ts │ │ │ └── update-post.input.ts │ │ ├── guard │ │ │ └── author.guard.ts │ │ ├── post.model.ts │ │ ├── post.module.ts │ │ ├── post.resolver.ts │ │ ├── post.service.ts │ │ └── test │ │ │ ├── author.guard.spec.ts │ │ │ ├── post.resolver.spec.ts │ │ │ └── post.service.spec.ts │ ├── profile │ │ ├── dto │ │ │ ├── create-profile.input.ts │ │ │ ├── index.ts │ │ │ └── update-profile.input.ts │ │ ├── profile.model.ts │ │ ├── profile.module.ts │ │ ├── profile.resolver.ts │ │ ├── profile.service.ts │ │ └── test │ │ │ ├── profile.resolver.spec.ts │ │ │ └── profile.service.spec.ts │ └── user │ │ ├── decorators │ │ ├── index.ts │ │ ├── roles.decorator.ts │ │ ├── user-exists.validator.ts │ │ └── user.decorator.ts │ │ ├── dto │ │ ├── change-password.input.ts │ │ ├── create-user.input.ts │ │ ├── index.ts │ │ └── update-user.input.ts │ │ ├── resolvers │ │ ├── admin-user.resolver.ts │ │ └── user.resolver.ts │ │ ├── services │ │ └── user.service.ts │ │ ├── test │ │ ├── admin-user.resolver.spec.ts │ │ ├── password.service.spec.ts │ │ ├── user.resolver.spec.ts │ │ └── user.service.spec.ts │ │ ├── user.model.ts │ │ ├── user.module.ts │ │ └── user.types.ts ├── providers │ ├── email │ │ ├── email.module.ts │ │ ├── email.service.ts │ │ └── templates │ │ │ ├── email-confirmation.hbs │ │ │ ├── reset-password.hbs │ │ │ └── welcome.hbs │ ├── prisma │ │ ├── prisma-select.service.ts │ │ ├── prisma.module.ts │ │ └── prisma.service.ts │ └── redis │ │ ├── interfaces │ │ ├── index.ts │ │ └── redis.interface.ts │ │ ├── redis.constant.ts │ │ ├── redis.module.ts │ │ └── redis.service.ts └── schema.gql ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── tsconfig.build.json ├── tsconfig.json ├── tsconfig.test.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | orbs: 3 | node: circleci/node@4.2.1 4 | jobs: 5 | build-and-test: 6 | executor: 7 | name: node/default 8 | steps: 9 | - checkout 10 | - run: yarn install 11 | - run: yarn prisma generate 12 | - run: yarn build 13 | - run: yarn test 14 | 15 | workflows: 16 | build-and-test: 17 | jobs: 18 | - build-and-test 19 | -------------------------------------------------------------------------------- /.commitlintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"] 3 | } 4 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "./node_modules/cz-conventional-changelog" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true -------------------------------------------------------------------------------- /.env.test.example: -------------------------------------------------------------------------------- 1 | NODE_ENV=test 2 | SERVER_PORT=1778 3 | DB_CONNECTOR=postgres 4 | DB_HOST=postgres 5 | DB_USER=postgres 6 | DB_PASSWORD=postgres 7 | DB_DATABASE=nest_graphql_test 8 | DB_PORT=5432 9 | PGADMIN_DEFAULT_EMAIL=admin@admin.com 10 | PGADMIN_DEFAULT_PASSWORD=admin 11 | 12 | 13 | DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_DATABASE}?schema=public 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_module 2 | tsconfig.json 3 | test 4 | jest.config.js 5 | src/common/@generated 6 | @generated 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | project: 'tsconfig.json', 5 | tsconfigRootDir: __dirname, 6 | sourceType: 'module', 7 | }, 8 | plugins: [], 9 | extends: ['prettier', 'plugin:prettier/recommended'], 10 | root: true, 11 | env: { 12 | node: true, 13 | jest: true, 14 | }, 15 | ignorePatterns: ['.eslintrc.js', 'node_modules', 'test'], 16 | rules: { 17 | '@typescript-eslint/interface-name-prefix': 'off', 18 | '@typescript-eslint/explicit-function-return-type': 'off', 19 | '@typescript-eslint/explicit-module-boundary-types': 'off', 20 | '@typescript-eslint/no-explicit-any': 'off', 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | time: "04:00" 8 | open-pull-requests-limit: 10 9 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | 2 | pull_request_rules: 3 | - name: Automated merge for Renovate pull requests 4 | conditions: 5 | - author=renovate[bot] 6 | - status-success=build (14.x) 7 | - status-success=unit-tests (14.x) 8 | - status-success=lint (14.x) 9 | 10 | actions: 11 | merge: 12 | method: merge 13 | label: 14 | add: ["chore(deps):","🛠 Improvement"] 15 | 16 | - name: Automated dependabot merge 17 | conditions: 18 | - author~=^dependabot(|-preview)\[bot\]$ 19 | - status-success=build (14.x) 20 | - status-success=unit-tests (14.x) 21 | - status-success=lint (14.x) 22 | 23 | actions: 24 | merge: 25 | method: merge 26 | label: 27 | add: ["chore(deps):","🛠 Improvement"] 28 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v2 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | 26 | - name: Install dependencies 27 | run: yarn install 28 | - run: yarn prisma generate 29 | - run: yarn build 30 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | 9 | jobs: 10 | lint: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v2 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | 26 | - name: Install dependencies 27 | run: yarn install 28 | - run: yarn prisma generate 29 | - run: yarn lint 30 | 31 | -------------------------------------------------------------------------------- /.github/workflows/unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Unit tests 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | 9 | jobs: 10 | unit-tests: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v2 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | 26 | - name: Install dependencies 27 | run: yarn install 28 | - run: yarn prisma generate 29 | - run: yarn test 30 | 31 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | # yarn lint-staged -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | package-lock.json 3 | yarn.lock 4 | node_modules -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "none" 4 | } 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | nodejs: 4 | - 14 5 | 6 | branches: 7 | only: 8 | - master 9 | 10 | cache: 11 | directories: 12 | - "node_modules" 13 | yarn: true 14 | 15 | notification: 16 | email: false 17 | 18 | script: 19 | - yarn build 20 | - yarn test 21 | 22 | after_success: yarn coveralls 23 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "args":[ 12 | "${workspaceFolder}/src/main.ts" 13 | ], 14 | "runtimeArgs": [ 15 | "--nolazy", 16 | "-r", 17 | "ts-node/register", 18 | "-r", 19 | "tsconfig-paths/register" 20 | ], 21 | "sourceMaps": true, 22 | "envFile": "${workspaceFolder}/.env", 23 | "cwd": "${workspaceRoot}", 24 | "console": "integratedTerminal", 25 | "protocol": "inspector" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ponicode.testSettings.testLocation.locationType": "Same folder as source file", 3 | "ponicode.testSettings.testLocation.path": "{rootDir}/{filePath}/{fileName}.test.{ext}", 4 | "exportall.config.relExclusion": ["/src/providers/email"] 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Tien Duy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY package*.json yarn.lock ./ 6 | COPY prisma ./prisma/ 7 | 8 | RUN yarn install 9 | RUN yarn prisma generate 10 | 11 | COPY . ./ 12 | 13 | CMD ["yarn", "start:dev"] 14 | -------------------------------------------------------------------------------- /docker/Dockerfile.prod: -------------------------------------------------------------------------------- 1 | FROM node:lts-alpine 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY package*.json yarn.lock ./ 6 | COPY prisma ./prisma/ 7 | 8 | RUN yarn install 9 | RUN yarn prisma generate 10 | 11 | COPY . ./ 12 | 13 | CMD ["yarn", "start:prod"] 14 | -------------------------------------------------------------------------------- /docker/nginx/.env.nginx.example: -------------------------------------------------------------------------------- 1 | NGINX_SERVER_NAME=localhost 2 | NESTJS_HOST=nest 3 | NESTJS_PORT=8000 4 | NGINX_MAX_BODY=100M 5 | -------------------------------------------------------------------------------- /docker/nginx/Dockerfile.nginx: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | EXPOSE 80 4 | COPY nginx.conf /etc/nginx/conf.d/nginx.conf 5 | -------------------------------------------------------------------------------- /docker/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server{ 2 | listen *:80 | *:8000; 3 | server_name ${NGINX_SERVER_NAME}; 4 | client_max_body_size ${NGINX_MAX_BODY}; 5 | 6 | location / { 7 | proxy_pass http://${NESTJS_HOST}:${NESTJS_PORT}; 8 | proxy_set_header Host $host; 9 | proxy_set_header X-Real-IP $remote_addr; 10 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 11 | proxy_set_header X-Forwarded-Host $server_name; 12 | proxy_set_header X-Forwarded-Proto https; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/.gitkeep -------------------------------------------------------------------------------- /docs/img/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/img/logo1.png -------------------------------------------------------------------------------- /docs/img/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/img/logo2.png -------------------------------------------------------------------------------- /docs/img/pgadmin-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/img/pgadmin-2.png -------------------------------------------------------------------------------- /docs/img/pgadmin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/img/pgadmin.png -------------------------------------------------------------------------------- /docs/img/prisma-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/docs/img/prisma-studio.png -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | moduleFileExtensions: ['js', 'json', 'ts'], 4 | rootDir: 'src', 5 | testRegex: '.*\\.spec\\.ts$', 6 | transform: { 7 | '^.+\\.(t|j)s$': 'ts-jest', 8 | }, 9 | testEnvironment: 'node', 10 | moduleDirectories: ['node_modules', 'src'], 11 | moduleNameMapper: { 12 | '^src/(.*)$': '/$1', 13 | '^@common/(.*)$': '/common/$1', 14 | '^@modules/(.*)$': '/modules/$1', 15 | '^@app/(.*)$': '/app/$1', 16 | '^@providers/(.*)$': '/providers/$1', 17 | }, 18 | 19 | collectCoverageFrom: ['/modules/**/*.ts'], 20 | coverageDirectory: '../coverage', 21 | coveragePathIgnorePatterns: [ 22 | '/node_modules/', 23 | 'common', 24 | '/main.ts', 25 | 'index.ts', 26 | 'jestGlobalMocks.ts', 27 | '.interface.ts', 28 | '.module.ts', 29 | '.mock.ts', 30 | '.model.ts', 31 | '.entity.ts', 32 | '.dto.ts', 33 | '.input.ts', 34 | '.spec.ts', 35 | '.test.ts', 36 | '.decorator.ts', 37 | '.types.ts', 38 | ], 39 | }; 40 | -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection": "@nestjs/schematics", 3 | "sourceRoot": "src", 4 | "compilerOptions": { 5 | "plugins": ["@nestjs/swagger/plugin"], 6 | "assets": ["common/i18n/**/*"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | provider = "postgresql" -------------------------------------------------------------------------------- /src/@types/env.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace NodeJS { 2 | interface ProcessEnv { 3 | readonly NODE_ENV: 'development' | 'production' | 'test'; 4 | readonly PORT: string; 5 | readonly SERVER_URL: string; 6 | readonly CLIENT_URL: string; 7 | readonly SESSION_SECRET: string; 8 | readonly SENDGRID_API_KEY: string; 9 | readonly EMAIL_HOST: string; 10 | readonly EMAIL_PORT: string; 11 | readonly EMAIL_AUTH_USER: string; 12 | readonly EMAIL_AUTH_PASSWORD: string; 13 | readonly COOKIE_SECRET: string; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/@types/http.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace Express { 2 | interface Request { 3 | session?: { 4 | authToken?: { 5 | accessToken: string; 6 | refreshToken: string; 7 | }; 8 | res: Response; 9 | }; 10 | } 11 | // interface Session { 12 | // authToken?: { 13 | // accessToken: string; 14 | // refreshToken: string; 15 | // }; 16 | // } 17 | } 18 | -------------------------------------------------------------------------------- /src/app/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { LoggingInterceptor } from '@common/global-interceptors/logging.interceptor'; 2 | import { Controller, Get, UseInterceptors } from '@nestjs/common'; 3 | import { AppService } from './app.service'; 4 | 5 | @Controller() 6 | @UseInterceptors(LoggingInterceptor) 7 | export class AppController { 8 | constructor(private appService: AppService) {} 9 | @Get() 10 | public getHello() { 11 | return this.appService.getHello(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/app/app.resolver.ts: -------------------------------------------------------------------------------- 1 | import { Resolver, Query, Args } from '@nestjs/graphql'; 2 | 3 | @Resolver() 4 | export class AppResolver { 5 | @Query(() => String) 6 | helloWorld(): string { 7 | return 'Hello World!'; 8 | } 9 | @Query(() => String) 10 | hello(@Args('name') name: string): string { 11 | return `Hello ${name}!`; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/app/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | 3 | @Injectable() 4 | export class AppService { 5 | getHello(): string { 6 | return 'Hello World!'; 7 | } 8 | 9 | getHelloName(name: string): string { 10 | return `Hello ${name}!`; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/app/test/app.controller.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppController } from '@app/app.controller'; 2 | import { Test, TestingModule } from '@nestjs/testing'; 3 | import { AppService } from '../app.service'; 4 | 5 | describe('AppResolver', () => { 6 | let appController: AppController; 7 | 8 | beforeEach(async () => { 9 | const app: TestingModule = await Test.createTestingModule({ 10 | providers: [AppController, AppService] 11 | }).compile(); 12 | 13 | appController = app.get(AppController); 14 | }); 15 | 16 | it('Should be defined', () => { 17 | expect(appController).toBeDefined(); 18 | }); 19 | 20 | describe('helloWorld', () => { 21 | it('should return "Hello World!"', () => { 22 | expect(appController.getHello()).toBe('Hello World!'); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/test/app.resolver.spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { AppResolver } from '../app.resolver'; 3 | import { AppService } from '../app.service'; 4 | 5 | describe('AppResolver', () => { 6 | let appResolver: AppResolver; 7 | 8 | beforeEach(async () => { 9 | const app: TestingModule = await Test.createTestingModule({ 10 | providers: [AppResolver, AppService] 11 | }).compile(); 12 | 13 | appResolver = app.get(AppResolver); 14 | }); 15 | 16 | describe('helloWorld', () => { 17 | it('should return "Hello World!"', () => { 18 | expect(appResolver.helloWorld()).toBe('Hello World!'); 19 | }); 20 | }); 21 | describe('hello', () => { 22 | it('should return "Hello ${name}!"', () => { 23 | const name = 'any name'; 24 | expect(appResolver.hello(name)).toBe(`Hello ${name}!`); 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/test/app.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppService } from '@app/app.service'; 2 | import { Test, TestingModule } from '@nestjs/testing'; 3 | 4 | describe('AppService', () => { 5 | let appService: AppService; 6 | 7 | beforeAll(async () => { 8 | const module: TestingModule = await Test.createTestingModule({ 9 | providers: [AppService] 10 | }).compile(); 11 | 12 | appService = module.get(AppService); 13 | }); 14 | describe('getHello', () => { 15 | it('Should return `Hello World!`', () => { 16 | expect(appService.getHello()).toEqual('Hello World!'); 17 | }); 18 | }); 19 | 20 | describe('getHelloName', () => { 21 | it('Should return Hello ${name}!', () => { 22 | expect(appService.getHelloName('some name')).toEqual('Hello some name!'); 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/common/@generated/category/aggregate-category.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { CategoryCountAggregate } from './category-count-aggregate.output'; 3 | import { CategoryMaxAggregate } from './category-max-aggregate.output'; 4 | import { CategoryMinAggregate } from './category-min-aggregate.output'; 5 | 6 | @ObjectType() 7 | export class AggregateCategory { 8 | @Field(() => CategoryCountAggregate, { 9 | nullable: true 10 | }) 11 | count?: CategoryCountAggregate; 12 | 13 | @Field(() => CategoryMinAggregate, { 14 | nullable: true 15 | }) 16 | min?: CategoryMinAggregate; 17 | 18 | @Field(() => CategoryMaxAggregate, { 19 | nullable: true 20 | }) 21 | max?: CategoryMaxAggregate; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-count-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryCountAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | name?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | createdAt?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | updatedAt?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | _all?: true; 34 | } 35 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-count-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class CategoryCountAggregate { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | id!: number; 9 | 10 | @Field(() => Int, { 11 | nullable: false 12 | }) 13 | name!: number; 14 | 15 | @Field(() => Int, { 16 | nullable: false 17 | }) 18 | slug!: number; 19 | 20 | @Field(() => Int, { 21 | nullable: false 22 | }) 23 | createdAt!: number; 24 | 25 | @Field(() => Int, { 26 | nullable: false 27 | }) 28 | updatedAt!: number; 29 | 30 | @Field(() => Int, { 31 | nullable: false 32 | }) 33 | _all!: number; 34 | } 35 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create-many-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateOrConnectWithoutPostsInput } from './category-create-or-connect-without-posts.input'; 3 | import { CategoryCreateWithoutPostsInput } from './category-create-without-posts.input'; 4 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 5 | 6 | @InputType() 7 | export class CategoryCreateManyWithoutPostsInput { 8 | @Field(() => [CategoryCreateWithoutPostsInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [CategoryCreateOrConnectWithoutPostsInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [CategoryWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryCreateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | name!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create-or-connect-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateWithoutPostsInput } from './category-create-without-posts.input'; 3 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 4 | 5 | @InputType() 6 | export class CategoryCreateOrConnectWithoutPostsInput { 7 | @Field(() => CategoryWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: CategoryWhereUniqueInput; 11 | 12 | @Field(() => CategoryCreateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | create!: CategoryCreateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create-or-connect-withoutposts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateWithoutPostsInput } from './category-create-without-posts.input'; 3 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 4 | 5 | @InputType() 6 | export class CategoryCreateOrConnectWithoutpostsInput { 7 | @Field(() => CategoryWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: CategoryWhereUniqueInput; 11 | 12 | @Field(() => CategoryCreateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | create!: CategoryCreateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryCreateWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | name!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-create.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateManyWithoutCategoriesInput } from '../post/post-create-many-without-categories.input'; 3 | 4 | @InputType() 5 | export class CategoryCreateInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | name!: string; 15 | 16 | @Field(() => String, { 17 | nullable: false 18 | }) 19 | slug!: string; 20 | 21 | @Field(() => Date, { 22 | nullable: true 23 | }) 24 | createdAt?: Date | string; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | updatedAt?: Date | string; 30 | 31 | @Field(() => PostCreateManyWithoutCategoriesInput, { 32 | nullable: true 33 | }) 34 | posts?: PostCreateManyWithoutCategoriesInput; 35 | } 36 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-group-by.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { CategoryCountAggregate } from './category-count-aggregate.output'; 3 | import { CategoryMaxAggregate } from './category-max-aggregate.output'; 4 | import { CategoryMinAggregate } from './category-min-aggregate.output'; 5 | 6 | @ObjectType() 7 | export class CategoryGroupBy { 8 | @Field(() => String, { 9 | nullable: false 10 | }) 11 | id!: string; 12 | 13 | @Field(() => String, { 14 | nullable: false 15 | }) 16 | name!: string; 17 | 18 | @Field(() => String, { 19 | nullable: false 20 | }) 21 | slug!: string; 22 | 23 | @Field(() => Date, { 24 | nullable: false 25 | }) 26 | createdAt!: Date | string; 27 | 28 | @Field(() => Date, { 29 | nullable: false 30 | }) 31 | updatedAt!: Date | string; 32 | 33 | @Field(() => CategoryCountAggregate, { 34 | nullable: true 35 | }) 36 | count?: CategoryCountAggregate; 37 | 38 | @Field(() => CategoryMinAggregate, { 39 | nullable: true 40 | }) 41 | min?: CategoryMinAggregate; 42 | 43 | @Field(() => CategoryMaxAggregate, { 44 | nullable: true 45 | }) 46 | max?: CategoryMaxAggregate; 47 | } 48 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-list-relation-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryWhereInput } from './category-where.input'; 3 | 4 | @InputType() 5 | export class CategoryListRelationFilter { 6 | @Field(() => CategoryWhereInput, { 7 | nullable: true 8 | }) 9 | every?: CategoryWhereInput; 10 | 11 | @Field(() => CategoryWhereInput, { 12 | nullable: true 13 | }) 14 | some?: CategoryWhereInput; 15 | 16 | @Field(() => CategoryWhereInput, { 17 | nullable: true 18 | }) 19 | none?: CategoryWhereInput; 20 | } 21 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-max-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryMaxAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | name?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | createdAt?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | updatedAt?: true; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-max-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class CategoryMaxAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-min-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryMinAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | name?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | createdAt?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | updatedAt?: true; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-min-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class CategoryMinAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-order-by.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { SortOrder } from '../prisma/sort-order.enum'; 3 | 4 | @InputType() 5 | export class CategoryOrderByInput { 6 | @Field(() => SortOrder, { 7 | nullable: true 8 | }) 9 | id?: SortOrder; 10 | 11 | @Field(() => SortOrder, { 12 | nullable: true 13 | }) 14 | name?: SortOrder; 15 | 16 | @Field(() => SortOrder, { 17 | nullable: true 18 | }) 19 | slug?: SortOrder; 20 | 21 | @Field(() => SortOrder, { 22 | nullable: true 23 | }) 24 | createdAt?: SortOrder; 25 | 26 | @Field(() => SortOrder, { 27 | nullable: true 28 | }) 29 | updatedAt?: SortOrder; 30 | } 31 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-scalar-field.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum CategoryScalarFieldEnum { 4 | id = 'id', 5 | name = 'name', 6 | slug = 'slug', 7 | createdAt = 'createdAt', 8 | updatedAt = 'updatedAt' 9 | } 10 | 11 | registerEnumType(CategoryScalarFieldEnum, { name: 'CategoryScalarFieldEnum' }); 12 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-scalar-where.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { DateTimeFilter } from '../prisma/date-time-filter.input'; 3 | import { StringFilter } from '../prisma/string-filter.input'; 4 | 5 | @InputType() 6 | export class CategoryScalarWhereInput { 7 | @Field(() => [CategoryScalarWhereInput], { 8 | nullable: true 9 | }) 10 | AND?: Array; 11 | 12 | @Field(() => [CategoryScalarWhereInput], { 13 | nullable: true 14 | }) 15 | OR?: Array; 16 | 17 | @Field(() => [CategoryScalarWhereInput], { 18 | nullable: true 19 | }) 20 | NOT?: Array; 21 | 22 | @Field(() => StringFilter, { 23 | nullable: true 24 | }) 25 | id?: StringFilter; 26 | 27 | @Field(() => StringFilter, { 28 | nullable: true 29 | }) 30 | name?: StringFilter; 31 | 32 | @Field(() => StringFilter, { 33 | nullable: true 34 | }) 35 | slug?: StringFilter; 36 | 37 | @Field(() => DateTimeFilter, { 38 | nullable: true 39 | }) 40 | createdAt?: DateTimeFilter; 41 | 42 | @Field(() => DateTimeFilter, { 43 | nullable: true 44 | }) 45 | updatedAt?: DateTimeFilter; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-create-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedCreateWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | name!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-create.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedCreateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | name!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-update-many-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedUpdateManyWithoutCategoriesInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-update-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedUpdateWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-unchecked-update.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUncheckedUpdateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-many-mutation.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUpdateManyMutationInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-many-with-where-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryScalarWhereInput } from './category-scalar-where.input'; 3 | import { CategoryUpdateManyMutationInput } from './category-update-many-mutation.input'; 4 | 5 | @InputType() 6 | export class CategoryUpdateManyWithWhereWithoutPostsInput { 7 | @Field(() => CategoryScalarWhereInput, { 8 | nullable: false 9 | }) 10 | where!: CategoryScalarWhereInput; 11 | 12 | @Field(() => CategoryUpdateManyMutationInput, { 13 | nullable: false 14 | }) 15 | data!: CategoryUpdateManyMutationInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-many-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUpdateManyWithoutCategoriesInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-with-where-unique-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryUpdateWithoutPostsInput } from './category-update-without-posts.input'; 3 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 4 | 5 | @InputType() 6 | export class CategoryUpdateWithWhereUniqueWithoutPostsInput { 7 | @Field(() => CategoryWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: CategoryWhereUniqueInput; 11 | 12 | @Field(() => CategoryUpdateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | data!: CategoryUpdateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryUpdateWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | name?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | createdAt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | updatedAt?: Date | string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-update.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostUpdateManyWithoutCategoriesInput } from '../post/post-update-many-without-categories.input'; 3 | 4 | @InputType() 5 | export class CategoryUpdateInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | name?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | slug?: string; 20 | 21 | @Field(() => Date, { 22 | nullable: true 23 | }) 24 | createdAt?: Date | string; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | updatedAt?: Date | string; 30 | 31 | @Field(() => PostUpdateManyWithoutCategoriesInput, { 32 | nullable: true 33 | }) 34 | posts?: PostUpdateManyWithoutCategoriesInput; 35 | } 36 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-upsert-with-where-unique-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateWithoutPostsInput } from './category-create-without-posts.input'; 3 | import { CategoryUpdateWithoutPostsInput } from './category-update-without-posts.input'; 4 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 5 | 6 | @InputType() 7 | export class CategoryUpsertWithWhereUniqueWithoutPostsInput { 8 | @Field(() => CategoryWhereUniqueInput, { 9 | nullable: false 10 | }) 11 | where!: CategoryWhereUniqueInput; 12 | 13 | @Field(() => CategoryUpdateWithoutPostsInput, { 14 | nullable: false 15 | }) 16 | update!: CategoryUpdateWithoutPostsInput; 17 | 18 | @Field(() => CategoryCreateWithoutPostsInput, { 19 | nullable: false 20 | }) 21 | create!: CategoryCreateWithoutPostsInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/category/category-where-unique.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class CategoryWhereUniqueInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | slug?: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/common/@generated/category/category.model.ts: -------------------------------------------------------------------------------- 1 | import { Field, ID, ObjectType } from '@nestjs/graphql'; 2 | import { Post } from '../post/post.model'; 3 | 4 | @ObjectType() 5 | export class Category { 6 | @Field(() => ID, { 7 | nullable: false 8 | }) 9 | id!: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | name!: string; 15 | 16 | @Field(() => String, { 17 | nullable: false 18 | }) 19 | slug!: string; 20 | 21 | @Field(() => Date, { 22 | nullable: false 23 | }) 24 | createdAt!: Date | string; 25 | 26 | @Field(() => Date, { 27 | nullable: false 28 | }) 29 | updatedAt!: Date | string; 30 | 31 | @Field(() => [Post], { 32 | nullable: false 33 | }) 34 | posts!: Array; 35 | } 36 | -------------------------------------------------------------------------------- /src/common/@generated/category/find-first-category.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { CategoryOrderByInput } from './category-order-by.input'; 3 | import { CategoryScalarFieldEnum } from './category-scalar-field.enum'; 4 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 5 | import { CategoryWhereInput } from './category-where.input'; 6 | 7 | @ArgsType() 8 | export class FindFirstCategoryArgs { 9 | @Field(() => CategoryWhereInput, { 10 | nullable: true 11 | }) 12 | where?: CategoryWhereInput; 13 | 14 | @Field(() => [CategoryOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => CategoryWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: CategoryWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [CategoryScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/category/find-many-category.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { CategoryOrderByInput } from './category-order-by.input'; 3 | import { CategoryScalarFieldEnum } from './category-scalar-field.enum'; 4 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 5 | import { CategoryWhereInput } from './category-where.input'; 6 | 7 | @ArgsType() 8 | export class FindManyCategoryArgs { 9 | @Field(() => CategoryWhereInput, { 10 | nullable: true 11 | }) 12 | where?: CategoryWhereInput; 13 | 14 | @Field(() => [CategoryOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => CategoryWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: CategoryWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [CategoryScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/category/find-one-category.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindOneCategoryArgs { 6 | @Field(() => CategoryWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: CategoryWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/category/find-unique-category.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { CategoryWhereUniqueInput } from './category-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindUniqueCategoryArgs { 6 | @Field(() => CategoryWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: CategoryWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/post/aggregate-post.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { PostCountAggregate } from './post-count-aggregate.output'; 3 | import { PostMaxAggregate } from './post-max-aggregate.output'; 4 | import { PostMinAggregate } from './post-min-aggregate.output'; 5 | 6 | @ObjectType() 7 | export class AggregatePost { 8 | @Field(() => PostCountAggregate, { 9 | nullable: true 10 | }) 11 | count?: PostCountAggregate; 12 | 13 | @Field(() => PostMinAggregate, { 14 | nullable: true 15 | }) 16 | min?: PostMinAggregate; 17 | 18 | @Field(() => PostMaxAggregate, { 19 | nullable: true 20 | }) 21 | max?: PostMaxAggregate; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/find-first-post.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { PostOrderByInput } from './post-order-by.input'; 3 | import { PostScalarFieldEnum } from './post-scalar-field.enum'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | import { PostWhereInput } from './post-where.input'; 6 | 7 | @ArgsType() 8 | export class FindFirstPostArgs { 9 | @Field(() => PostWhereInput, { 10 | nullable: true 11 | }) 12 | where?: PostWhereInput; 13 | 14 | @Field(() => [PostOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => PostWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: PostWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [PostScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/post/find-many-post.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { PostOrderByInput } from './post-order-by.input'; 3 | import { PostScalarFieldEnum } from './post-scalar-field.enum'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | import { PostWhereInput } from './post-where.input'; 6 | 7 | @ArgsType() 8 | export class FindManyPostArgs { 9 | @Field(() => PostWhereInput, { 10 | nullable: true 11 | }) 12 | where?: PostWhereInput; 13 | 14 | @Field(() => [PostOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => PostWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: PostWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [PostScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/post/find-one-post.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { PostWhereUniqueInput } from './post-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindOnePostArgs { 6 | @Field(() => PostWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: PostWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/post/find-unique-post.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { PostWhereUniqueInput } from './post-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindUniquePostArgs { 6 | @Field(() => PostWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: PostWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-count-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostCountAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | title?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | content?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | authorId?: true; 44 | 45 | @Field(() => Boolean, { 46 | nullable: true 47 | }) 48 | _all?: true; 49 | } 50 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-count-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class PostCountAggregate { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | id!: number; 9 | 10 | @Field(() => Int, { 11 | nullable: false 12 | }) 13 | title!: number; 14 | 15 | @Field(() => Int, { 16 | nullable: false 17 | }) 18 | slug!: number; 19 | 20 | @Field(() => Int, { 21 | nullable: false 22 | }) 23 | content!: number; 24 | 25 | @Field(() => Int, { 26 | nullable: false 27 | }) 28 | published!: number; 29 | 30 | @Field(() => Int, { 31 | nullable: false 32 | }) 33 | createdAt!: number; 34 | 35 | @Field(() => Int, { 36 | nullable: false 37 | }) 38 | updatedAt!: number; 39 | 40 | @Field(() => Int, { 41 | nullable: false 42 | }) 43 | authorId!: number; 44 | 45 | @Field(() => Int, { 46 | nullable: false 47 | }) 48 | _all!: number; 49 | } 50 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-many-author-envelope.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateManyAuthorInput } from './post-create-many-author.input'; 3 | 4 | @InputType() 5 | export class PostCreateManyAuthorEnvelopeInput { 6 | @Field(() => [PostCreateManyAuthorInput], { 7 | nullable: false 8 | }) 9 | data!: Array; 10 | 11 | @Field(() => Boolean, { 12 | nullable: true 13 | }) 14 | skipDuplicates?: boolean; 15 | } 16 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-many-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostCreateManyAuthorInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | title!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => String, { 21 | nullable: false 22 | }) 23 | content!: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-many-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateManyAuthorEnvelopeInput } from './post-create-many-author-envelope.input'; 3 | import { PostCreateOrConnectWithoutAuthorInput } from './post-create-or-connect-without-author.input'; 4 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 5 | import { PostWhereUniqueInput } from './post-where-unique.input'; 6 | 7 | @InputType() 8 | export class PostCreateManyWithoutAuthorInput { 9 | @Field(() => [PostCreateWithoutAuthorInput], { 10 | nullable: true 11 | }) 12 | create?: Array; 13 | 14 | @Field(() => [PostCreateOrConnectWithoutAuthorInput], { 15 | nullable: true 16 | }) 17 | connectOrCreate?: Array; 18 | 19 | @Field(() => PostCreateManyAuthorEnvelopeInput, { 20 | nullable: true 21 | }) 22 | createMany?: PostCreateManyAuthorEnvelopeInput; 23 | 24 | @Field(() => [PostWhereUniqueInput], { 25 | nullable: true 26 | }) 27 | connect?: Array; 28 | } 29 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-many-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateOrConnectWithoutCategoriesInput } from './post-create-or-connect-without-categories.input'; 3 | import { PostCreateWithoutCategoriesInput } from './post-create-without-categories.input'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostCreateManyWithoutCategoriesInput { 8 | @Field(() => [PostCreateWithoutCategoriesInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [PostCreateOrConnectWithoutCategoriesInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [PostWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostCreateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | title!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => String, { 21 | nullable: false 22 | }) 23 | content!: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-or-connect-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostCreateOrConnectWithoutAuthorInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostCreateWithoutAuthorInput, { 13 | nullable: false 14 | }) 15 | create!: PostCreateWithoutAuthorInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-or-connect-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutCategoriesInput } from './post-create-without-categories.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostCreateOrConnectWithoutCategoriesInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostCreateWithoutCategoriesInput, { 13 | nullable: false 14 | }) 15 | create!: PostCreateWithoutCategoriesInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-or-connect-withoutauthor.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostCreateOrConnectWithoutauthorInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostCreateWithoutAuthorInput, { 13 | nullable: false 14 | }) 15 | create!: PostCreateWithoutAuthorInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-or-connect-withoutcategories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutCategoriesInput } from './post-create-without-categories.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostCreateOrConnectWithoutcategoriesInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostCreateWithoutCategoriesInput, { 13 | nullable: false 14 | }) 15 | create!: PostCreateWithoutCategoriesInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateManyWithoutPostsInput } from '../category/category-create-many-without-posts.input'; 3 | 4 | @InputType() 5 | export class PostCreateWithoutAuthorInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | title!: string; 15 | 16 | @Field(() => String, { 17 | nullable: false 18 | }) 19 | slug!: string; 20 | 21 | @Field(() => String, { 22 | nullable: false 23 | }) 24 | content!: string; 25 | 26 | @Field(() => Boolean, { 27 | nullable: true 28 | }) 29 | published?: boolean; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => CategoryCreateManyWithoutPostsInput, { 42 | nullable: true 43 | }) 44 | categories?: CategoryCreateManyWithoutPostsInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-create-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOneWithoutPostsInput } from '../user/user-create-one-without-posts.input'; 3 | 4 | @InputType() 5 | export class PostCreateWithoutCategoriesInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | title!: string; 15 | 16 | @Field(() => String, { 17 | nullable: false 18 | }) 19 | slug!: string; 20 | 21 | @Field(() => String, { 22 | nullable: false 23 | }) 24 | content!: string; 25 | 26 | @Field(() => Boolean, { 27 | nullable: true 28 | }) 29 | published?: boolean; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => UserCreateOneWithoutPostsInput, { 42 | nullable: true 43 | }) 44 | author?: UserCreateOneWithoutPostsInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-list-relation-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostWhereInput } from './post-where.input'; 3 | 4 | @InputType() 5 | export class PostListRelationFilter { 6 | @Field(() => PostWhereInput, { 7 | nullable: true 8 | }) 9 | every?: PostWhereInput; 10 | 11 | @Field(() => PostWhereInput, { 12 | nullable: true 13 | }) 14 | some?: PostWhereInput; 15 | 16 | @Field(() => PostWhereInput, { 17 | nullable: true 18 | }) 19 | none?: PostWhereInput; 20 | } 21 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-max-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostMaxAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | title?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | content?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | authorId?: true; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-max-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class PostMaxAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-min-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostMinAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | title?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | slug?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | content?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | authorId?: true; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-min-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class PostMinAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-order-by.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { SortOrder } from '../prisma/sort-order.enum'; 3 | 4 | @InputType() 5 | export class PostOrderByInput { 6 | @Field(() => SortOrder, { 7 | nullable: true 8 | }) 9 | id?: SortOrder; 10 | 11 | @Field(() => SortOrder, { 12 | nullable: true 13 | }) 14 | title?: SortOrder; 15 | 16 | @Field(() => SortOrder, { 17 | nullable: true 18 | }) 19 | slug?: SortOrder; 20 | 21 | @Field(() => SortOrder, { 22 | nullable: true 23 | }) 24 | content?: SortOrder; 25 | 26 | @Field(() => SortOrder, { 27 | nullable: true 28 | }) 29 | published?: SortOrder; 30 | 31 | @Field(() => SortOrder, { 32 | nullable: true 33 | }) 34 | createdAt?: SortOrder; 35 | 36 | @Field(() => SortOrder, { 37 | nullable: true 38 | }) 39 | updatedAt?: SortOrder; 40 | 41 | @Field(() => SortOrder, { 42 | nullable: true 43 | }) 44 | authorId?: SortOrder; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-scalar-field.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum PostScalarFieldEnum { 4 | id = 'id', 5 | title = 'title', 6 | slug = 'slug', 7 | content = 'content', 8 | published = 'published', 9 | createdAt = 'createdAt', 10 | updatedAt = 'updatedAt', 11 | authorId = 'authorId' 12 | } 13 | 14 | registerEnumType(PostScalarFieldEnum, { name: 'PostScalarFieldEnum' }); 15 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-create-many-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateOrConnectWithoutauthorInput } from './post-create-or-connect-withoutauthor.input'; 3 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostUncheckedCreateManyWithoutAuthorInput { 8 | @Field(() => [PostCreateWithoutAuthorInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [PostWhereUniqueInput], { 14 | nullable: true 15 | }) 16 | connect?: Array; 17 | 18 | @Field(() => [PostCreateOrConnectWithoutauthorInput], { 19 | nullable: true 20 | }) 21 | connectOrCreate?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-create-nested-many-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateOrConnectWithoutauthorInput } from './post-create-or-connect-withoutauthor.input'; 3 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostUncheckedCreateNestedManyWithoutAuthorInput { 8 | @Field(() => [PostCreateWithoutAuthorInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [PostCreateOrConnectWithoutauthorInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [PostWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-create-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedCreateWithoutAuthorInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | title!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => String, { 21 | nullable: false 22 | }) 23 | content!: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-create-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedCreateWithoutCategoriesInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | title!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => String, { 21 | nullable: false 22 | }) 23 | content!: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-create.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedCreateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | title!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | slug!: string; 19 | 20 | @Field(() => String, { 21 | nullable: false 22 | }) 23 | content!: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-update-many-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedUpdateManyWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-update-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedUpdateWithoutAuthorInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-update-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedUpdateWithoutCategoriesInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-unchecked-update.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUncheckedUpdateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-many-mutation.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUpdateManyMutationInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-many-with-where-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostScalarWhereInput } from './post-scalar-where.input'; 3 | import { PostUpdateManyMutationInput } from './post-update-many-mutation.input'; 4 | 5 | @InputType() 6 | export class PostUpdateManyWithWhereWithoutAuthorInput { 7 | @Field(() => PostScalarWhereInput, { 8 | nullable: false 9 | }) 10 | where!: PostScalarWhereInput; 11 | 12 | @Field(() => PostUpdateManyMutationInput, { 13 | nullable: false 14 | }) 15 | data!: PostUpdateManyMutationInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-many-with-where-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostScalarWhereInput } from './post-scalar-where.input'; 3 | import { PostUpdateManyMutationInput } from './post-update-many-mutation.input'; 4 | 5 | @InputType() 6 | export class PostUpdateManyWithWhereWithoutCategoriesInput { 7 | @Field(() => PostScalarWhereInput, { 8 | nullable: false 9 | }) 10 | where!: PostScalarWhereInput; 11 | 12 | @Field(() => PostUpdateManyMutationInput, { 13 | nullable: false 14 | }) 15 | data!: PostUpdateManyMutationInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-many-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUpdateManyWithoutPostsInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | title?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | slug?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | content?: string; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | published?: boolean; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | authorId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-with-where-unique-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostUpdateWithoutAuthorInput } from './post-update-without-author.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostUpdateWithWhereUniqueWithoutAuthorInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostUpdateWithoutAuthorInput, { 13 | nullable: false 14 | }) 15 | data!: PostUpdateWithoutAuthorInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-with-where-unique-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostUpdateWithoutCategoriesInput } from './post-update-without-categories.input'; 3 | import { PostWhereUniqueInput } from './post-where-unique.input'; 4 | 5 | @InputType() 6 | export class PostUpdateWithWhereUniqueWithoutCategoriesInput { 7 | @Field(() => PostWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: PostWhereUniqueInput; 11 | 12 | @Field(() => PostUpdateWithoutCategoriesInput, { 13 | nullable: false 14 | }) 15 | data!: PostUpdateWithoutCategoriesInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryUpdateManyWithoutPostsInput } from '../category/category-update-many-without-posts.input'; 3 | 4 | @InputType() 5 | export class PostUpdateWithoutAuthorInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | title?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | slug?: string; 20 | 21 | @Field(() => String, { 22 | nullable: true 23 | }) 24 | content?: string; 25 | 26 | @Field(() => Boolean, { 27 | nullable: true 28 | }) 29 | published?: boolean; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => CategoryUpdateManyWithoutPostsInput, { 42 | nullable: true 43 | }) 44 | categories?: CategoryUpdateManyWithoutPostsInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-update-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserUpdateOneWithoutPostsInput } from '../user/user-update-one-without-posts.input'; 3 | 4 | @InputType() 5 | export class PostUpdateWithoutCategoriesInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | title?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | slug?: string; 20 | 21 | @Field(() => String, { 22 | nullable: true 23 | }) 24 | content?: string; 25 | 26 | @Field(() => Boolean, { 27 | nullable: true 28 | }) 29 | published?: boolean; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => UserUpdateOneWithoutPostsInput, { 42 | nullable: true 43 | }) 44 | author?: UserUpdateOneWithoutPostsInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-upsert-with-where-unique-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutAuthorInput } from './post-create-without-author.input'; 3 | import { PostUpdateWithoutAuthorInput } from './post-update-without-author.input'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostUpsertWithWhereUniqueWithoutAuthorInput { 8 | @Field(() => PostWhereUniqueInput, { 9 | nullable: false 10 | }) 11 | where!: PostWhereUniqueInput; 12 | 13 | @Field(() => PostUpdateWithoutAuthorInput, { 14 | nullable: false 15 | }) 16 | update!: PostUpdateWithoutAuthorInput; 17 | 18 | @Field(() => PostCreateWithoutAuthorInput, { 19 | nullable: false 20 | }) 21 | create!: PostCreateWithoutAuthorInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-upsert-with-where-unique-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateWithoutCategoriesInput } from './post-create-without-categories.input'; 3 | import { PostUpdateWithoutCategoriesInput } from './post-update-without-categories.input'; 4 | import { PostWhereUniqueInput } from './post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostUpsertWithWhereUniqueWithoutCategoriesInput { 8 | @Field(() => PostWhereUniqueInput, { 9 | nullable: false 10 | }) 11 | where!: PostWhereUniqueInput; 12 | 13 | @Field(() => PostUpdateWithoutCategoriesInput, { 14 | nullable: false 15 | }) 16 | update!: PostUpdateWithoutCategoriesInput; 17 | 18 | @Field(() => PostCreateWithoutCategoriesInput, { 19 | nullable: false 20 | }) 21 | create!: PostCreateWithoutCategoriesInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/post/post-where-unique.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class PostWhereUniqueInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | slug?: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/affected-rows-output.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class AffectedRowsOutput { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | count!: number; 9 | } 10 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/affected-rows.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class AffectedRows { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | count!: number; 9 | } 10 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/batch-payload.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class BatchPayload { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | count!: number; 9 | } 10 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/bool-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { BooleanFilter } from './boolean-filter.input'; 3 | 4 | @InputType() 5 | export class BoolFilter { 6 | @Field(() => Boolean, { 7 | nullable: true 8 | }) 9 | equals?: boolean; 10 | 11 | @Field(() => BooleanFilter, { 12 | nullable: true 13 | }) 14 | not?: BooleanFilter; 15 | } 16 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/bool-with-aggregates-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { BooleanFilter } from './boolean-filter.input'; 3 | import { BooleanWithAggregatesFilter } from './boolean-with-aggregates-filter.input'; 4 | import { IntFilter } from './int-filter.input'; 5 | 6 | @InputType() 7 | export class BoolWithAggregatesFilter { 8 | @Field(() => Boolean, { 9 | nullable: true 10 | }) 11 | equals?: boolean; 12 | 13 | @Field(() => BooleanWithAggregatesFilter, { 14 | nullable: true 15 | }) 16 | not?: BooleanWithAggregatesFilter; 17 | 18 | @Field(() => IntFilter, { 19 | nullable: true 20 | }) 21 | count?: IntFilter; 22 | 23 | @Field(() => BooleanFilter, { 24 | nullable: true 25 | }) 26 | min?: BooleanFilter; 27 | 28 | @Field(() => BooleanFilter, { 29 | nullable: true 30 | }) 31 | max?: BooleanFilter; 32 | } 33 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/boolean-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class BooleanFilter { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | equals?: boolean; 9 | 10 | @Field(() => BooleanFilter, { 11 | nullable: true 12 | }) 13 | not?: BooleanFilter; 14 | } 15 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/boolean-with-aggregates-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { BooleanFilter } from './boolean-filter.input'; 3 | import { IntFilter } from './int-filter.input'; 4 | 5 | @InputType() 6 | export class BooleanWithAggregatesFilter { 7 | @Field(() => Boolean, { 8 | nullable: true 9 | }) 10 | equals?: boolean; 11 | 12 | @Field(() => BooleanWithAggregatesFilter, { 13 | nullable: true 14 | }) 15 | not?: BooleanWithAggregatesFilter; 16 | 17 | @Field(() => IntFilter, { 18 | nullable: true 19 | }) 20 | count?: IntFilter; 21 | 22 | @Field(() => BooleanFilter, { 23 | nullable: true 24 | }) 25 | min?: BooleanFilter; 26 | 27 | @Field(() => BooleanFilter, { 28 | nullable: true 29 | }) 30 | max?: BooleanFilter; 31 | } 32 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/category-create-nested-many-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { CategoryCreateOrConnectWithoutpostsInput } from '../category/category-create-or-connect-withoutposts.input'; 3 | import { CategoryCreateWithoutPostsInput } from '../category/category-create-without-posts.input'; 4 | import { CategoryWhereUniqueInput } from '../category/category-where-unique.input'; 5 | 6 | @InputType() 7 | export class CategoryCreateNestedManyWithoutPostsInput { 8 | @Field(() => [CategoryCreateWithoutPostsInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [CategoryCreateOrConnectWithoutpostsInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [CategoryWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/date-time-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class DateTimeFilter { 5 | @Field(() => Date, { 6 | nullable: true 7 | }) 8 | equals?: Date | string; 9 | 10 | @Field(() => [Date], { 11 | nullable: true 12 | }) 13 | in?: Array | Array; 14 | 15 | @Field(() => [Date], { 16 | nullable: true 17 | }) 18 | notIn?: Array | Array; 19 | 20 | @Field(() => Date, { 21 | nullable: true 22 | }) 23 | lt?: Date | string; 24 | 25 | @Field(() => Date, { 26 | nullable: true 27 | }) 28 | lte?: Date | string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | gt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | gte?: Date | string; 39 | 40 | @Field(() => DateTimeFilter, { 41 | nullable: true 42 | }) 43 | not?: DateTimeFilter; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/enum-role-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from './role.enum'; 3 | 4 | @InputType() 5 | export class EnumRoleFilter { 6 | @Field(() => Role, { 7 | nullable: true 8 | }) 9 | equals?: Role; 10 | 11 | @Field(() => [Role], { 12 | nullable: true 13 | }) 14 | in?: Array; 15 | 16 | @Field(() => [Role], { 17 | nullable: true 18 | }) 19 | notIn?: Array; 20 | 21 | @Field(() => EnumRoleFilter, { 22 | nullable: true 23 | }) 24 | not?: EnumRoleFilter; 25 | } 26 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/enum-role-with-aggregates-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { EnumRoleFilter } from './enum-role-filter.input'; 3 | import { IntFilter } from './int-filter.input'; 4 | import { Role } from './role.enum'; 5 | 6 | @InputType() 7 | export class EnumRoleWithAggregatesFilter { 8 | @Field(() => Role, { 9 | nullable: true 10 | }) 11 | equals?: Role; 12 | 13 | @Field(() => [Role], { 14 | nullable: true 15 | }) 16 | in?: Array; 17 | 18 | @Field(() => [Role], { 19 | nullable: true 20 | }) 21 | notIn?: Array; 22 | 23 | @Field(() => EnumRoleWithAggregatesFilter, { 24 | nullable: true 25 | }) 26 | not?: EnumRoleWithAggregatesFilter; 27 | 28 | @Field(() => IntFilter, { 29 | nullable: true 30 | }) 31 | count?: IntFilter; 32 | 33 | @Field(() => EnumRoleFilter, { 34 | nullable: true 35 | }) 36 | min?: EnumRoleFilter; 37 | 38 | @Field(() => EnumRoleFilter, { 39 | nullable: true 40 | }) 41 | max?: EnumRoleFilter; 42 | } 43 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/index.ts: -------------------------------------------------------------------------------- 1 | export * from './batch-payload.output'; 2 | export * from './bool-filter.input'; 3 | export * from './boolean-filter.input'; 4 | export * from './date-time-filter.input'; 5 | export * from './enum-role-filter.input'; 6 | export * from './query-mode.enum'; 7 | export * from './role.enum'; 8 | export * from './sort-order.enum'; 9 | export * from './string-filter.input'; 10 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/int-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType, Int } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class IntFilter { 5 | @Field(() => Int, { 6 | nullable: true 7 | }) 8 | equals?: number; 9 | 10 | @Field(() => [Int], { 11 | nullable: true 12 | }) 13 | in?: Array; 14 | 15 | @Field(() => [Int], { 16 | nullable: true 17 | }) 18 | notIn?: Array; 19 | 20 | @Field(() => Int, { 21 | nullable: true 22 | }) 23 | lt?: number; 24 | 25 | @Field(() => Int, { 26 | nullable: true 27 | }) 28 | lte?: number; 29 | 30 | @Field(() => Int, { 31 | nullable: true 32 | }) 33 | gt?: number; 34 | 35 | @Field(() => Int, { 36 | nullable: true 37 | }) 38 | gte?: number; 39 | 40 | @Field(() => IntFilter, { 41 | nullable: true 42 | }) 43 | not?: IntFilter; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/post-create-nested-many-without-author.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateOrConnectWithoutauthorInput } from '../post/post-create-or-connect-withoutauthor.input'; 3 | import { PostCreateWithoutAuthorInput } from '../post/post-create-without-author.input'; 4 | import { PostWhereUniqueInput } from '../post/post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostCreateNestedManyWithoutAuthorInput { 8 | @Field(() => [PostCreateWithoutAuthorInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [PostCreateOrConnectWithoutauthorInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [PostWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/post-create-nested-many-without-categories.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateOrConnectWithoutcategoriesInput } from '../post/post-create-or-connect-withoutcategories.input'; 3 | import { PostCreateWithoutCategoriesInput } from '../post/post-create-without-categories.input'; 4 | import { PostWhereUniqueInput } from '../post/post-where-unique.input'; 5 | 6 | @InputType() 7 | export class PostCreateNestedManyWithoutCategoriesInput { 8 | @Field(() => [PostCreateWithoutCategoriesInput], { 9 | nullable: true 10 | }) 11 | create?: Array; 12 | 13 | @Field(() => [PostCreateOrConnectWithoutcategoriesInput], { 14 | nullable: true 15 | }) 16 | connectOrCreate?: Array; 17 | 18 | @Field(() => [PostWhereUniqueInput], { 19 | nullable: true 20 | }) 21 | connect?: Array; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/profile-create-nested-one-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateOrConnectWithoutuserInput } from '../profile/profile-create-or-connect-withoutuser.input'; 3 | import { ProfileCreateWithoutUserInput } from '../profile/profile-create-without-user.input'; 4 | import { ProfileWhereUniqueInput } from '../profile/profile-where-unique.input'; 5 | 6 | @InputType() 7 | export class ProfileCreateNestedOneWithoutUserInput { 8 | @Field(() => ProfileCreateWithoutUserInput, { 9 | nullable: true 10 | }) 11 | create?: ProfileCreateWithoutUserInput; 12 | 13 | @Field(() => ProfileCreateOrConnectWithoutuserInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: ProfileCreateOrConnectWithoutuserInput; 17 | 18 | @Field(() => ProfileWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: ProfileWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/query-mode.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum QueryMode { 4 | 'default' = 'default', 5 | insensitive = 'insensitive' 6 | } 7 | 8 | registerEnumType(QueryMode, { name: 'QueryMode' }); 9 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/role.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum Role { 4 | ADMIN = 'ADMIN', 5 | USER = 'USER' 6 | } 7 | 8 | registerEnumType(Role, { name: 'Role' }); 9 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/sort-order.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum SortOrder { 4 | asc = 'asc', 5 | desc = 'desc' 6 | } 7 | 8 | registerEnumType(SortOrder, { name: 'SortOrder' }); 9 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/user-create-nested-one-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOrConnectWithoutpostsInput } from '../user/user-create-or-connect-withoutposts.input'; 3 | import { UserCreateWithoutPostsInput } from '../user/user-create-without-posts.input'; 4 | import { UserWhereUniqueInput } from '../user/user-where-unique.input'; 5 | 6 | @InputType() 7 | export class UserCreateNestedOneWithoutPostsInput { 8 | @Field(() => UserCreateWithoutPostsInput, { 9 | nullable: true 10 | }) 11 | create?: UserCreateWithoutPostsInput; 12 | 13 | @Field(() => UserCreateOrConnectWithoutpostsInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: UserCreateOrConnectWithoutpostsInput; 17 | 18 | @Field(() => UserWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: UserWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/prisma/user-create-nested-one-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOrConnectWithoutprofileInput } from '../user/user-create-or-connect-withoutprofile.input'; 3 | import { UserCreateWithoutProfileInput } from '../user/user-create-without-profile.input'; 4 | import { UserWhereUniqueInput } from '../user/user-where-unique.input'; 5 | 6 | @InputType() 7 | export class UserCreateNestedOneWithoutProfileInput { 8 | @Field(() => UserCreateWithoutProfileInput, { 9 | nullable: true 10 | }) 11 | create?: UserCreateWithoutProfileInput; 12 | 13 | @Field(() => UserCreateOrConnectWithoutprofileInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: UserCreateOrConnectWithoutprofileInput; 17 | 18 | @Field(() => UserWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: UserWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/profile/aggregate-profile.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { ProfileCountAggregate } from './profile-count-aggregate.output'; 3 | import { ProfileMaxAggregate } from './profile-max-aggregate.output'; 4 | import { ProfileMinAggregate } from './profile-min-aggregate.output'; 5 | 6 | @ObjectType() 7 | export class AggregateProfile { 8 | @Field(() => ProfileCountAggregate, { 9 | nullable: true 10 | }) 11 | count?: ProfileCountAggregate; 12 | 13 | @Field(() => ProfileMinAggregate, { 14 | nullable: true 15 | }) 16 | min?: ProfileMinAggregate; 17 | 18 | @Field(() => ProfileMaxAggregate, { 19 | nullable: true 20 | }) 21 | max?: ProfileMaxAggregate; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/profile/find-first-profile.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { ProfileOrderByInput } from './profile-order-by.input'; 3 | import { ProfileScalarFieldEnum } from './profile-scalar-field.enum'; 4 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 5 | import { ProfileWhereInput } from './profile-where.input'; 6 | 7 | @ArgsType() 8 | export class FindFirstProfileArgs { 9 | @Field(() => ProfileWhereInput, { 10 | nullable: true 11 | }) 12 | where?: ProfileWhereInput; 13 | 14 | @Field(() => [ProfileOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => ProfileWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: ProfileWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [ProfileScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/profile/find-many-profile.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { ProfileOrderByInput } from './profile-order-by.input'; 3 | import { ProfileScalarFieldEnum } from './profile-scalar-field.enum'; 4 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 5 | import { ProfileWhereInput } from './profile-where.input'; 6 | 7 | @ArgsType() 8 | export class FindManyProfileArgs { 9 | @Field(() => ProfileWhereInput, { 10 | nullable: true 11 | }) 12 | where?: ProfileWhereInput; 13 | 14 | @Field(() => [ProfileOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => ProfileWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: ProfileWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [ProfileScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/profile/find-one-profile.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindOneProfileArgs { 6 | @Field(() => ProfileWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: ProfileWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/profile/find-unique-profile.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindUniqueProfileArgs { 6 | @Field(() => ProfileWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: ProfileWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-count-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileCountAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | username?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | firstName?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | lastName?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | bio?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | userId?: true; 44 | 45 | @Field(() => Boolean, { 46 | nullable: true 47 | }) 48 | _all?: true; 49 | } 50 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-count-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class ProfileCountAggregate { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | id!: number; 9 | 10 | @Field(() => Int, { 11 | nullable: false 12 | }) 13 | username!: number; 14 | 15 | @Field(() => Int, { 16 | nullable: false 17 | }) 18 | firstName!: number; 19 | 20 | @Field(() => Int, { 21 | nullable: false 22 | }) 23 | lastName!: number; 24 | 25 | @Field(() => Int, { 26 | nullable: false 27 | }) 28 | bio!: number; 29 | 30 | @Field(() => Int, { 31 | nullable: false 32 | }) 33 | createdAt!: number; 34 | 35 | @Field(() => Int, { 36 | nullable: false 37 | }) 38 | updatedAt!: number; 39 | 40 | @Field(() => Int, { 41 | nullable: false 42 | }) 43 | userId!: number; 44 | 45 | @Field(() => Int, { 46 | nullable: false 47 | }) 48 | _all!: number; 49 | } 50 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileCreateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | username!: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create-one-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateOrConnectWithoutUserInput } from './profile-create-or-connect-without-user.input'; 3 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 4 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 5 | 6 | @InputType() 7 | export class ProfileCreateOneWithoutUserInput { 8 | @Field(() => ProfileCreateWithoutUserInput, { 9 | nullable: true 10 | }) 11 | create?: ProfileCreateWithoutUserInput; 12 | 13 | @Field(() => ProfileCreateOrConnectWithoutUserInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: ProfileCreateOrConnectWithoutUserInput; 17 | 18 | @Field(() => ProfileWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: ProfileWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create-or-connect-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 3 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 4 | 5 | @InputType() 6 | export class ProfileCreateOrConnectWithoutUserInput { 7 | @Field(() => ProfileWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: ProfileWhereUniqueInput; 11 | 12 | @Field(() => ProfileCreateWithoutUserInput, { 13 | nullable: false 14 | }) 15 | create!: ProfileCreateWithoutUserInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create-or-connect-withoutuser.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 3 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 4 | 5 | @InputType() 6 | export class ProfileCreateOrConnectWithoutuserInput { 7 | @Field(() => ProfileWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: ProfileWhereUniqueInput; 11 | 12 | @Field(() => ProfileCreateWithoutUserInput, { 13 | nullable: false 14 | }) 15 | create!: ProfileCreateWithoutUserInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileCreateWithoutUserInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | username!: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-create.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOneWithoutProfileInput } from '../user/user-create-one-without-profile.input'; 3 | 4 | @InputType() 5 | export class ProfileCreateInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | username!: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | firstName?: string; 20 | 21 | @Field(() => String, { 22 | nullable: true 23 | }) 24 | lastName?: string; 25 | 26 | @Field(() => String, { 27 | nullable: true 28 | }) 29 | bio?: string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => UserCreateOneWithoutProfileInput, { 42 | nullable: true 43 | }) 44 | user?: UserCreateOneWithoutProfileInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-max-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileMaxAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | username?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | firstName?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | lastName?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | bio?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | userId?: true; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-max-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class ProfileMaxAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-min-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileMinAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | username?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | firstName?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | lastName?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | bio?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | createdAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | updatedAt?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | userId?: true; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-min-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class ProfileMinAggregate { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-order-by.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { SortOrder } from '../prisma/sort-order.enum'; 3 | 4 | @InputType() 5 | export class ProfileOrderByInput { 6 | @Field(() => SortOrder, { 7 | nullable: true 8 | }) 9 | id?: SortOrder; 10 | 11 | @Field(() => SortOrder, { 12 | nullable: true 13 | }) 14 | username?: SortOrder; 15 | 16 | @Field(() => SortOrder, { 17 | nullable: true 18 | }) 19 | firstName?: SortOrder; 20 | 21 | @Field(() => SortOrder, { 22 | nullable: true 23 | }) 24 | lastName?: SortOrder; 25 | 26 | @Field(() => SortOrder, { 27 | nullable: true 28 | }) 29 | bio?: SortOrder; 30 | 31 | @Field(() => SortOrder, { 32 | nullable: true 33 | }) 34 | createdAt?: SortOrder; 35 | 36 | @Field(() => SortOrder, { 37 | nullable: true 38 | }) 39 | updatedAt?: SortOrder; 40 | 41 | @Field(() => SortOrder, { 42 | nullable: true 43 | }) 44 | userId?: SortOrder; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-relation-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileWhereInput } from './profile-where.input'; 3 | 4 | @InputType() 5 | export class ProfileRelationFilter { 6 | @Field(() => ProfileWhereInput, { 7 | nullable: true 8 | }) 9 | is?: ProfileWhereInput; 10 | 11 | @Field(() => ProfileWhereInput, { 12 | nullable: true 13 | }) 14 | isNot?: ProfileWhereInput; 15 | } 16 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-scalar-field.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum ProfileScalarFieldEnum { 4 | id = 'id', 5 | username = 'username', 6 | firstName = 'firstName', 7 | lastName = 'lastName', 8 | bio = 'bio', 9 | createdAt = 'createdAt', 10 | updatedAt = 'updatedAt', 11 | userId = 'userId' 12 | } 13 | 14 | registerEnumType(ProfileScalarFieldEnum, { name: 'ProfileScalarFieldEnum' }); 15 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-create-nested-one-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateOrConnectWithoutuserInput } from './profile-create-or-connect-withoutuser.input'; 3 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 4 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 5 | 6 | @InputType() 7 | export class ProfileUncheckedCreateNestedOneWithoutUserInput { 8 | @Field(() => ProfileCreateWithoutUserInput, { 9 | nullable: true 10 | }) 11 | create?: ProfileCreateWithoutUserInput; 12 | 13 | @Field(() => ProfileCreateOrConnectWithoutuserInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: ProfileCreateOrConnectWithoutuserInput; 17 | 18 | @Field(() => ProfileWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: ProfileWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-create-one-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateOrConnectWithoutUserInput } from './profile-create-or-connect-without-user.input'; 3 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 4 | import { ProfileWhereUniqueInput } from './profile-where-unique.input'; 5 | 6 | @InputType() 7 | export class ProfileUncheckedCreateOneWithoutUserInput { 8 | @Field(() => ProfileCreateWithoutUserInput, { 9 | nullable: true 10 | }) 11 | create?: ProfileCreateWithoutUserInput; 12 | 13 | @Field(() => ProfileCreateOrConnectWithoutUserInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: ProfileCreateOrConnectWithoutUserInput; 17 | 18 | @Field(() => ProfileWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: ProfileWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-create-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUncheckedCreateWithoutUserInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | username!: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-create.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUncheckedCreateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: false 12 | }) 13 | username!: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUncheckedUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-update-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUncheckedUpdateWithoutUserInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-unchecked-update.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUncheckedUpdateInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-update-many-mutation.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUpdateManyMutationInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUpdateManyInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | 40 | @Field(() => String, { 41 | nullable: true 42 | }) 43 | userId?: string; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-update-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileUpdateWithoutUserInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | firstName?: string; 19 | 20 | @Field(() => String, { 21 | nullable: true 22 | }) 23 | lastName?: string; 24 | 25 | @Field(() => String, { 26 | nullable: true 27 | }) 28 | bio?: string; 29 | 30 | @Field(() => Date, { 31 | nullable: true 32 | }) 33 | createdAt?: Date | string; 34 | 35 | @Field(() => Date, { 36 | nullable: true 37 | }) 38 | updatedAt?: Date | string; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-update.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserUpdateOneWithoutProfileInput } from '../user/user-update-one-without-profile.input'; 3 | 4 | @InputType() 5 | export class ProfileUpdateInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | username?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | firstName?: string; 20 | 21 | @Field(() => String, { 22 | nullable: true 23 | }) 24 | lastName?: string; 25 | 26 | @Field(() => String, { 27 | nullable: true 28 | }) 29 | bio?: string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | createdAt?: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: true 38 | }) 39 | updatedAt?: Date | string; 40 | 41 | @Field(() => UserUpdateOneWithoutProfileInput, { 42 | nullable: true 43 | }) 44 | user?: UserUpdateOneWithoutProfileInput; 45 | } 46 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-upsert-without-user.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { ProfileCreateWithoutUserInput } from './profile-create-without-user.input'; 3 | import { ProfileUpdateWithoutUserInput } from './profile-update-without-user.input'; 4 | 5 | @InputType() 6 | export class ProfileUpsertWithoutUserInput { 7 | @Field(() => ProfileUpdateWithoutUserInput, { 8 | nullable: false 9 | }) 10 | update!: ProfileUpdateWithoutUserInput; 11 | 12 | @Field(() => ProfileCreateWithoutUserInput, { 13 | nullable: false 14 | }) 15 | create!: ProfileCreateWithoutUserInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile-where-unique.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class ProfileWhereUniqueInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | username?: string; 14 | 15 | @Field(() => String, { 16 | nullable: true 17 | }) 18 | userId?: string; 19 | } 20 | -------------------------------------------------------------------------------- /src/common/@generated/profile/profile.model.ts: -------------------------------------------------------------------------------- 1 | import { Field, ID, ObjectType } from '@nestjs/graphql'; 2 | import { User } from '../user/user.model'; 3 | 4 | @ObjectType() 5 | export class Profile { 6 | @Field(() => ID, { 7 | nullable: false 8 | }) 9 | id!: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | username!: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | firstName?: string; 20 | 21 | @Field(() => String, { 22 | nullable: true 23 | }) 24 | lastName?: string; 25 | 26 | @Field(() => String, { 27 | nullable: true 28 | }) 29 | bio?: string; 30 | 31 | @Field(() => Date, { 32 | nullable: false 33 | }) 34 | createdAt!: Date | string; 35 | 36 | @Field(() => Date, { 37 | nullable: false 38 | }) 39 | updatedAt!: Date | string; 40 | 41 | @Field(() => String, { 42 | nullable: true 43 | }) 44 | readonly userId?: string; 45 | 46 | @Field(() => User, { 47 | nullable: true 48 | }) 49 | user?: User; 50 | } 51 | -------------------------------------------------------------------------------- /src/common/@generated/user/aggregate-user.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { UserCountAggregate } from './user-count-aggregate.output'; 3 | import { UserMaxAggregate } from './user-max-aggregate.output'; 4 | import { UserMinAggregate } from './user-min-aggregate.output'; 5 | 6 | @ObjectType() 7 | export class AggregateUser { 8 | @Field(() => UserCountAggregate, { 9 | nullable: true 10 | }) 11 | count?: UserCountAggregate; 12 | 13 | @Field(() => UserMinAggregate, { 14 | nullable: true 15 | }) 16 | min?: UserMinAggregate; 17 | 18 | @Field(() => UserMaxAggregate, { 19 | nullable: true 20 | }) 21 | max?: UserMaxAggregate; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/user/find-first-user.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { UserOrderByInput } from './user-order-by.input'; 3 | import { UserScalarFieldEnum } from './user-scalar-field.enum'; 4 | import { UserWhereUniqueInput } from './user-where-unique.input'; 5 | import { UserWhereInput } from './user-where.input'; 6 | 7 | @ArgsType() 8 | export class FindFirstUserArgs { 9 | @Field(() => UserWhereInput, { 10 | nullable: true 11 | }) 12 | where?: UserWhereInput; 13 | 14 | @Field(() => [UserOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => UserWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: UserWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [UserScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/user/find-many-user.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field, Int } from '@nestjs/graphql'; 2 | import { UserOrderByInput } from './user-order-by.input'; 3 | import { UserScalarFieldEnum } from './user-scalar-field.enum'; 4 | import { UserWhereUniqueInput } from './user-where-unique.input'; 5 | import { UserWhereInput } from './user-where.input'; 6 | 7 | @ArgsType() 8 | export class FindManyUserArgs { 9 | @Field(() => UserWhereInput, { 10 | nullable: true 11 | }) 12 | where?: UserWhereInput; 13 | 14 | @Field(() => [UserOrderByInput], { 15 | nullable: true 16 | }) 17 | orderBy?: Array; 18 | 19 | @Field(() => UserWhereUniqueInput, { 20 | nullable: true 21 | }) 22 | cursor?: UserWhereUniqueInput; 23 | 24 | @Field(() => Int, { 25 | nullable: true 26 | }) 27 | take?: number; 28 | 29 | @Field(() => Int, { 30 | nullable: true 31 | }) 32 | skip?: number; 33 | 34 | @Field(() => [UserScalarFieldEnum], { 35 | nullable: true 36 | }) 37 | distinct?: Array; 38 | } 39 | -------------------------------------------------------------------------------- /src/common/@generated/user/find-one-user.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { UserWhereUniqueInput } from './user-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindOneUserArgs { 6 | @Field(() => UserWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: UserWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/user/find-unique-user.args.ts: -------------------------------------------------------------------------------- 1 | import { ArgsType, Field } from '@nestjs/graphql'; 2 | import { UserWhereUniqueInput } from './user-where-unique.input'; 3 | 4 | @ArgsType() 5 | export class FindUniqueUserArgs { 6 | @Field(() => UserWhereUniqueInput, { 7 | nullable: false 8 | }) 9 | where!: UserWhereUniqueInput; 10 | } 11 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-count-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class UserCountAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | email?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | password?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | role?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | createdAt?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | updatedAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | currentHashedRefreshToken?: true; 39 | 40 | @Field(() => Boolean, { 41 | nullable: true 42 | }) 43 | _all?: true; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-count-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, Int, ObjectType } from '@nestjs/graphql'; 2 | 3 | @ObjectType() 4 | export class UserCountAggregate { 5 | @Field(() => Int, { 6 | nullable: false 7 | }) 8 | id!: number; 9 | 10 | @Field(() => Int, { 11 | nullable: false 12 | }) 13 | email!: number; 14 | 15 | @Field(() => Int, { 16 | nullable: false 17 | }) 18 | password!: number; 19 | 20 | @Field(() => Int, { 21 | nullable: false 22 | }) 23 | role!: number; 24 | 25 | @Field(() => Int, { 26 | nullable: false 27 | }) 28 | createdAt!: number; 29 | 30 | @Field(() => Int, { 31 | nullable: false 32 | }) 33 | updatedAt!: number; 34 | 35 | @Field(() => Int, { 36 | nullable: false 37 | }) 38 | currentHashedRefreshToken!: number; 39 | 40 | @Field(() => Int, { 41 | nullable: false 42 | }) 43 | _all!: number; 44 | } 45 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @InputType() 5 | export class UserCreateManyInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | email!: string; 15 | 16 | @Field(() => String, { 17 | nullable: false 18 | }) 19 | password!: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-one-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOrConnectWithoutPostsInput } from './user-create-or-connect-without-posts.input'; 3 | import { UserCreateWithoutPostsInput } from './user-create-without-posts.input'; 4 | import { UserWhereUniqueInput } from './user-where-unique.input'; 5 | 6 | @InputType() 7 | export class UserCreateOneWithoutPostsInput { 8 | @Field(() => UserCreateWithoutPostsInput, { 9 | nullable: true 10 | }) 11 | create?: UserCreateWithoutPostsInput; 12 | 13 | @Field(() => UserCreateOrConnectWithoutPostsInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: UserCreateOrConnectWithoutPostsInput; 17 | 18 | @Field(() => UserWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: UserWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-one-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateOrConnectWithoutProfileInput } from './user-create-or-connect-without-profile.input'; 3 | import { UserCreateWithoutProfileInput } from './user-create-without-profile.input'; 4 | import { UserWhereUniqueInput } from './user-where-unique.input'; 5 | 6 | @InputType() 7 | export class UserCreateOneWithoutProfileInput { 8 | @Field(() => UserCreateWithoutProfileInput, { 9 | nullable: true 10 | }) 11 | create?: UserCreateWithoutProfileInput; 12 | 13 | @Field(() => UserCreateOrConnectWithoutProfileInput, { 14 | nullable: true 15 | }) 16 | connectOrCreate?: UserCreateOrConnectWithoutProfileInput; 17 | 18 | @Field(() => UserWhereUniqueInput, { 19 | nullable: true 20 | }) 21 | connect?: UserWhereUniqueInput; 22 | } 23 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-or-connect-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutPostsInput } from './user-create-without-posts.input'; 3 | import { UserWhereUniqueInput } from './user-where-unique.input'; 4 | 5 | @InputType() 6 | export class UserCreateOrConnectWithoutPostsInput { 7 | @Field(() => UserWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: UserWhereUniqueInput; 11 | 12 | @Field(() => UserCreateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-or-connect-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutProfileInput } from './user-create-without-profile.input'; 3 | import { UserWhereUniqueInput } from './user-where-unique.input'; 4 | 5 | @InputType() 6 | export class UserCreateOrConnectWithoutProfileInput { 7 | @Field(() => UserWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: UserWhereUniqueInput; 11 | 12 | @Field(() => UserCreateWithoutProfileInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutProfileInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-or-connect-withoutposts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutPostsInput } from './user-create-without-posts.input'; 3 | import { UserWhereUniqueInput } from './user-where-unique.input'; 4 | 5 | @InputType() 6 | export class UserCreateOrConnectWithoutpostsInput { 7 | @Field(() => UserWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: UserWhereUniqueInput; 11 | 12 | @Field(() => UserCreateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-or-connect-withoutprofile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutProfileInput } from './user-create-without-profile.input'; 3 | import { UserWhereUniqueInput } from './user-where-unique.input'; 4 | 5 | @InputType() 6 | export class UserCreateOrConnectWithoutprofileInput { 7 | @Field(() => UserWhereUniqueInput, { 8 | nullable: false 9 | }) 10 | where!: UserWhereUniqueInput; 11 | 12 | @Field(() => UserCreateWithoutProfileInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutProfileInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | import { ProfileCreateOneWithoutUserInput } from '../profile/profile-create-one-without-user.input'; 4 | 5 | @InputType() 6 | export class UserCreateWithoutPostsInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: false 14 | }) 15 | email!: string; 16 | 17 | @Field(() => String, { 18 | nullable: false 19 | }) 20 | password!: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => ProfileCreateOneWithoutUserInput, { 43 | nullable: true 44 | }) 45 | profile?: ProfileCreateOneWithoutUserInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-create-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateManyWithoutAuthorInput } from '../post/post-create-many-without-author.input'; 3 | import { Role } from '../prisma/role.enum'; 4 | 5 | @InputType() 6 | export class UserCreateWithoutProfileInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: false 14 | }) 15 | email!: string; 16 | 17 | @Field(() => String, { 18 | nullable: false 19 | }) 20 | password!: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => PostCreateManyWithoutAuthorInput, { 43 | nullable: true 44 | }) 45 | posts?: PostCreateManyWithoutAuthorInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-max-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class UserMaxAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | email?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | password?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | role?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | createdAt?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | updatedAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | currentHashedRefreshToken?: true; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-max-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @ObjectType() 5 | export class UserMaxAggregate { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | email?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | password?: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-min-aggregate.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class UserMinAggregateInput { 5 | @Field(() => Boolean, { 6 | nullable: true 7 | }) 8 | id?: true; 9 | 10 | @Field(() => Boolean, { 11 | nullable: true 12 | }) 13 | email?: true; 14 | 15 | @Field(() => Boolean, { 16 | nullable: true 17 | }) 18 | password?: true; 19 | 20 | @Field(() => Boolean, { 21 | nullable: true 22 | }) 23 | role?: true; 24 | 25 | @Field(() => Boolean, { 26 | nullable: true 27 | }) 28 | createdAt?: true; 29 | 30 | @Field(() => Boolean, { 31 | nullable: true 32 | }) 33 | updatedAt?: true; 34 | 35 | @Field(() => Boolean, { 36 | nullable: true 37 | }) 38 | currentHashedRefreshToken?: true; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-min-aggregate.output.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @ObjectType() 5 | export class UserMinAggregate { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | email?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | password?: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-order-by.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { SortOrder } from '../prisma/sort-order.enum'; 3 | 4 | @InputType() 5 | export class UserOrderByInput { 6 | @Field(() => SortOrder, { 7 | nullable: true 8 | }) 9 | id?: SortOrder; 10 | 11 | @Field(() => SortOrder, { 12 | nullable: true 13 | }) 14 | email?: SortOrder; 15 | 16 | @Field(() => SortOrder, { 17 | nullable: true 18 | }) 19 | password?: SortOrder; 20 | 21 | @Field(() => SortOrder, { 22 | nullable: true 23 | }) 24 | role?: SortOrder; 25 | 26 | @Field(() => SortOrder, { 27 | nullable: true 28 | }) 29 | createdAt?: SortOrder; 30 | 31 | @Field(() => SortOrder, { 32 | nullable: true 33 | }) 34 | updatedAt?: SortOrder; 35 | 36 | @Field(() => SortOrder, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: SortOrder; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-relation-filter.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserWhereInput } from './user-where.input'; 3 | 4 | @InputType() 5 | export class UserRelationFilter { 6 | @Field(() => UserWhereInput, { 7 | nullable: true 8 | }) 9 | is?: UserWhereInput; 10 | 11 | @Field(() => UserWhereInput, { 12 | nullable: true 13 | }) 14 | isNot?: UserWhereInput; 15 | } 16 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-scalar-field.enum.ts: -------------------------------------------------------------------------------- 1 | import { registerEnumType } from '@nestjs/graphql'; 2 | 3 | export enum UserScalarFieldEnum { 4 | id = 'id', 5 | email = 'email', 6 | password = 'password', 7 | role = 'role', 8 | createdAt = 'createdAt', 9 | updatedAt = 'updatedAt' 10 | } 11 | 12 | registerEnumType(UserScalarFieldEnum, { name: 'UserScalarFieldEnum' }); 13 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-unchecked-create-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | import { ProfileUncheckedCreateOneWithoutUserInput } from '../profile/profile-unchecked-create-one-without-user.input'; 4 | 5 | @InputType() 6 | export class UserUncheckedCreateWithoutPostsInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: false 14 | }) 15 | email!: string; 16 | 17 | @Field(() => String, { 18 | nullable: false 19 | }) 20 | password!: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => ProfileUncheckedCreateOneWithoutUserInput, { 43 | nullable: true 44 | }) 45 | profile?: ProfileUncheckedCreateOneWithoutUserInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-unchecked-create-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostCreateManyWithoutAuthorInput } from '../post/post-create-many-without-author.input'; 3 | import { Role } from '../prisma/role.enum'; 4 | 5 | @InputType() 6 | export class UserUncheckedCreateWithoutProfileInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: false 14 | }) 15 | email!: string; 16 | 17 | @Field(() => String, { 18 | nullable: false 19 | }) 20 | password!: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => PostCreateManyWithoutAuthorInput, { 43 | nullable: true 44 | }) 45 | posts?: PostCreateManyWithoutAuthorInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-unchecked-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @InputType() 5 | export class UserUncheckedUpdateManyInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | email?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | password?: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-unchecked-update-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | import { ProfileUncheckedUpdateOneWithoutUserInput } from '../profile/profile-unchecked-update-one-without-user.input'; 4 | 5 | @InputType() 6 | export class UserUncheckedUpdateWithoutPostsInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: true 14 | }) 15 | email?: string; 16 | 17 | @Field(() => String, { 18 | nullable: true 19 | }) 20 | password?: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => ProfileUncheckedUpdateOneWithoutUserInput, { 43 | nullable: true 44 | }) 45 | profile?: ProfileUncheckedUpdateOneWithoutUserInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-unchecked-update-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostUpdateManyWithoutAuthorInput } from '../post/post-update-many-without-author.input'; 3 | import { Role } from '../prisma/role.enum'; 4 | 5 | @InputType() 6 | export class UserUncheckedUpdateWithoutProfileInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: true 14 | }) 15 | email?: string; 16 | 17 | @Field(() => String, { 18 | nullable: true 19 | }) 20 | password?: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => PostUpdateManyWithoutAuthorInput, { 43 | nullable: true 44 | }) 45 | posts?: PostUpdateManyWithoutAuthorInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-update-many-mutation.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @InputType() 5 | export class UserUpdateManyMutationInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | email?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | password?: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-update-many.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | 4 | @InputType() 5 | export class UserUpdateManyInput { 6 | @Field(() => String, { 7 | nullable: true 8 | }) 9 | id?: string; 10 | 11 | @Field(() => String, { 12 | nullable: true 13 | }) 14 | email?: string; 15 | 16 | @Field(() => String, { 17 | nullable: true 18 | }) 19 | password?: string; 20 | 21 | @Field(() => Role, { 22 | nullable: true 23 | }) 24 | role?: Role; 25 | 26 | @Field(() => Date, { 27 | nullable: true 28 | }) 29 | createdAt?: Date | string; 30 | 31 | @Field(() => Date, { 32 | nullable: true 33 | }) 34 | updatedAt?: Date | string; 35 | 36 | @Field(() => String, { 37 | nullable: true 38 | }) 39 | currentHashedRefreshToken?: string; 40 | } 41 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-update-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Role } from '../prisma/role.enum'; 3 | import { ProfileUpdateOneWithoutUserInput } from '../profile/profile-update-one-without-user.input'; 4 | 5 | @InputType() 6 | export class UserUpdateWithoutPostsInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: true 14 | }) 15 | email?: string; 16 | 17 | @Field(() => String, { 18 | nullable: true 19 | }) 20 | password?: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => ProfileUpdateOneWithoutUserInput, { 43 | nullable: true 44 | }) 45 | profile?: ProfileUpdateOneWithoutUserInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-update-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { PostUpdateManyWithoutAuthorInput } from '../post/post-update-many-without-author.input'; 3 | import { Role } from '../prisma/role.enum'; 4 | 5 | @InputType() 6 | export class UserUpdateWithoutProfileInput { 7 | @Field(() => String, { 8 | nullable: true 9 | }) 10 | id?: string; 11 | 12 | @Field(() => String, { 13 | nullable: true 14 | }) 15 | email?: string; 16 | 17 | @Field(() => String, { 18 | nullable: true 19 | }) 20 | password?: string; 21 | 22 | @Field(() => Role, { 23 | nullable: true 24 | }) 25 | role?: Role; 26 | 27 | @Field(() => Date, { 28 | nullable: true 29 | }) 30 | createdAt?: Date | string; 31 | 32 | @Field(() => Date, { 33 | nullable: true 34 | }) 35 | updatedAt?: Date | string; 36 | 37 | @Field(() => String, { 38 | nullable: true 39 | }) 40 | currentHashedRefreshToken?: string; 41 | 42 | @Field(() => PostUpdateManyWithoutAuthorInput, { 43 | nullable: true 44 | }) 45 | posts?: PostUpdateManyWithoutAuthorInput; 46 | } 47 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-upsert-without-posts.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutPostsInput } from './user-create-without-posts.input'; 3 | import { UserUpdateWithoutPostsInput } from './user-update-without-posts.input'; 4 | 5 | @InputType() 6 | export class UserUpsertWithoutPostsInput { 7 | @Field(() => UserUpdateWithoutPostsInput, { 8 | nullable: false 9 | }) 10 | update!: UserUpdateWithoutPostsInput; 11 | 12 | @Field(() => UserCreateWithoutPostsInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutPostsInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-upsert-without-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { UserCreateWithoutProfileInput } from './user-create-without-profile.input'; 3 | import { UserUpdateWithoutProfileInput } from './user-update-without-profile.input'; 4 | 5 | @InputType() 6 | export class UserUpsertWithoutProfileInput { 7 | @Field(() => UserUpdateWithoutProfileInput, { 8 | nullable: false 9 | }) 10 | update!: UserUpdateWithoutProfileInput; 11 | 12 | @Field(() => UserCreateWithoutProfileInput, { 13 | nullable: false 14 | }) 15 | create!: UserCreateWithoutProfileInput; 16 | } 17 | -------------------------------------------------------------------------------- /src/common/@generated/user/user-where-unique.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class UserWhereUniqueInput { 5 | @Field(() => String, { 6 | nullable: true 7 | }) 8 | id?: string; 9 | 10 | @Field(() => String, { 11 | nullable: true 12 | }) 13 | email?: string; 14 | } 15 | -------------------------------------------------------------------------------- /src/common/@generated/user/user.model.ts: -------------------------------------------------------------------------------- 1 | import { Field, ID, ObjectType } from '@nestjs/graphql'; 2 | import { Post } from '../post/post.model'; 3 | import { Role } from '../prisma/role.enum'; 4 | import { Profile } from '../profile/profile.model'; 5 | 6 | @ObjectType() 7 | export class User { 8 | @Field(() => ID, { 9 | nullable: false 10 | }) 11 | id!: string; 12 | 13 | @Field(() => String, { 14 | nullable: false 15 | }) 16 | email!: string; 17 | 18 | @Field(() => String, { 19 | nullable: false 20 | }) 21 | password!: string; 22 | 23 | @Field(() => Role, { 24 | nullable: false, 25 | defaultValue: 'USER' 26 | }) 27 | role!: Role; 28 | 29 | @Field(() => Date, { 30 | nullable: false 31 | }) 32 | createdAt!: Date | string; 33 | 34 | @Field(() => Date, { 35 | nullable: false 36 | }) 37 | updatedAt!: Date | string; 38 | 39 | @Field(() => [Post], { 40 | nullable: false 41 | }) 42 | posts!: Array; 43 | 44 | @Field(() => Profile, { 45 | nullable: true 46 | }) 47 | profile?: Profile; 48 | 49 | @Field(() => String, { 50 | nullable: true 51 | }) 52 | currentHashedRefreshToken?: string; 53 | } 54 | -------------------------------------------------------------------------------- /src/common/abstract-model/base.model.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType, ID, GraphQLISODateTime } from '@nestjs/graphql'; 2 | 3 | @ObjectType({ isAbstract: true }) 4 | export abstract class BaseModel { 5 | @Field(() => ID) 6 | public id: string; 7 | 8 | @Field(() => GraphQLISODateTime) 9 | createdAt: Date; 10 | 11 | @Field(() => GraphQLISODateTime) 12 | updatedAt: Date; 13 | } 14 | -------------------------------------------------------------------------------- /src/common/abstract-model/date.scalar.ts: -------------------------------------------------------------------------------- 1 | import { CustomScalar, Scalar } from '@nestjs/graphql'; 2 | import { Kind } from 'graphql'; 3 | 4 | @Scalar('Date', () => Date) 5 | export class DateScalar implements CustomScalar { 6 | public readonly description = 'Date custom scalar type'; 7 | 8 | public parseValue(value: string): Date { 9 | return new Date(value); 10 | } 11 | public serialize(value: Date): string { 12 | return new Date(value).toISOString(); 13 | } 14 | 15 | public parseLiteral(ast: any): Date { 16 | if (ast.kind === Kind.INT) { 17 | return new Date(ast.value); 18 | } 19 | return null; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/common/configs/env.config.ts: -------------------------------------------------------------------------------- 1 | import dotenv from 'dotenv'; 2 | 3 | export const envConfig = (): EnvConfig => { 4 | const mode = process.env.NODE_ENV; 5 | if (!mode || mode === 'development') { 6 | dotenv.config(); 7 | } else { 8 | dotenv.config({ path: `.env.${mode}` }); 9 | } 10 | 11 | const port = parseInt(process.env.PORT) || 5025; 12 | 13 | return { 14 | mode, 15 | port, 16 | serverUrl: process.env.SERVER_URL || `http://localhost:5025`, 17 | clientUrl: process.env.CLIENT_URL || `http://localhost:3000`, 18 | sessionSecret: process.env.SESSION_SECRET || `some-very-strong-secret`, 19 | cookieSecret: process.env.COOKIE_SECRET || `some-very-strong-secret`, 20 | email: { 21 | sendgridApiKey: process.env.SENDGRID_API_KEY, 22 | emailSender: process.env.EMAIL_AUTH_USER || 'your-email@yopmail.com' 23 | } 24 | }; 25 | }; 26 | 27 | export interface EnvConfig { 28 | mode: string; 29 | port: number; 30 | serverUrl: string; 31 | clientUrl: string; 32 | sessionSecret: string; 33 | cookieSecret: string; 34 | 35 | email: { 36 | sendgridApiKey: string; 37 | emailSender: string; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /src/common/configs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './env.config'; 2 | export * from './graphql-module.factory'; 3 | export * from './i18n-module.factory'; 4 | export * from './session-config'; 5 | export * from './setup-swagger'; 6 | -------------------------------------------------------------------------------- /src/common/configs/session-config.ts: -------------------------------------------------------------------------------- 1 | import { ISessionOption } from '@common/environment/environment.interface'; 2 | import { REDIS_AUTH_TOKEN_SESSION } from 'src/providers/redis/redis.constant'; 3 | import connectRedis from 'connect-redis'; 4 | import session from 'express-session'; 5 | 6 | export const sessionConfig = (redisClient, sessionEnv: ISessionOption) => { 7 | const RedisStore = connectRedis(session); 8 | return { 9 | store: new RedisStore({ 10 | client: redisClient as any 11 | }), 12 | name: REDIS_AUTH_TOKEN_SESSION, 13 | secret: sessionEnv.secret, 14 | resave: false, 15 | saveUninitialized: false, 16 | cookie: { 17 | httpOnly: true, 18 | secure: process.env.NODE_ENV === 'production', 19 | maxAge: 1000 * 60 * 60 * 24 * 30 // 60 days --> need >= max of alive time of refresh token 20 | } 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /src/common/configs/setup-swagger.ts: -------------------------------------------------------------------------------- 1 | import { INestApplication } from '@nestjs/common'; 2 | import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; 3 | 4 | export const setupSwagger = (app: INestApplication) => { 5 | const options = new DocumentBuilder() 6 | .setTitle('API') 7 | .setDescription('NestJS - GraphQL - Prisma') 8 | .setVersion('1.0.0') 9 | .addBearerAuth() 10 | .build(); 11 | 12 | const document = SwaggerModule.createDocument(app, options); 13 | SwaggerModule.setup('/api/docs', app, document); 14 | }; 15 | -------------------------------------------------------------------------------- /src/common/environment/environment.interface.ts: -------------------------------------------------------------------------------- 1 | import { MailerOptions } from '@nestjs-modules/mailer'; 2 | import { GqlModuleOptions } from '@nestjs/graphql'; 3 | import { JwtModuleOptions } from '@nestjs/jwt'; 4 | import {} from 'express-session'; 5 | 6 | export interface IEnvironment { 7 | readonly siteUrl?: string; 8 | readonly serverPort: number; 9 | readonly isDevelopment: boolean; 10 | readonly isProduction: boolean; 11 | readonly session?: { 12 | secret: string; 13 | }; 14 | readonly graphql?: GqlModuleOptions; 15 | readonly jwtOptions?: IJwtOptions; 16 | readonly mail?: Omit; 17 | } 18 | 19 | export interface ISessionOption { 20 | secret: string; 21 | } 22 | 23 | export interface IJwtOptions extends JwtModuleOptions { 24 | accessTokenExpiresIn: number; 25 | refreshTokenExpiresIn: number; 26 | } 27 | -------------------------------------------------------------------------------- /src/common/global-exceptions-filter/all-exceptions.filter.ts: -------------------------------------------------------------------------------- 1 | import { ArgumentsHost, Catch } from '@nestjs/common'; 2 | import { BaseExceptionFilter } from '@nestjs/core'; 3 | 4 | // Avoid always try catch for resolver of graphql 5 | @Catch() 6 | export class AllExceptionsFilter extends BaseExceptionFilter { 7 | catch(exception: any, host: ArgumentsHost) { 8 | switch (host.getType() as string) { 9 | case 'http': 10 | // Catch error direct if is http request 11 | super.catch(exception, host); 12 | return; 13 | case 'graphql': 14 | // Catch graphql request error with apollo-error-converter 15 | // Fill name, code, type fields for Apollo Error Converter 16 | if (!exception.type) { 17 | exception.type = exception.constructor?.name || exception.message; 18 | } 19 | if (!exception.code) { 20 | exception.code = exception.status; 21 | } 22 | return exception; 23 | default: 24 | super.catch(exception, host); 25 | return; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/common/global-interceptors/errors.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Injectable, 3 | NestInterceptor, 4 | ExecutionContext, 5 | BadGatewayException, 6 | CallHandler 7 | } from '@nestjs/common'; 8 | import { Observable, throwError } from 'rxjs'; 9 | import { catchError } from 'rxjs/operators'; 10 | 11 | @Injectable() 12 | export class ErrorsInterceptor implements NestInterceptor { 13 | intercept(context: ExecutionContext, next: CallHandler): Observable { 14 | return next 15 | .handle() 16 | .pipe( 17 | catchError((err) => throwError(new BadGatewayException(err.message))) 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/common/global-interceptors/exclude-null.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CallHandler, 3 | ExecutionContext, 4 | Injectable, 5 | NestInterceptor 6 | } from '@nestjs/common'; 7 | import { Observable } from 'rxjs'; 8 | import { map } from 'rxjs/operators'; 9 | 10 | @Injectable() 11 | export class ExcludeNullInterceptor implements NestInterceptor { 12 | intercept(context: ExecutionContext, next: CallHandler): Observable { 13 | return next.handle().pipe(map((value) => (value === null ? '' : value))); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/common/global-interceptors/logging.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { 2 | CallHandler, 3 | ExecutionContext, 4 | Injectable, 5 | NestInterceptor 6 | } from '@nestjs/common'; 7 | import { Observable } from 'rxjs'; 8 | import { tap } from 'rxjs/operators'; 9 | 10 | @Injectable() 11 | export class LoggingInterceptor implements NestInterceptor { 12 | intercept(context: ExecutionContext, next: CallHandler): Observable { 13 | console.log('Before...'); 14 | 15 | const now = Date.now(); 16 | return next 17 | .handle() 18 | .pipe(tap(() => console.log(`After... ${Date.now() - now}ms`))); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/common/global-interceptors/transform.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Injectable, 3 | NestInterceptor, 4 | ExecutionContext, 5 | CallHandler 6 | } from '@nestjs/common'; 7 | import { Observable } from 'rxjs'; 8 | import { map } from 'rxjs/operators'; 9 | 10 | export interface Response { 11 | data: T; 12 | } 13 | 14 | @Injectable() 15 | export class TransformInterceptor 16 | implements NestInterceptor> { 17 | intercept( 18 | context: ExecutionContext, 19 | next: CallHandler 20 | ): Observable> { 21 | return next.handle().pipe(map((data) => ({ data }))); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/common/global-interfaces/http.interface.ts: -------------------------------------------------------------------------------- 1 | import { Role } from '@common/@generated/prisma'; 2 | import { Request, Response } from 'express'; 3 | 4 | export interface IHttpContext { 5 | req?: IRequestWithUser; 6 | res?: Response; 7 | } 8 | 9 | export interface IRequestWithUser extends Request { 10 | user?: IUserFromRequest; 11 | res?: Response; 12 | session?: any; 13 | } 14 | 15 | export interface IUserFromRequest { 16 | id: string; 17 | email: string; 18 | role: Role; 19 | } 20 | 21 | export interface ISessionAuthToken { 22 | accessToken: string; 23 | refreshToken: string; 24 | } 25 | 26 | export interface IPayloadUserJwt { 27 | userId: string; 28 | email?: string; 29 | } 30 | -------------------------------------------------------------------------------- /src/common/global-interfaces/index.ts: -------------------------------------------------------------------------------- 1 | export * from './http.interface'; 2 | -------------------------------------------------------------------------------- /src/common/i18n/en/category.json: -------------------------------------------------------------------------------- 1 | { 2 | "CATEGORY": { 3 | "NEW": "New Category: {name}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/common/i18n/en/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "HELLO_MESSAGE": "Hello {username}", 3 | "GOODBYE_MESSAGE": "Goodbye {username}", 4 | "SETUP": { 5 | "WELCOME": "Welcome {0.username}", 6 | "GOODBYE": "Goodbye {0.username}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/common/i18n/en/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "HELLO": "Hello", 3 | "ENGLISH": "English", 4 | "ARRAY": ["ONE", "TWO", "THREE"], 5 | "ONLY_EN_KEY": "this key only exists in en lang", 6 | "SET-UP-PASSWORD": { 7 | "HEADING": "Hello, {username}", 8 | "TITLE": "Forgot password", 9 | "FOLLOWLINK": "Please follow the link to set up your password" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/common/i18n/fr/category.json: -------------------------------------------------------------------------------- 1 | { 2 | "CATEGORY": { 3 | "NEW": "Nouveau Catégory: {name}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/common/i18n/fr/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "HELLO_MESSAGE": "Salut {username}", 3 | "GOODBYE_MESSAGE": "Aurevoir {username}", 4 | "SETUP": { 5 | "WELCOME": "Bienvenue {0.username}", 6 | "GOODBYE": "Aurevoir {0.username}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/common/i18n/fr/user.json: -------------------------------------------------------------------------------- 1 | { 2 | "HELLO": "Bonjour", 3 | "ARRAY": ["UN", "DEUX", "TROIS"], 4 | "SET-UP-PASSWORD": { 5 | "HEADING": "Bonjour, {username}", 6 | "TITLE": "Mot de passe oublié", 7 | "FOLLOWLINK": "Veuillez suivre le lien pour configurer votre mot de passe" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/common/utils/decorator-factory.ts: -------------------------------------------------------------------------------- 1 | import { ROUTE_ARGS_METADATA } from '@nestjs/common/constants'; 2 | 3 | export function getParamDecoratorFactory(decorator: Function) { 4 | class TestDecorator { 5 | public test(@decorator() _value) {} 6 | } 7 | 8 | const args = Reflect.getMetadata(ROUTE_ARGS_METADATA, TestDecorator, 'test'); 9 | return args[Object.keys(args)[0]].factory; 10 | } 11 | -------------------------------------------------------------------------------- /src/modules/auth/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tduyng/nestjs-graphql-prisma/d4f8461c2c38c77e59829f0d161ae688ef36cd16/src/modules/auth/.gitkeep -------------------------------------------------------------------------------- /src/modules/auth/auth.interface.ts: -------------------------------------------------------------------------------- 1 | export interface PayloadToValidateJwt { 2 | userId: string; 3 | email: string; 4 | } 5 | -------------------------------------------------------------------------------- /src/modules/auth/dto/change-password.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsString, MinLength } from 'class-validator'; 3 | 4 | @InputType() 5 | export class ChangePasswordInput { 6 | @Field() 7 | @MinLength(3) 8 | @IsString() 9 | oldPassword: string; 10 | 11 | @Field() 12 | @MinLength(3) 13 | @IsString() 14 | newPassword: string; 15 | } 16 | -------------------------------------------------------------------------------- /src/modules/auth/dto/index.ts: -------------------------------------------------------------------------------- 1 | export * from './change-password.input'; 2 | export * from './login.input'; 3 | export * from './register-user.input'; 4 | export * from './request-forgot-password.input'; 5 | export * from './reset-password.input'; 6 | -------------------------------------------------------------------------------- /src/modules/auth/dto/login.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsEmail, MinLength } from 'class-validator'; 3 | 4 | @InputType() 5 | export class LoginUserInput { 6 | @Field(() => String) 7 | @IsEmail() 8 | email: string; 9 | 10 | @Field(() => String) 11 | @MinLength(3) 12 | password: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/modules/auth/dto/register-user.input.ts: -------------------------------------------------------------------------------- 1 | import { ProfileCreateOneWithoutUserInput } from '@common/@generated/profile'; 2 | import { Field, InputType } from '@nestjs/graphql'; 3 | import { IsEmail, IsString, MinLength, Validate } from 'class-validator'; 4 | import { UserExitsValidator } from '@modules/user/decorators'; 5 | 6 | @InputType() 7 | export class RegisterUserInput { 8 | @Field(() => String, { 9 | nullable: false 10 | }) 11 | @Validate(UserExitsValidator) 12 | @IsEmail() 13 | email!: string; 14 | 15 | @Field(() => String, { 16 | nullable: false 17 | }) 18 | @IsString() 19 | @MinLength(3) 20 | password!: string; 21 | 22 | @Field(() => ProfileCreateOneWithoutUserInput, { 23 | nullable: true 24 | }) 25 | profile?: ProfileCreateOneWithoutUserInput; 26 | } 27 | -------------------------------------------------------------------------------- /src/modules/auth/dto/request-forgot-password.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsEmail } from 'class-validator'; 3 | 4 | @InputType() 5 | export class RequestForgotPasswordInput { 6 | @Field() 7 | @IsEmail() 8 | email: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/modules/auth/dto/reset-password.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsString, MinLength } from 'class-validator'; 3 | 4 | @InputType() 5 | export class ResetPasswordInput { 6 | @Field() 7 | token: string; 8 | 9 | @Field() 10 | @MinLength(3) 11 | @IsString() 12 | newPassword: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/modules/auth/guards/index.ts: -------------------------------------------------------------------------------- 1 | export * from './jwt-refresh-token.guard'; 2 | export * from './jwt.guard'; 3 | -------------------------------------------------------------------------------- /src/modules/auth/guards/jwt-refresh-token.guard.ts: -------------------------------------------------------------------------------- 1 | import { ExecutionContext, Injectable } from '@nestjs/common'; 2 | import { GqlExecutionContext } from '@nestjs/graphql'; 3 | import { AuthGuard } from '@nestjs/passport'; 4 | 5 | @Injectable() 6 | export class JwtRefreshTokenGuard extends AuthGuard('jwt-refresh-token') { 7 | getRequest(context: ExecutionContext) { 8 | const ctx = GqlExecutionContext.create(context); 9 | return ctx.getContext().req; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/modules/auth/services/password.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import * as bcrypt from 'bcrypt'; 3 | 4 | @Injectable() 5 | export class PasswordService { 6 | private salt_number = 10; 7 | 8 | public async validatePassword(password: string, hashedPassword: string) { 9 | return await bcrypt.compare(password, hashedPassword); 10 | } 11 | 12 | public async hashPassword(password: string) { 13 | const salt = await bcrypt.genSalt(this.salt_number); 14 | return await bcrypt.hash(password, salt); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/modules/auth/test/jwt-refresh-token.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { JwtRefreshTokenGuard } from '../guards'; 2 | 3 | describe('JwtRefreshTokenGuard', () => { 4 | it('Should be defined', () => { 5 | const { PostService } = jest.createMockFromModule( 6 | '@modules/post/post.service.ts' 7 | ); 8 | expect(new JwtRefreshTokenGuard(new PostService())).toBeDefined(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/modules/category/category.model.ts: -------------------------------------------------------------------------------- 1 | import { BaseModel } from '@common/abstract-model/base.model'; 2 | import { Post } from '@modules/post/post.model'; 3 | import { Field, ObjectType } from '@nestjs/graphql'; 4 | import { IsNotEmpty } from 'class-validator'; 5 | 6 | @ObjectType('category') 7 | export class Category extends BaseModel { 8 | @Field(() => String, { nullable: false }) 9 | @IsNotEmpty() 10 | name: string; 11 | 12 | @Field(() => String, { nullable: false }) 13 | @IsNotEmpty() 14 | slug: string; 15 | 16 | @Field(() => [Post], { nullable: true }) 17 | posts?: Post[]; 18 | } 19 | -------------------------------------------------------------------------------- /src/modules/category/category.module.ts: -------------------------------------------------------------------------------- 1 | import { PrismaSelectService } from 'src/providers/prisma/prisma-select.service'; 2 | import { PrismaService } from 'src/providers/prisma/prisma.service'; 3 | import { Module } from '@nestjs/common'; 4 | import { CategoryResolver } from './category.resolver'; 5 | import { CategoryService } from './category.service'; 6 | 7 | @Module({ 8 | providers: [ 9 | CategoryService, 10 | CategoryResolver, 11 | PrismaService, 12 | PrismaSelectService 13 | ] 14 | }) 15 | export class CategoryModule {} 16 | -------------------------------------------------------------------------------- /src/modules/category/dto/create-category.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsNotEmpty } from 'class-validator'; 3 | 4 | @InputType() 5 | export class CreateCategoryInput { 6 | @Field(() => String) 7 | @IsNotEmpty() 8 | name: string; 9 | } 10 | -------------------------------------------------------------------------------- /src/modules/category/dto/create-multiple-category.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { IsNotEmpty } from 'class-validator'; 3 | import { CreateCategoryInput } from './create-category.input'; 4 | 5 | @InputType() 6 | export class CreateMultipleCategoryInput { 7 | @Field(() => [CreateCategoryInput]) 8 | @IsNotEmpty() 9 | categories: CreateCategoryInput[]; 10 | } 11 | -------------------------------------------------------------------------------- /src/modules/category/dto/index.ts: -------------------------------------------------------------------------------- 1 | export { CreateCategoryInput } from './create-category.input'; 2 | export { UpdateCategoryInput } from './update-category.input'; 3 | export { CreateMultipleCategoryInput } from './create-multiple-category.input'; 4 | -------------------------------------------------------------------------------- /src/modules/category/dto/update-category.input.ts: -------------------------------------------------------------------------------- 1 | import { InputType, PartialType } from '@nestjs/graphql'; 2 | import { CreateCategoryInput } from './create-category.input'; 3 | 4 | @InputType() 5 | export class UpdateCategoryInput extends PartialType(CreateCategoryInput) {} 6 | -------------------------------------------------------------------------------- /src/modules/post/dto/create-post.input.ts: -------------------------------------------------------------------------------- 1 | import { CreateCategoryInput } from '@modules/category/dto/create-category.input'; 2 | import { Field, InputType } from '@nestjs/graphql'; 3 | import { ArrayUnique, IsNotEmpty, IsOptional, IsString } from 'class-validator'; 4 | 5 | @InputType() 6 | export class CreatePostInput { 7 | @Field(() => String) 8 | @IsString() 9 | @IsNotEmpty() 10 | title: string; 11 | 12 | @Field(() => String) 13 | @IsString() 14 | @IsNotEmpty() 15 | content: string; 16 | 17 | @Field(() => Boolean, { nullable: true }) 18 | published?: boolean; 19 | 20 | @Field(() => [CreateCategoryInput], { nullable: true }) 21 | @ArrayUnique() 22 | @IsOptional() 23 | categories?: CreateCategoryInput[]; 24 | } 25 | -------------------------------------------------------------------------------- /src/modules/post/dto/index.ts: -------------------------------------------------------------------------------- 1 | export { CreatePostInput } from './create-post.input'; 2 | export { UpdatePostInput } from './update-post.input'; 3 | -------------------------------------------------------------------------------- /src/modules/post/dto/update-post.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | 3 | @InputType() 4 | export class UpdatePostInput { 5 | @Field(() => String, { nullable: true }) 6 | title?: string; 7 | 8 | @Field(() => String, { nullable: true }) 9 | content?: string; 10 | 11 | @Field(() => Boolean, { nullable: true }) 12 | published?: boolean; 13 | } 14 | -------------------------------------------------------------------------------- /src/modules/post/guard/author.guard.ts: -------------------------------------------------------------------------------- 1 | import { PostWhereUniqueInput } from '@common/@generated/post'; 2 | import { IRequestWithUser } from '@common/global-interfaces'; 3 | import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; 4 | import { GqlExecutionContext } from '@nestjs/graphql'; 5 | import { PostService } from '../post.service'; 6 | 7 | @Injectable() 8 | export class AuthorGuard implements CanActivate { 9 | constructor(private readonly postService: PostService) {} 10 | public async canActivate(context: ExecutionContext) { 11 | const gqlContext = GqlExecutionContext.create(context); 12 | const req = gqlContext.getContext().req as IRequestWithUser; 13 | 14 | const where: PostWhereUniqueInput | undefined = context.getArgByIndex(1) 15 | ?.where; 16 | if (!(req.user && where)) { 17 | return false; 18 | } 19 | 20 | const article = await this.postService.getPost(where); 21 | return Boolean(article && article.authorId == req.user.id); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/post/post.model.ts: -------------------------------------------------------------------------------- 1 | import { Field, ObjectType } from '@nestjs/graphql'; 2 | import { User } from '@modules/user/user.model'; 3 | import { BaseModel } from '@common/abstract-model/base.model'; 4 | import { Category } from '@modules/category/category.model'; 5 | 6 | @ObjectType('post') 7 | export class Post extends BaseModel { 8 | @Field(() => String, { nullable: false }) 9 | title: string; 10 | 11 | @Field(() => String, { nullable: false }) 12 | content: string; 13 | 14 | @Field(() => String, { nullable: false }) 15 | slug: string; 16 | 17 | @Field(() => String, { defaultValue: true }) 18 | published: boolean; 19 | 20 | @Field(() => User, { nullable: true }) 21 | author?: User; 22 | 23 | @Field(() => [Category], { nullable: true }) 24 | categories?: Category[]; 25 | } 26 | -------------------------------------------------------------------------------- /src/modules/post/post.module.ts: -------------------------------------------------------------------------------- 1 | import { CategoryService } from '@modules/category/category.service'; 2 | import { PrismaSelectService } from 'src/providers/prisma/prisma-select.service'; 3 | import { PrismaService } from 'src/providers/prisma/prisma.service'; 4 | import { Module } from '@nestjs/common'; 5 | import { PostResolver } from './post.resolver'; 6 | import { PostService } from './post.service'; 7 | 8 | @Module({ 9 | providers: [ 10 | PostService, 11 | PostResolver, 12 | PrismaService, 13 | CategoryService, 14 | PrismaSelectService 15 | ] 16 | }) 17 | export class PostModule {} 18 | -------------------------------------------------------------------------------- /src/modules/post/test/author.guard.spec.ts: -------------------------------------------------------------------------------- 1 | import { AuthorGuard } from '../guard/author.guard'; 2 | 3 | describe('AuthorGuard', () => { 4 | it('Should be defined', () => { 5 | const { PostService } = jest.createMockFromModule( 6 | '@modules/post/post.service.ts' 7 | ); 8 | expect(new AuthorGuard(new PostService())).toBeDefined(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/modules/profile/dto/create-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { Field, InputType } from '@nestjs/graphql'; 2 | import { Matches } from 'class-validator'; 3 | 4 | @InputType() 5 | export class CreateProfileInput { 6 | @Field(() => String) 7 | @Matches(/^[a-zA-Z0-9_-]{2,20}$/) 8 | username: string; 9 | 10 | @Field(() => String, { nullable: true }) 11 | firstName?: string; 12 | 13 | @Field(() => String, { nullable: true }) 14 | lastName?: string; 15 | 16 | @Field(() => String, { nullable: true }) 17 | bio?: string; 18 | } 19 | -------------------------------------------------------------------------------- /src/modules/profile/dto/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create-profile.input'; 2 | export * from './update-profile.input'; 3 | -------------------------------------------------------------------------------- /src/modules/profile/dto/update-profile.input.ts: -------------------------------------------------------------------------------- 1 | import { InputType, PartialType } from '@nestjs/graphql'; 2 | import { CreateProfileInput } from './create-profile.input'; 3 | 4 | @InputType() 5 | export class UpdateProfileInput extends PartialType(CreateProfileInput) {} 6 | -------------------------------------------------------------------------------- /src/modules/profile/profile.model.ts: -------------------------------------------------------------------------------- 1 | import { BaseModel } from '@common/abstract-model/base.model'; 2 | import { User } from '@modules/user/user.model'; 3 | import { Field, ObjectType } from '@nestjs/graphql'; 4 | 5 | @ObjectType('profile') 6 | export class Profile extends BaseModel { 7 | @Field(() => String, { nullable: true }) 8 | username!: string; 9 | 10 | @Field(() => String, { nullable: true }) 11 | firstName?: string; 12 | 13 | @Field(() => String, { nullable: true }) 14 | lastName?: string; 15 | 16 | @Field(() => String, { nullable: true }) 17 | bio?: string; 18 | 19 | @Field(() => User, { nullable: true }) 20 | user?: User; 21 | } 22 | -------------------------------------------------------------------------------- /src/modules/profile/profile.module.ts: -------------------------------------------------------------------------------- 1 | import { PrismaSelectService } from 'src/providers/prisma/prisma-select.service'; 2 | import { PrismaService } from 'src/providers/prisma/prisma.service'; 3 | import { Module } from '@nestjs/common'; 4 | import { ProfileResolver } from './profile.resolver'; 5 | import { ProfileService } from './profile.service'; 6 | 7 | @Module({ 8 | providers: [ 9 | ProfileService, 10 | ProfileResolver, 11 | PrismaService, 12 | PrismaSelectService 13 | ] 14 | }) 15 | export class ProfileModule {} 16 | -------------------------------------------------------------------------------- /src/modules/user/decorators/index.ts: -------------------------------------------------------------------------------- 1 | export { Roles } from './roles.decorator'; 2 | export { CurrentUser } from './user.decorator'; 3 | export { UserExitsValidator } from './user-exists.validator'; 4 | -------------------------------------------------------------------------------- /src/modules/user/decorators/roles.decorator.ts: -------------------------------------------------------------------------------- 1 | import { SetMetadata } from '@nestjs/common'; 2 | import { Role } from '@prisma/client'; 3 | 4 | export const Roles = (...roles: Array) => SetMetadata('roles', roles); 5 | -------------------------------------------------------------------------------- /src/modules/user/decorators/user-exists.validator.ts: -------------------------------------------------------------------------------- 1 | import { UserWhereUniqueInput } from '@common/@generated/user'; 2 | import { Injectable } from '@nestjs/common'; 3 | import { 4 | ValidatorConstraint, 5 | ValidationArguments, 6 | ValidatorConstraintInterface 7 | } from 'class-validator'; 8 | import { UserService } from '../services/user.service'; 9 | 10 | @ValidatorConstraint({ name: 'user', async: true }) 11 | @Injectable() 12 | export class UserExitsValidator implements ValidatorConstraintInterface { 13 | constructor(private readonly userService: UserService) {} 14 | 15 | /** 16 | * Method should return true, if name is not taken 17 | */ 18 | public async validate(email: string, _args: ValidationArguments) { 19 | const where: UserWhereUniqueInput = { 20 | email 21 | }; 22 | try { 23 | const check = await this.userService.getUserByUniqueInput(where); 24 | return !check; 25 | } catch (error) { 26 | return true; 27 | } 28 | } 29 | defaultMessage(_args: ValidationArguments) { 30 | return 'User with $property $value already exists'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/modules/user/dto/change-password.input.ts: -------------------------------------------------------------------------------- 1 | import { InputType, Field } from '@nestjs/graphql'; 2 | import { IsNotEmpty, MinLength } from 'class-validator'; 3 | 4 | @InputType() 5 | export class ChangePasswordInput { 6 | @Field() 7 | @IsNotEmpty() 8 | @MinLength(3) 9 | oldPassword: string; 10 | 11 | @Field() 12 | @IsNotEmpty() 13 | @MinLength(3) 14 | newPassword: string; 15 | 16 | @Field() 17 | @IsNotEmpty() 18 | token: string; 19 | } 20 | -------------------------------------------------------------------------------- /src/modules/user/dto/create-user.input.ts: -------------------------------------------------------------------------------- 1 | import { ProfileCreateOneWithoutUserInput } from '@common/@generated/profile'; 2 | import { Field, InputType } from '@nestjs/graphql'; 3 | 4 | @InputType() 5 | export class CreateUserInput { 6 | @Field(() => String, { 7 | nullable: false 8 | }) 9 | email!: string; 10 | 11 | @Field(() => String, { 12 | nullable: false 13 | }) 14 | password!: string; 15 | 16 | @Field(() => ProfileCreateOneWithoutUserInput, { 17 | nullable: true 18 | }) 19 | profile?: ProfileCreateOneWithoutUserInput; 20 | } 21 | -------------------------------------------------------------------------------- /src/modules/user/dto/index.ts: -------------------------------------------------------------------------------- 1 | export { ChangePasswordInput } from './change-password.input'; 2 | export { UpdateUserInput } from './update-user.input'; 3 | export { CreateUserInput } from './create-user.input'; 4 | -------------------------------------------------------------------------------- /src/modules/user/dto/update-user.input.ts: -------------------------------------------------------------------------------- 1 | import { ProfileUpdateOneWithoutUserInput } from '@common/@generated/profile'; 2 | import { InputType, Field } from '@nestjs/graphql'; 3 | import { IsEmail, IsOptional, IsString, MinLength } from 'class-validator'; 4 | 5 | @InputType() 6 | export class UpdateUserInput { 7 | @Field(() => String, { nullable: true }) 8 | @IsEmail() 9 | @IsOptional() 10 | email?: string; 11 | 12 | @Field(() => String, { nullable: true }) 13 | @IsOptional() 14 | @MinLength(3) 15 | password?: string; 16 | 17 | @Field(() => ProfileUpdateOneWithoutUserInput, { 18 | nullable: true 19 | }) 20 | profile?: ProfileUpdateOneWithoutUserInput; 21 | 22 | @Field(() => String, { nullable: true }) 23 | @IsOptional() 24 | @IsString() 25 | currentHashedRefreshToken?: string; 26 | } 27 | -------------------------------------------------------------------------------- /src/modules/user/user.model.ts: -------------------------------------------------------------------------------- 1 | import { BaseModel } from '@common/abstract-model/base.model'; 2 | import { Post } from '@modules/post/post.model'; 3 | import { Profile } from '@modules/profile/profile.model'; 4 | import { 5 | ObjectType, 6 | Field, 7 | HideField, 8 | registerEnumType 9 | } from '@nestjs/graphql'; 10 | 11 | import { Role } from './user.types'; 12 | 13 | registerEnumType(Role, { 14 | name: 'Role', 15 | description: 'User role' 16 | }); 17 | @ObjectType('user') 18 | export class User extends BaseModel { 19 | @Field(() => String, { nullable: false }) 20 | email: string; 21 | 22 | @Field(() => String, { defaultValue: Role.USER }) 23 | role: string; 24 | 25 | @Field(() => [Post], { nullable: true }) 26 | posts?: Post[]; 27 | 28 | @Field(() => Profile, { nullable: true }) 29 | profile?: Profile; 30 | 31 | @HideField() 32 | password: string; 33 | 34 | @HideField() 35 | currentHashedRefreshToken?: string; 36 | } 37 | -------------------------------------------------------------------------------- /src/modules/user/user.module.ts: -------------------------------------------------------------------------------- 1 | import { PrismaService } from 'src/providers/prisma/prisma.service'; 2 | import { Module } from '@nestjs/common'; 3 | import { PasswordService } from '../auth/services/password.service'; 4 | import { UserService } from './services/user.service'; 5 | import { UserResolver } from './resolvers/user.resolver'; 6 | import { AdminResolver } from './resolvers/admin-user.resolver'; 7 | import { PrismaSelectService } from 'src/providers/prisma/prisma-select.service'; 8 | import { PrismaModule } from 'src/providers/prisma/prisma.module'; 9 | import { UserExitsValidator } from './decorators'; 10 | 11 | @Module({ 12 | imports: [PrismaModule], 13 | providers: [ 14 | UserService, 15 | PasswordService, 16 | PrismaService, 17 | UserResolver, 18 | AdminResolver, 19 | PrismaSelectService, 20 | UserExitsValidator 21 | ], 22 | exports: [PasswordService, UserService] 23 | }) 24 | export class UserModule {} 25 | -------------------------------------------------------------------------------- /src/modules/user/user.types.ts: -------------------------------------------------------------------------------- 1 | export enum Role { 2 | ADMIN = 'ADMIN', 3 | USER = 'USER' 4 | } 5 | -------------------------------------------------------------------------------- /src/providers/email/email.module.ts: -------------------------------------------------------------------------------- 1 | import { envConfig } from '@common/configs'; 2 | import { MailerModule } from '@nestjs-modules/mailer'; 3 | import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter'; 4 | import { Module } from '@nestjs/common'; 5 | import sendGridTransport from 'nodemailer-sendgrid-transport'; 6 | import { EmailService } from './email.service'; 7 | 8 | @Module({ 9 | imports: [ 10 | MailerModule.forRoot({ 11 | transport: sendGridTransport({ 12 | auth: { 13 | api_key: envConfig().email.sendgridApiKey 14 | } 15 | }), 16 | defaults: { 17 | from: `"No Reply" ` 18 | }, 19 | preview: envConfig().mode === 'development', 20 | template: { 21 | dir: process.cwd() + '/src/providers/email/templates', 22 | adapter: new HandlebarsAdapter(), 23 | options: { 24 | strict: true 25 | } 26 | } 27 | }) 28 | ], 29 | providers: [EmailService], 30 | exports: [EmailService] 31 | }) 32 | export class EmailModule {} 33 | -------------------------------------------------------------------------------- /src/providers/email/templates/email-confirmation.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Register 9 | 10 | 11 | 12 |

Thank you for your registration

13 |

Click to the link below to active your account.

14 |

15 | 16 | {{tokenUrl}} 17 | 18 |

19 | 20 |
21 |

Note: This link will expire in 2h

22 | 23 | 24 | -------------------------------------------------------------------------------- /src/providers/email/templates/reset-password.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Reset password 9 | 10 | 11 | 12 |

Reset password

13 |

Click to the link below to reset your password.

14 |

15 | 16 | {{tokenUrl}} 17 | 18 |

19 | 20 |
21 |

Note: This link will expire in 2h

22 | 23 | 24 | -------------------------------------------------------------------------------- /src/providers/email/templates/welcome.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Welcome 9 | 10 | 11 | 12 |

Welcome to our website: 13 | 14 | Bookstore 15 | 16 |

17 |

Thank you so much for your registration

18 | 19 | 20 | -------------------------------------------------------------------------------- /src/providers/prisma/prisma-select.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common'; 2 | import { PrismaSelect } from '@paljs/plugins'; 3 | import { GraphQLResolveInfo } from 'graphql'; 4 | 5 | @Injectable() 6 | export class PrismaSelectService { 7 | public getValue(info: GraphQLResolveInfo) { 8 | if (info) { 9 | return new PrismaSelect(info).value; 10 | } 11 | return {}; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/providers/prisma/prisma.module.ts: -------------------------------------------------------------------------------- 1 | import { Module } from '@nestjs/common'; 2 | import { PrismaSelectService } from './prisma-select.service'; 3 | import { PrismaService } from './prisma.service'; 4 | 5 | @Module({ 6 | providers: [PrismaService, PrismaSelectService], 7 | exports: [PrismaService, PrismaSelectService] 8 | }) 9 | export class PrismaModule {} 10 | -------------------------------------------------------------------------------- /src/providers/prisma/prisma.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common'; 2 | import { PrismaClient } from '@prisma/client'; 3 | 4 | @Injectable() 5 | export class PrismaService 6 | extends PrismaClient 7 | implements OnModuleInit, OnModuleDestroy { 8 | constructor() { 9 | super({ 10 | log: ['query', 'info', `warn`, `error`] 11 | }); 12 | } 13 | async onModuleInit() { 14 | await this.$connect(); 15 | } 16 | 17 | async onModuleDestroy() { 18 | await this.$disconnect(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/providers/redis/interfaces/index.ts: -------------------------------------------------------------------------------- 1 | export * from './redis.interface'; 2 | -------------------------------------------------------------------------------- /src/providers/redis/interfaces/redis.interface.ts: -------------------------------------------------------------------------------- 1 | import { RedisOptions } from 'ioredis'; 2 | import { ModuleMetadata, Type } from '@nestjs/common'; 3 | 4 | export interface RedisModuleAsyncOptions 5 | extends Pick { 6 | inject?: any[]; 7 | useClass?: Type; 8 | useExisting?: Type; 9 | useFactory?: ( 10 | ...args: any[] 11 | ) => Promise | RedisModuleOptions; 12 | } 13 | 14 | export interface RedisOptionsFactory { 15 | createRedisOptions(): Promise | RedisModuleOptions; 16 | } 17 | 18 | export interface RedisModuleOptions extends RedisOptions {} 19 | -------------------------------------------------------------------------------- /src/providers/redis/redis.constant.ts: -------------------------------------------------------------------------------- 1 | export const REDIS_CONFIRM_USER_PREFIX = 'user_confirmation:'; 2 | export const REDIS_FORGOT_PASSWORD_PREFIX = 'request_forgot_password:'; 3 | export const REDIS_AUTH_TOKEN_SESSION = 'auth_token_session'; 4 | export const REDIS_CONFIG_OPTS = 'redis_config_opts'; 5 | -------------------------------------------------------------------------------- /src/providers/redis/redis.module.ts: -------------------------------------------------------------------------------- 1 | import { Global, Module } from '@nestjs/common'; 2 | import { RedisService } from './redis.service'; 3 | 4 | @Global() 5 | @Module({ 6 | providers: [RedisService], 7 | exports: [RedisService] 8 | }) 9 | export class RedisModule {} 10 | -------------------------------------------------------------------------------- /test/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Test, TestingModule } from '@nestjs/testing'; 2 | import { INestApplication } from '@nestjs/common'; 3 | import request from 'supertest'; 4 | import { AppModule } from './../src/app.module'; 5 | 6 | describe('AppController (e2e)', () => { 7 | let app: INestApplication; 8 | 9 | beforeEach(async () => { 10 | const moduleFixture: TestingModule = await Test.createTestingModule({ 11 | imports: [AppModule] 12 | }).compile(); 13 | 14 | app = moduleFixture.createNestApplication(); 15 | await app.init(); 16 | }); 17 | 18 | it('/ (GET)', () => { 19 | return request(app.getHttpServer()) 20 | .get('/') 21 | .expect(200) 22 | .expect('Hello World!'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": "../", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | }, 9 | "moduleNameMapper": { 10 | "@common/(.*)": "/src/common/$1", 11 | "@modules/(.*)": "/src/modules/$1", 12 | "@app/(.*)": "/src/app/$1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esNext", 4 | "typeRoots": ["./node_modules/@types", "src/@types"], 5 | "types": ["jest", "node"], 6 | "module": "commonjs", 7 | "pretty": true, 8 | "sourceMap": true, 9 | "importHelpers": true, 10 | "strict": true, 11 | "noImplicitAny": false, 12 | "strictNullChecks": false, 13 | "noImplicitThis": true, 14 | "alwaysStrict": true, 15 | "noUnusedParameters": false, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "moduleResolution": "node", 19 | "allowSyntheticDefaultImports": true, 20 | "experimentalDecorators": true, 21 | "emitDecoratorMetadata": true, 22 | "resolveJsonModule": true, 23 | "esModuleInterop": true, 24 | 25 | "forceConsistentCasingInFileNames": true, 26 | "outDir": "./dist", 27 | "allowJs": true, 28 | "noEmit": false, 29 | "baseUrl": ".", 30 | "paths": { 31 | "@modules/*": ["src/modules/*"], 32 | "@providers/*": ["src/providers/*"], 33 | "@common/*": ["src/common/*"], 34 | "@app/*": ["src/app/*"] 35 | } 36 | }, 37 | "include": ["src", "prisma", "test"], 38 | "exclude": ["node_modules"] 39 | } 40 | -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist-test" 5 | }, 6 | "include": ["src", "test"] 7 | } 8 | --------------------------------------------------------------------------------