diff --git a/backend/eslint.config.ts b/backend/eslint.config.ts index 646e6bc3c..acb317170 100644 --- a/backend/eslint.config.ts +++ b/backend/eslint.config.ts @@ -1,73 +1,62 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ -import comments from 'eslint-config-it4c/modules/comments' -import eslint from 'eslint-config-it4c/modules/eslint' -import importX from 'eslint-config-it4c/modules/import-x' +/* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +import config from 'eslint-config-it4c' +import graphql from 'eslint-config-it4c/modules/graphql' import jest from 'eslint-config-it4c/modules/jest' -import json from 'eslint-config-it4c/modules/json' -import node from 'eslint-config-it4c/modules/node' -import prettier from 'eslint-config-it4c/modules/prettier' -import promise from 'eslint-config-it4c/modules/promise' -import security from 'eslint-config-it4c/modules/security' -import typescript from 'eslint-config-it4c/modules/typescript' -import yaml from 'eslint-config-it4c/modules/yaml' - -// TODO: GraphQL linting is disabled because @graphql-eslint/eslint-plugin v4 -// (bundled with eslint-config-it4c) requires graphql@^16, but the backend -// uses graphql@^14 (required by apollo-server v2). Re-enable when upgrading graphql. -// import graphql from 'eslint-config-it4c/modules/graphql' -// -// ...graphql.map((c) => ({ -// ...c, -// files: ['**/*.graphql', '**/*.gql'], -// })), -// { -// files: ['**/*.graphql', '**/*.gql'], -// languageOptions: { -// parserOptions: { -// schema: './src/graphql/types/**/*.gql', -// assumeValid: true, -// }, -// }, -// rules: { -// '@graphql-eslint/require-description': 'off', -// '@graphql-eslint/naming-convention': 'off', -// '@graphql-eslint/strict-id-in-types': 'off', -// '@graphql-eslint/no-typename-prefix': 'off', -// '@graphql-eslint/known-directives': 'off', -// '@graphql-eslint/known-argument-names': 'off', -// '@graphql-eslint/known-type-names': 'off', -// '@graphql-eslint/lone-schema-definition': 'off', -// '@graphql-eslint/provided-required-arguments': 'off', -// '@graphql-eslint/unique-directive-names': 'off', -// '@graphql-eslint/unique-directive-names-per-location': 'off', -// '@graphql-eslint/unique-field-definition-names': 'off', -// '@graphql-eslint/unique-operation-types': 'off', -// '@graphql-eslint/unique-type-names': 'off', -// }, -// }, export default [ { ignores: ['node_modules/', 'build/', 'coverage/'], }, - ...eslint, - ...typescript, - ...importX, - ...node, - ...promise, - ...security, - ...comments, - ...json, - ...yaml, - ...prettier, + ...config, ...jest, + // GraphQL schema linting (extend file pattern to include .gql) + ...graphql.map((c) => ({ + ...c, + files: ['**/*.graphql', '**/*.gql'], + })), + { + files: ['**/*.graphql', '**/*.gql'], + // TODO: Parser must be set explicitly because the it4c module only provides + // plugins and rules, not languageOptions. Without this, ESLint uses the JS + // parser for .gql files. Remove when fixed in eslint-config-it4c. + languageOptions: { + parser: graphql[0].plugins['@graphql-eslint'].parser, + parserOptions: { + graphQLConfig: { + schema: './src/graphql/types/**/*.gql', + documents: './src/graphql/queries/**/*.gql', + }, + }, + }, + rules: { + // Would require descriptions on every type/field/input — too noisy for now + '@graphql-eslint/require-description': 'off', + // camelCase operation names and _id/_ne underscores conflict with existing schema + '@graphql-eslint/naming-convention': 'off', + // Many types (Image, File, InviteCode, etc.) intentionally lack id: ID! + '@graphql-eslint/strict-id-in-types': 'off', + // Fields like groupType, queryLocations match parent type name by coincidence + '@graphql-eslint/no-typename-prefix': 'off', + // neo4j-graphql-js adds arguments (first, offset) at runtime not present in static schema + '@graphql-eslint/known-argument-names': 'off', + // TODO: operations-recommended rules must be disabled because the it4c + // graphql module bundles both schema and operations configs together. + // Remove when eslint-config-it4c exports them separately (e.g. graphql/schema). + '@graphql-eslint/executable-definitions': 'off', + // neo4j-graphql-js adds fields at runtime (_id, relations) not present in static schema + '@graphql-eslint/fields-on-correct-type': 'off', + }, + }, { // Backend-specific TypeScript overrides files: ['**/*.ts'], languageOptions: { parserOptions: { projectService: { - allowDefaultProject: ['eslint.config.ts'], + allowDefaultProject: ['eslint.config.ts', 'jest.config.ts', 'prettier.config.ts'], }, tsconfigRootDir: import.meta.dirname, }, diff --git a/backend/jest.config.cjs b/backend/jest.config.cjs deleted file mode 100644 index 1cbc054df..000000000 --- a/backend/jest.config.cjs +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable import-x/no-commonjs */ -const requireJSON5 = require('require-json5') -const { pathsToModuleNameMapper } = require('ts-jest') - -const { compilerOptions } = requireJSON5('./tsconfig.json') - -module.exports = { - verbose: true, - preset: 'ts-jest', - collectCoverage: true, - collectCoverageFrom: [ - '**/*.ts', - '!**/node_modules/**', - '!**/test/**', - '!**/build/**', - '!**/src/**/?(*.)+(spec|test).ts?(x)', - '!**/src/db/**', - '!eslint.config.ts', - ], - coverageThreshold: { - global: { - lines: 93, - }, - }, - testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'], - setupFilesAfterEnv: ['/test/setup.ts'], - moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '/' }), -} diff --git a/backend/jest.config.ts b/backend/jest.config.ts new file mode 100644 index 000000000..5174bf589 --- /dev/null +++ b/backend/jest.config.ts @@ -0,0 +1,40 @@ +import { readFileSync } from 'node:fs' + +import { pathsToModuleNameMapper } from 'ts-jest' +import { parseConfigFileTextToJson } from 'typescript' + +// eslint-disable-next-line n/no-sync -- config files are synchronous by nature +const tsconfigText = readFileSync('./tsconfig.json', 'utf-8') +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- parseConfigFileTextToJson returns untyped config +const { config } = parseConfigFileTextToJson('tsconfig.json', tsconfigText) +const paths = (config as { compilerOptions: { paths: Record } }).compilerOptions + .paths + +export default { + verbose: true, + preset: 'ts-jest', + collectCoverage: true, + collectCoverageFrom: [ + '**/*.ts', + '!**/node_modules/**', + '!**/test/**', + '!**/build/**', + '!**/src/**/?(*.)+(spec|test).ts?(x)', + '!**/src/db/**', + '!*.config.ts', + '!**/*.d.ts', + '!**/gql-register.ts', + ], + coverageThreshold: { + global: { + lines: 93, + }, + }, + testMatch: ['**/src/**/?(*.)+(spec|test).ts?(x)'], + setupFilesAfterEnv: ['/test/setup.ts'], + transform: { + '\\.gql$': '/test/graphqlTransform.ts', + '\\.tsx?$': 'ts-jest', + }, + moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '/' }), +} diff --git a/backend/package.json b/backend/package.json index b7f406b35..170e57def 100644 --- a/backend/package.json +++ b/backend/package.json @@ -10,20 +10,20 @@ "scripts": { "start": "node build/src/", "build": "tsc && tsc-alias && ./scripts/build.copy.files.sh", - "dev": "nodemon --exec ts-node --require tsconfig-paths/register src/index.ts -e js,ts,gql", + "dev": "nodemon --exec tsx src/index.ts -e js,ts,gql", "dev:debug": "nodemon --exec node --inspect=0.0.0.0:9229 build/src/index.js -e js,ts,gql", "lint": "eslint --max-warnings 0 .", "test": "cross-env NODE_ENV=test NODE_OPTIONS=--max-old-space-size=8192 jest --runInBand --coverage --forceExit --detectOpenHandles", - "db:reset": "ts-node --require tsconfig-paths/register src/db/reset.ts", - "db:reset:withmigrations": "ts-node --require tsconfig-paths/register src/db/reset-with-migrations.ts", - "db:seed": "ts-node --require tsconfig-paths/register src/db/seed.ts", - "db:data:admin": "ts-node --require tsconfig-paths/register src/db/admin.ts", - "db:data:badges": "ts-node --require tsconfig-paths/register src/db/badges.ts", - "db:data:branding": "ts-node --require tsconfig-paths/register src/db/data-branding.ts", - "db:data:categories": "ts-node --require tsconfig-paths/register src/db/categories.ts", + "db:reset": "tsx src/db/reset.ts", + "db:reset:withmigrations": "tsx src/db/reset-with-migrations.ts", + "db:seed": "tsx --require ./src/graphql/gql-register.ts src/db/seed.ts", + "db:data:admin": "tsx src/db/admin.ts", + "db:data:badges": "tsx src/db/badges.ts", + "db:data:branding": "tsx src/db/data-branding.ts", + "db:data:categories": "tsx src/db/categories.ts", "db:migrate": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --store ./src/db/migrate/store.ts", "db:migrate:create": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --template-file ./src/db/migrate/template.ts --date-format 'yyyymmddHHmmss' create", - "db:func:disable:notifications": "ts-node --require tsconfig-paths/register src/db/disable-notifications.ts", + "db:func:disable:notifications": "tsx src/db/disable-notifications.ts", "prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js", "prod:db:data:branding": "node build/src/db/data-branding.js", "prod:db:data:categories": "node build/src/db/categories.js", @@ -31,11 +31,13 @@ "prod:db:func:disable:notifications": "node build/src/db/disable-notifications.js" }, "dependencies": { + "@apollo/server": "^4.11.3", "@aws-sdk/client-s3": "^3.995.0", "@aws-sdk/lib-storage": "^3.990.0", + "@graphql-tools/load-files": "^7.0.0", + "@graphql-tools/merge": "^9.0.0", "@sentry/node": "^5.30.0", "@types/mime-types": "^3.0.1", - "@apollo/server": "^4.11.3", "bcryptjs": "~3.0.3", "body-parser": "^1.20.3", "cheerio": "~1.2.0", @@ -44,13 +46,12 @@ "email-templates": "^13.0.1", "express": "^4.22.1", "graphql": "^16.11.0", - "graphql-ws": "^5.16.2", "graphql-middleware": "~6.1.35", "graphql-redis-subscriptions": "^2.7.0", "graphql-shield": "^7.6.5", "graphql-subscriptions": "^2.0.0", - "graphql-tag": "^2.12.6", "graphql-upload": "^13.0.0", + "graphql-ws": "^5.16.2", "helmet": "~8.1.0", "ioredis": "^5.9.3", "jsonwebtoken": "~8.5.1", @@ -58,8 +59,6 @@ "linkify-html": "^4.3.2", "linkifyjs": "^4.3.2", "lodash": "~4.17.23", - "@graphql-tools/load-files": "^7.0.0", - "@graphql-tools/merge": "^9.0.0", "metascraper": "^5.49.24", "metascraper-author": "^5.49.24", "metascraper-date": "^5.49.24", @@ -88,11 +87,11 @@ "pug": "^3.0.3", "sanitize-html": "~2.17.1", "slugify": "^1.6.6", + "subscriptions-transport-ws": "^0.11.0", "trunc-html": "~1.1.2", "tslog": "^4.10.2", "uuid": "~9.0.1", "validator": "^13.15.26", - "subscriptions-transport-ws": "^0.11.0", "ws": "^8.18.2", "xregexp": "^5.1.2" }, @@ -112,12 +111,10 @@ "jest": "^30.2.0", "nodemon": "~3.1.14", "prettier": "^3.8.1", - "require-json5": "^1.3.0", "rosie": "^2.1.1", "ts-jest": "^29.4.6", - "ts-node": "^10.9.2", "tsc-alias": "^1.8.16", - "tsconfig-paths": "^4.2.0", + "tsx": "^4.21.0", "typescript": "^5.8.3" }, "resolutions": { diff --git a/backend/prettier.config.mjs b/backend/prettier.config.ts similarity index 100% rename from backend/prettier.config.mjs rename to backend/prettier.config.ts diff --git a/backend/src/db/compiler.ts b/backend/src/db/compiler.ts index 1770f5ee2..040e7120f 100644 --- a/backend/src/db/compiler.ts +++ b/backend/src/db/compiler.ts @@ -1,10 +1,8 @@ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-require-imports */ /* eslint-disable import-x/no-commonjs */ // eslint-disable-next-line n/no-unpublished-require -const tsNode = require('ts-node') -// eslint-disable-next-line import-x/no-unassigned-import, n/no-unpublished-require -require('tsconfig-paths/register') +const tsx = require('tsx/cjs/api') -module.exports = tsNode.register +module.exports = tsx.register diff --git a/backend/src/db/seed.ts b/backend/src/db/seed.ts index 107a787e2..4b14c6947 100644 --- a/backend/src/db/seed.ts +++ b/backend/src/db/seed.ts @@ -11,13 +11,13 @@ import sample from 'lodash/sample' import CONFIG from '@config/index' import { categories } from '@constants/categories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreateMessage } from '@graphql/queries/CreateMessage' -import { CreatePost } from '@graphql/queries/CreatePost' -import { CreateRoom } from '@graphql/queries/CreateRoom' -import { JoinGroup } from '@graphql/queries/JoinGroup' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql' +import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import Factory from './factories' diff --git a/backend/src/graphql.d.ts b/backend/src/graphql.d.ts new file mode 100644 index 000000000..394aa393f --- /dev/null +++ b/backend/src/graphql.d.ts @@ -0,0 +1,6 @@ +declare module '*.gql' { + import type { DocumentNode } from 'graphql' + + const value: DocumentNode + export default value +} diff --git a/backend/src/graphql/gql-register.ts b/backend/src/graphql/gql-register.ts new file mode 100644 index 000000000..ca343ef9b --- /dev/null +++ b/backend/src/graphql/gql-register.ts @@ -0,0 +1,21 @@ +/* eslint-disable n/no-sync, security/detect-non-literal-fs-filename */ +// Register a require hook for .gql files so they can be imported at runtime. +// Jest uses its own graphqlTransform.ts for this; this hook covers tsx/node usage +// (e.g. db:seed). +import { readFileSync } from 'node:fs' +import Module from 'node:module' + +import { parse } from 'graphql' + +// @ts-expect-error -- require.extensions is deprecated but still functional for CJS hooks +// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access +Module._extensions['.gql'] = function (_module: typeof module, filename: string) { + const content = readFileSync(filename, 'utf-8') + try { + _module.exports = parse(content) + } catch (error: unknown) { + throw new Error( + `Failed to parse ${filename}: ${error instanceof Error ? error.message : String(error)}`, + ) + } +} diff --git a/backend/src/graphql/queries/AddEmailAddress.ts b/backend/src/graphql/queries/AddEmailAddress.ts deleted file mode 100644 index dcf81039a..000000000 --- a/backend/src/graphql/queries/AddEmailAddress.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const AddEmailAddress = gql` - mutation ($email: String!) { - AddEmailAddress(email: $email) { - email - verifiedAt - createdAt - } - } -` diff --git a/backend/src/graphql/queries/AddPostEmotions.ts b/backend/src/graphql/queries/AddPostEmotions.ts deleted file mode 100644 index 5a0629e17..000000000 --- a/backend/src/graphql/queries/AddPostEmotions.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { gql } from 'graphql-tag' - -export const AddPostEmotions = gql` - mutation ($to: _PostInput!, $data: _EMOTEDInput!) { - AddPostEmotions(to: $to, data: $data) { - from { - id - } - to { - id - } - emotion - } - } -` diff --git a/backend/src/graphql/queries/Category.gql b/backend/src/graphql/queries/Category.gql new file mode 100644 index 000000000..3b49e442e --- /dev/null +++ b/backend/src/graphql/queries/Category.gql @@ -0,0 +1,8 @@ +query Category { + Category { + id + slug + name + icon + } +} diff --git a/backend/src/graphql/queries/Category.ts b/backend/src/graphql/queries/Category.ts deleted file mode 100644 index 52280c3cd..000000000 --- a/backend/src/graphql/queries/Category.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Category = gql` - query { - Category { - id - slug - name - icon - } - } -` diff --git a/backend/src/graphql/queries/ChangeGroupMemberRole.ts b/backend/src/graphql/queries/ChangeGroupMemberRole.ts deleted file mode 100644 index fbb6335e6..000000000 --- a/backend/src/graphql/queries/ChangeGroupMemberRole.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const ChangeGroupMemberRole = gql` - mutation ($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) { - ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) { - user { - id - name - slug - } - membership { - role - } - } - } -` diff --git a/backend/src/graphql/queries/CreateComment.ts b/backend/src/graphql/queries/CreateComment.ts deleted file mode 100644 index 993943c98..000000000 --- a/backend/src/graphql/queries/CreateComment.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreateComment = gql` - mutation ($id: ID, $postId: ID!, $content: String!) { - CreateComment(id: $id, postId: $postId, content: $content) { - id - content - author { - name - } - isPostObservedByMe - postObservingUsersCount - } - } -` diff --git a/backend/src/graphql/queries/CreateGroup.ts b/backend/src/graphql/queries/CreateGroup.ts deleted file mode 100644 index ecfca4858..000000000 --- a/backend/src/graphql/queries/CreateGroup.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreateGroup = gql` - mutation ( - $id: ID - $name: String! - $slug: String - $about: String - $description: String! - $groupType: GroupType! - $actionRadius: GroupActionRadius! - $categoryIds: [ID] - $locationName: String # empty string '' sets it to null - ) { - CreateGroup( - id: $id - name: $name - slug: $slug - about: $about - description: $description - groupType: $groupType - actionRadius: $actionRadius - categoryIds: $categoryIds - locationName: $locationName - ) { - id - name - slug - createdAt - updatedAt - disabled - deleted - about - description - descriptionExcerpt - groupType - actionRadius - categories { - id - slug - name - icon - } - locationName - location { - name - nameDE - nameEN - } - myRole - } - } -` diff --git a/backend/src/graphql/queries/CreateMessage.ts b/backend/src/graphql/queries/CreateMessage.ts deleted file mode 100644 index 187bbfeee..000000000 --- a/backend/src/graphql/queries/CreateMessage.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreateMessage = gql` - mutation ($roomId: ID!, $content: String!, $files: [FileInput]) { - CreateMessage(roomId: $roomId, content: $content, files: $files) { - id - content - senderId - username - avatar - date - saved - distributed - seen - files { - url - name - type - } - } - } -` diff --git a/backend/src/graphql/queries/CreatePost.ts b/backend/src/graphql/queries/CreatePost.ts deleted file mode 100644 index bdcfe52ec..000000000 --- a/backend/src/graphql/queries/CreatePost.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreatePost = gql` - mutation ( - $id: ID - $title: String! - $slug: String - $content: String! - $categoryIds: [ID] - $groupId: ID - $postType: PostType - $eventInput: _EventInput - ) { - CreatePost( - id: $id - title: $title - slug: $slug - content: $content - categoryIds: $categoryIds - groupId: $groupId - postType: $postType - eventInput: $eventInput - ) { - id - slug - title - content - disabled - deleted - postType - author { - name - } - categories { - id - } - eventStart - eventEnd - eventLocationName - eventVenue - eventIsOnline - eventLocation { - lng - lat - } - isObservedByMe - observingUsersCount - language - } - } -` diff --git a/backend/src/graphql/queries/CreateRoom.ts b/backend/src/graphql/queries/CreateRoom.ts deleted file mode 100644 index 47dbfd006..000000000 --- a/backend/src/graphql/queries/CreateRoom.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreateRoom = gql` - mutation ($userId: ID!) { - CreateRoom(userId: $userId) { - id - roomId - roomName - lastMessageAt - unreadCount - #avatar - users { - _id - id - name - avatar { - url - } - } - } - } -` diff --git a/backend/src/graphql/queries/CreateSocialMedia.ts b/backend/src/graphql/queries/CreateSocialMedia.ts deleted file mode 100644 index f80ef059a..000000000 --- a/backend/src/graphql/queries/CreateSocialMedia.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { gql } from 'graphql-tag' - -export const CreateSocialMedia = gql` - mutation ($url: String!) { - CreateSocialMedia(url: $url) { - id - url - ownedBy { - name - } - } - } -` diff --git a/backend/src/graphql/queries/DeleteComment.ts b/backend/src/graphql/queries/DeleteComment.ts deleted file mode 100644 index 4a6e0df54..000000000 --- a/backend/src/graphql/queries/DeleteComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from 'graphql-tag' - -export const DeleteComment = gql` - mutation ($id: ID!) { - DeleteComment(id: $id) { - id - content - contentExcerpt - deleted - } - } -` diff --git a/backend/src/graphql/queries/DeletePost.ts b/backend/src/graphql/queries/DeletePost.ts deleted file mode 100644 index 76b430d7e..000000000 --- a/backend/src/graphql/queries/DeletePost.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { gql } from 'graphql-tag' - -export const DeletePost = gql` - mutation ($id: ID!) { - DeletePost(id: $id) { - id - deleted - content - contentExcerpt - image { - url - } - comments { - deleted - content - contentExcerpt - } - } - } -` diff --git a/backend/src/graphql/queries/DeleteSocialMedia.ts b/backend/src/graphql/queries/DeleteSocialMedia.ts deleted file mode 100644 index 6a37d4add..000000000 --- a/backend/src/graphql/queries/DeleteSocialMedia.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const DeleteSocialMedia = gql` - mutation ($id: ID!) { - DeleteSocialMedia(id: $id) { - id - url - } - } -` diff --git a/backend/src/graphql/queries/DeleteUser.ts b/backend/src/graphql/queries/DeleteUser.ts deleted file mode 100644 index 3a78c0ca0..000000000 --- a/backend/src/graphql/queries/DeleteUser.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { gql } from 'graphql-tag' - -export const DeleteUser = gql` - mutation ($id: ID!, $resource: [Deletable]) { - DeleteUser(id: $id, resource: $resource) { - id - name - about - deleted - contributions { - id - content - contentExcerpt - deleted - comments { - id - content - contentExcerpt - deleted - } - } - comments { - id - content - contentExcerpt - deleted - } - } - } -` diff --git a/backend/src/graphql/queries/Donations.ts b/backend/src/graphql/queries/Donations.ts deleted file mode 100644 index 223673f84..000000000 --- a/backend/src/graphql/queries/Donations.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Donations = gql` - query { - Donations { - id - showDonations - goal - progress - } - } -` diff --git a/backend/src/graphql/queries/Group.ts b/backend/src/graphql/queries/Group.ts deleted file mode 100644 index fb93c3e99..000000000 --- a/backend/src/graphql/queries/Group.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Group = gql` - query Group($isMember: Boolean, $id: ID, $slug: String) { - Group(isMember: $isMember, id: $id, slug: $slug) { - id - name - slug - createdAt - updatedAt - disabled - deleted - about - description - descriptionExcerpt - groupType - actionRadius - categories { - id - slug - name - icon - } - avatar { - url - } - locationName - location { - name - nameDE - nameEN - } - myRole - inviteCodes { - code - redeemedByCount - } - } - } -` diff --git a/backend/src/graphql/queries/GroupMembers.ts b/backend/src/graphql/queries/GroupMembers.ts deleted file mode 100644 index 1b87db85b..000000000 --- a/backend/src/graphql/queries/GroupMembers.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const GroupMembers = gql` - query GroupMembers($id: ID!) { - GroupMembers(id: $id) { - user { - id - name - slug - } - membership { - role - } - } - } -` diff --git a/backend/src/graphql/queries/JoinGroup.ts b/backend/src/graphql/queries/JoinGroup.ts deleted file mode 100644 index 55b4bba5d..000000000 --- a/backend/src/graphql/queries/JoinGroup.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const JoinGroup = gql` - mutation ($groupId: ID!, $userId: ID!) { - JoinGroup(groupId: $groupId, userId: $userId) { - user { - id - name - slug - } - membership { - role - } - } - } -` diff --git a/backend/src/graphql/queries/LeaveGroup.ts b/backend/src/graphql/queries/LeaveGroup.ts deleted file mode 100644 index 59bc17683..000000000 --- a/backend/src/graphql/queries/LeaveGroup.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const LeaveGroup = gql` - mutation ($groupId: ID!, $userId: ID!) { - LeaveGroup(groupId: $groupId, userId: $userId) { - user { - id - name - slug - } - membership { - role - } - } - } -` diff --git a/backend/src/graphql/queries/MarkMessagesAsSeen.ts b/backend/src/graphql/queries/MarkMessagesAsSeen.ts deleted file mode 100644 index a98258d95..000000000 --- a/backend/src/graphql/queries/MarkMessagesAsSeen.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const MarkMessagesAsSeen = gql` - mutation ($messageIds: [String!]) { - MarkMessagesAsSeen(messageIds: $messageIds) - } -` diff --git a/backend/src/graphql/queries/Message.ts b/backend/src/graphql/queries/Message.ts deleted file mode 100644 index 78c207fb5..000000000 --- a/backend/src/graphql/queries/Message.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Message = gql` - query ($roomId: ID!, $first: Int, $offset: Int) { - Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { - _id - id - indexId - content - senderId - author { - id - } - username - avatar - date - saved - distributed - seen - files { - url - name - type - } - } - } -` diff --git a/backend/src/graphql/queries/Post.ts b/backend/src/graphql/queries/Post.ts deleted file mode 100644 index 977c10cba..000000000 --- a/backend/src/graphql/queries/Post.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Post = gql` - query ($id: ID, $filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) { - Post(id: $id, filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { - id - title - content - contentExcerpt - eventStart - pinned - createdAt - pinnedAt - isObservedByMe - observingUsersCount - clickedCount - emotionsCount - emotions { - emotion - User { - id - } - } - author { - id - name - } - shoutedBy { - id - } - tags { - id - } - comments { - content - } - } - } -` diff --git a/backend/src/graphql/queries/PostsEmotionsByCurrentUser.ts b/backend/src/graphql/queries/PostsEmotionsByCurrentUser.ts deleted file mode 100644 index 39902b7ba..000000000 --- a/backend/src/graphql/queries/PostsEmotionsByCurrentUser.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const PostsEmotionsByCurrentUser = gql` - query ($postId: ID!) { - PostsEmotionsByCurrentUser(postId: $postId) - } -` diff --git a/backend/src/graphql/queries/PostsEmotionsCountByEmotion.ts b/backend/src/graphql/queries/PostsEmotionsCountByEmotion.ts deleted file mode 100644 index 55759ce48..000000000 --- a/backend/src/graphql/queries/PostsEmotionsCountByEmotion.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const PostsEmotionsCountByEmotion = gql` - query ($postId: ID!, $data: _EMOTEDInput!) { - PostsEmotionsCountByEmotion(postId: $postId, data: $data) - } -` diff --git a/backend/src/graphql/queries/RemovePostEmotions.ts b/backend/src/graphql/queries/RemovePostEmotions.ts deleted file mode 100644 index b27f5bf45..000000000 --- a/backend/src/graphql/queries/RemovePostEmotions.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { gql } from 'graphql-tag' - -export const RemovePostEmotions = gql` - mutation ($to: _PostInput!, $data: _EMOTEDInput!) { - RemovePostEmotions(to: $to, data: $data) { - from { - id - } - to { - id - } - emotion - } - } -` diff --git a/backend/src/graphql/queries/RemoveUserFromGroup.ts b/backend/src/graphql/queries/RemoveUserFromGroup.ts deleted file mode 100644 index f1ff69dd3..000000000 --- a/backend/src/graphql/queries/RemoveUserFromGroup.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const RemoveUserFromGroup = gql` - mutation ($groupId: ID!, $userId: ID!) { - RemoveUserFromGroup(groupId: $groupId, userId: $userId) { - user { - id - name - slug - } - membership { - role - } - } - } -` diff --git a/backend/src/graphql/queries/Room.ts b/backend/src/graphql/queries/Room.ts deleted file mode 100644 index b76fae1fe..000000000 --- a/backend/src/graphql/queries/Room.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Room = gql` - query Room($first: Int, $offset: Int, $id: ID) { - Room(first: $first, offset: $offset, id: $id, orderBy: lastMessageAt_desc) { - id - roomId - roomName - avatar - lastMessageAt - unreadCount - lastMessage { - _id - id - content - senderId - username - avatar - date - saved - distributed - seen - } - users { - _id - id - name - avatar { - url - } - } - } - } -` diff --git a/backend/src/graphql/queries/Signup.ts b/backend/src/graphql/queries/Signup.ts deleted file mode 100644 index 5d60d9ba2..000000000 --- a/backend/src/graphql/queries/Signup.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const Signup = gql` - mutation ($email: String!, $locale: String!, $inviteCode: String) { - Signup(email: $email, locale: $locale, inviteCode: $inviteCode) { - email - } - } -` diff --git a/backend/src/graphql/queries/SignupVerification.ts b/backend/src/graphql/queries/SignupVerification.ts deleted file mode 100644 index 5d395a2f1..000000000 --- a/backend/src/graphql/queries/SignupVerification.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { gql } from 'graphql-tag' - -export const SignupVerification = gql` - mutation ( - $password: String! - $email: String! - $name: String! - $slug: String - $nonce: String! - $termsAndConditionsAgreedVersion: String! - $about: String - $locale: String - ) { - SignupVerification( - email: $email - password: $password - name: $name - slug: $slug - nonce: $nonce - termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion - about: $about - locale: $locale - ) { - id - slug - termsAndConditionsAgreedVersion - termsAndConditionsAgreedAt - } - } -` diff --git a/backend/src/graphql/queries/UnreadRooms.ts b/backend/src/graphql/queries/UnreadRooms.ts deleted file mode 100644 index 2f517384f..000000000 --- a/backend/src/graphql/queries/UnreadRooms.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UnreadRooms = gql` - query { - UnreadRooms - } -` diff --git a/backend/src/graphql/queries/UpdateComment.ts b/backend/src/graphql/queries/UpdateComment.ts deleted file mode 100644 index e98e70ada..000000000 --- a/backend/src/graphql/queries/UpdateComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdateComment = gql` - mutation ($content: String!, $id: ID!) { - UpdateComment(content: $content, id: $id) { - id - content - createdAt - updatedAt - } - } -` diff --git a/backend/src/graphql/queries/UpdateDonations.ts b/backend/src/graphql/queries/UpdateDonations.ts deleted file mode 100644 index 5c28834bd..000000000 --- a/backend/src/graphql/queries/UpdateDonations.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdateDonations = gql` - mutation ($showDonations: Boolean, $goal: Int, $progress: Int) { - UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) { - id - showDonations - goal - progress - createdAt - updatedAt - } - } -` diff --git a/backend/src/graphql/queries/UpdateGroup.ts b/backend/src/graphql/queries/UpdateGroup.ts deleted file mode 100644 index ab071b76a..000000000 --- a/backend/src/graphql/queries/UpdateGroup.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdateGroup = gql` - mutation ( - $id: ID! - $name: String - $slug: String - $about: String - $description: String - $actionRadius: GroupActionRadius - $categoryIds: [ID] - $avatar: ImageInput - $locationName: String # empty string '' sets it to null - ) { - UpdateGroup( - id: $id - name: $name - slug: $slug - about: $about - description: $description - actionRadius: $actionRadius - categoryIds: $categoryIds - avatar: $avatar - locationName: $locationName - ) { - id - name - slug - createdAt - updatedAt - disabled - deleted - about - description - descriptionExcerpt - groupType - actionRadius - categories { - id - slug - name - icon - } - # avatar # test this as result - locationName - location { - name - nameDE - nameEN - } - myRole - } - } -` diff --git a/backend/src/graphql/queries/UpdatePost.ts b/backend/src/graphql/queries/UpdatePost.ts deleted file mode 100644 index 75f3c9324..000000000 --- a/backend/src/graphql/queries/UpdatePost.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdatePost = gql` - mutation ( - $id: ID! - $title: String! - $content: String! - $image: ImageInput - $categoryIds: [ID] - $postType: PostType - $eventInput: _EventInput - ) { - UpdatePost( - id: $id - title: $title - content: $content - image: $image - categoryIds: $categoryIds - postType: $postType - eventInput: $eventInput - ) { - id - title - content - author { - name - slug - } - createdAt - updatedAt - categories { - id - } - postType - eventStart - eventLocationName - eventVenue - eventLocation { - lng - lat - } - } - } -` diff --git a/backend/src/graphql/queries/UpdateSocialMedia.ts b/backend/src/graphql/queries/UpdateSocialMedia.ts deleted file mode 100644 index 412d985fe..000000000 --- a/backend/src/graphql/queries/UpdateSocialMedia.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdateSocialMedia = gql` - mutation ($id: ID!, $url: String!) { - UpdateSocialMedia(id: $id, url: $url) { - id - url - } - } -` diff --git a/backend/src/graphql/queries/UpdateUser.ts b/backend/src/graphql/queries/UpdateUser.ts deleted file mode 100644 index 4699390ca..000000000 --- a/backend/src/graphql/queries/UpdateUser.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { gql } from 'graphql-tag' - -export const UpdateUser = gql` - mutation ( - $id: ID! - $slug: String - $name: String - $about: String - $allowEmbedIframes: Boolean - $showShoutsPublicly: Boolean - $emailNotificationSettings: [EmailNotificationSettingsInput] - $termsAndConditionsAgreedVersion: String - $avatar: ImageInput - $locationName: String # empty string '' sets it to null - $locale: String - ) { - UpdateUser( - id: $id - slug: $slug - name: $name - about: $about - allowEmbedIframes: $allowEmbedIframes - showShoutsPublicly: $showShoutsPublicly - emailNotificationSettings: $emailNotificationSettings - termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion - avatar: $avatar - locationName: $locationName - locale: $locale - ) { - id - slug - name - about - allowEmbedIframes - showShoutsPublicly - termsAndConditionsAgreedVersion - termsAndConditionsAgreedAt - locationName - locale - location { - name - nameDE - nameEN - nameRU - } - emailNotificationSettings { - type - settings { - name - value - } - } - avatar { - url - alt - sensitive - aspectRatio - type - } - badgeVerification { - id - description - icon - } - } - } -` diff --git a/backend/src/graphql/queries/User.ts b/backend/src/graphql/queries/User.ts deleted file mode 100644 index 5201bbf8f..000000000 --- a/backend/src/graphql/queries/User.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { gql } from 'graphql-tag' - -export const User = gql` - query ($id: ID, $name: String, $email: String) { - User(id: $id, name: $name, email: $email) { - id - name - badgeTrophiesCount - badgeTrophies { - id - } - badgeVerification { - id - isDefault - } - badgeTrophiesSelected { - id - isDefault - } - followedBy { - id - } - followedByCurrentUser - following { - name - slug - about - avatar { - url - } - comments { - content - contentExcerpt - } - contributions { - title - slug - image { - url - } - content - contentExcerpt - } - } - isMuted - isBlocked - location { - distanceToMe - } - activeCategories - } - } -` - -export const UserEmailNotificationSettings = gql` - query ($id: ID, $name: String, $email: String) { - User(id: $id, name: $name, email: $email) { - id - name - badgeTrophiesCount - badgeTrophies { - id - } - badgeVerification { - id - isDefault - } - badgeTrophiesSelected { - id - isDefault - } - followedBy { - id - } - followedByCurrentUser - following { - name - slug - about - avatar { - url - } - comments { - content - contentExcerpt - } - contributions { - title - slug - image { - url - } - content - contentExcerpt - } - } - isMuted - isBlocked - location { - distanceToMe - } - emailNotificationSettings { - type - settings { - name - value - } - } - activeCategories - } - } -` - -export const UserEmail = gql` - query ($id: ID, $name: String, $email: String) { - User(id: $id, name: $name, email: $email) { - id - name - email - badgeTrophiesCount - badgeTrophies { - id - } - badgeVerification { - id - isDefault - } - badgeTrophiesSelected { - id - isDefault - } - followedBy { - id - } - followedByCurrentUser - following { - name - slug - about - avatar { - url - } - comments { - content - contentExcerpt - } - contributions { - title - slug - image { - url - } - content - contentExcerpt - } - } - isMuted - isBlocked - location { - distanceToMe - } - activeCategories - } - } -` diff --git a/backend/src/graphql/queries/VerifyEmailAddress.ts b/backend/src/graphql/queries/VerifyEmailAddress.ts deleted file mode 100644 index c6de3e828..000000000 --- a/backend/src/graphql/queries/VerifyEmailAddress.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const VerifyEmailAddress = gql` - mutation ($email: String!, $nonce: String!) { - VerifyEmailAddress(email: $email, nonce: $nonce) { - email - createdAt - verifiedAt - } - } -` diff --git a/backend/src/graphql/queries/VerifyNonce.ts b/backend/src/graphql/queries/VerifyNonce.ts deleted file mode 100644 index 8d77562a1..000000000 --- a/backend/src/graphql/queries/VerifyNonce.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const VerifyNonce = gql` - query ($email: String!, $nonce: String!) { - VerifyNonce(email: $email, nonce: $nonce) - } -` diff --git a/backend/src/graphql/queries/auth/Signup.gql b/backend/src/graphql/queries/auth/Signup.gql new file mode 100644 index 000000000..727d69544 --- /dev/null +++ b/backend/src/graphql/queries/auth/Signup.gql @@ -0,0 +1,5 @@ +mutation Signup($email: String!, $locale: String!, $inviteCode: String) { + Signup(email: $email, locale: $locale, inviteCode: $inviteCode) { + email + } +} diff --git a/backend/src/graphql/queries/auth/SignupVerification.gql b/backend/src/graphql/queries/auth/SignupVerification.gql new file mode 100644 index 000000000..51067d8d3 --- /dev/null +++ b/backend/src/graphql/queries/auth/SignupVerification.gql @@ -0,0 +1,26 @@ +mutation SignupVerification( + $password: String! + $email: String! + $name: String! + $slug: String + $nonce: String! + $termsAndConditionsAgreedVersion: String! + $about: String + $locale: String +) { + SignupVerification( + email: $email + password: $password + name: $name + slug: $slug + nonce: $nonce + termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion + about: $about + locale: $locale + ) { + id + slug + termsAndConditionsAgreedVersion + termsAndConditionsAgreedAt + } +} diff --git a/backend/src/graphql/queries/auth/VerifyNonce.gql b/backend/src/graphql/queries/auth/VerifyNonce.gql new file mode 100644 index 000000000..5e98d085f --- /dev/null +++ b/backend/src/graphql/queries/auth/VerifyNonce.gql @@ -0,0 +1,3 @@ +query VerifyNonce($email: String!, $nonce: String!) { + VerifyNonce(email: $email, nonce: $nonce) +} diff --git a/backend/src/graphql/queries/auth/changePassword.gql b/backend/src/graphql/queries/auth/changePassword.gql new file mode 100644 index 000000000..a84b3e443 --- /dev/null +++ b/backend/src/graphql/queries/auth/changePassword.gql @@ -0,0 +1,3 @@ +mutation changePassword($oldPassword: String!, $newPassword: String!) { + changePassword(oldPassword: $oldPassword, newPassword: $newPassword) +} diff --git a/backend/src/graphql/queries/auth/currentUser.gql b/backend/src/graphql/queries/auth/currentUser.gql new file mode 100644 index 000000000..80cdbf5b0 --- /dev/null +++ b/backend/src/graphql/queries/auth/currentUser.gql @@ -0,0 +1,21 @@ +query currentUser { + currentUser { + id + slug + name + avatar { + url + } + email + role + activeCategories + following { + id + name + } + inviteCodes { + code + redeemedByCount + } + } +} diff --git a/backend/src/graphql/queries/auth/login.gql b/backend/src/graphql/queries/auth/login.gql new file mode 100644 index 000000000..9ec82aac0 --- /dev/null +++ b/backend/src/graphql/queries/auth/login.gql @@ -0,0 +1,3 @@ +mutation login($email: String!, $password: String!) { + login(email: $email, password: $password) +} diff --git a/backend/src/graphql/queries/auth/requestPasswordReset.gql b/backend/src/graphql/queries/auth/requestPasswordReset.gql new file mode 100644 index 000000000..a40795058 --- /dev/null +++ b/backend/src/graphql/queries/auth/requestPasswordReset.gql @@ -0,0 +1,3 @@ +mutation requestPasswordReset($email: String!, $locale: String!) { + requestPasswordReset(email: $email, locale: $locale) +} diff --git a/backend/src/graphql/queries/auth/resetPassword.gql b/backend/src/graphql/queries/auth/resetPassword.gql new file mode 100644 index 000000000..15b81637d --- /dev/null +++ b/backend/src/graphql/queries/auth/resetPassword.gql @@ -0,0 +1,3 @@ +mutation resetPassword($nonce: String!, $email: String!, $newPassword: String!) { + resetPassword(nonce: $nonce, email: $email, newPassword: $newPassword) +} diff --git a/backend/src/graphql/queries/availableRoles.ts b/backend/src/graphql/queries/availableRoles.ts deleted file mode 100644 index 0fe823cda..000000000 --- a/backend/src/graphql/queries/availableRoles.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const availableRoles = gql` - query { - availableRoles - } -` diff --git a/backend/src/graphql/queries/badges/resetTrophyBadgesSelected.gql b/backend/src/graphql/queries/badges/resetTrophyBadgesSelected.gql new file mode 100644 index 000000000..e02bdd768 --- /dev/null +++ b/backend/src/graphql/queries/badges/resetTrophyBadgesSelected.gql @@ -0,0 +1,14 @@ +mutation resetTrophyBadgesSelected { + resetTrophyBadgesSelected { + id + badgeTrophiesCount + badgeTrophiesSelected { + id + isDefault + } + badgeTrophiesUnused { + id + } + badgeTrophiesUnusedCount + } +} diff --git a/backend/src/graphql/queries/badges/revokeBadge.gql b/backend/src/graphql/queries/badges/revokeBadge.gql new file mode 100644 index 000000000..851050a4d --- /dev/null +++ b/backend/src/graphql/queries/badges/revokeBadge.gql @@ -0,0 +1,16 @@ +mutation revokeBadge($badgeId: ID!, $userId: ID!) { + revokeBadge(badgeId: $badgeId, userId: $userId) { + id + badgeTrophies { + id + } + badgeVerification { + id + isDefault + } + badgeTrophiesSelected { + id + isDefault + } + } +} diff --git a/backend/src/graphql/queries/badges/rewardTrophyBadge.gql b/backend/src/graphql/queries/badges/rewardTrophyBadge.gql new file mode 100644 index 000000000..d5d998673 --- /dev/null +++ b/backend/src/graphql/queries/badges/rewardTrophyBadge.gql @@ -0,0 +1,16 @@ +mutation rewardTrophyBadge($badgeId: ID!, $userId: ID!) { + rewardTrophyBadge(badgeId: $badgeId, userId: $userId) { + id + badgeVerification { + id + isDefault + } + badgeTrophiesCount + badgeTrophies { + id + } + badgeTrophiesSelected { + id + } + } +} diff --git a/backend/src/graphql/queries/badges/setTrophyBadgeSelected.gql b/backend/src/graphql/queries/badges/setTrophyBadgeSelected.gql new file mode 100644 index 000000000..7daf5737d --- /dev/null +++ b/backend/src/graphql/queries/badges/setTrophyBadgeSelected.gql @@ -0,0 +1,14 @@ +mutation setTrophyBadgeSelected($slot: Int!, $badgeId: ID) { + setTrophyBadgeSelected(slot: $slot, badgeId: $badgeId) { + id + badgeTrophiesCount + badgeTrophiesSelected { + id + isDefault + } + badgeTrophiesUnused { + id + } + badgeTrophiesUnusedCount + } +} diff --git a/backend/src/graphql/queries/badges/setVerificationBadge.gql b/backend/src/graphql/queries/badges/setVerificationBadge.gql new file mode 100644 index 000000000..60c372af1 --- /dev/null +++ b/backend/src/graphql/queries/badges/setVerificationBadge.gql @@ -0,0 +1,12 @@ +mutation setVerificationBadge($badgeId: ID!, $userId: ID!) { + setVerificationBadge(badgeId: $badgeId, userId: $userId) { + id + badgeVerification { + id + isDefault + } + badgeTrophies { + id + } + } +} diff --git a/backend/src/graphql/queries/blockUser.ts b/backend/src/graphql/queries/blockUser.ts deleted file mode 100644 index c85878a81..000000000 --- a/backend/src/graphql/queries/blockUser.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const blockUser = gql` - mutation ($id: ID!) { - blockUser(id: $id) { - id - name - isBlocked - } - } -` diff --git a/backend/src/graphql/queries/blockedUsers.ts b/backend/src/graphql/queries/blockedUsers.ts deleted file mode 100644 index 10c3fe861..000000000 --- a/backend/src/graphql/queries/blockedUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const blockedUsers = gql` - query { - blockedUsers { - id - name - isBlocked - } - } -` diff --git a/backend/src/graphql/queries/changePassword.ts b/backend/src/graphql/queries/changePassword.ts deleted file mode 100644 index 2df09c79c..000000000 --- a/backend/src/graphql/queries/changePassword.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const changePassword = gql` - mutation ($oldPassword: String!, $newPassword: String!) { - changePassword(oldPassword: $oldPassword, newPassword: $newPassword) - } -` diff --git a/backend/src/graphql/queries/comments/CreateComment.gql b/backend/src/graphql/queries/comments/CreateComment.gql new file mode 100644 index 000000000..2cf8eea44 --- /dev/null +++ b/backend/src/graphql/queries/comments/CreateComment.gql @@ -0,0 +1,12 @@ +mutation CreateComment($id: ID, $postId: ID!, $content: String!) { + CreateComment(id: $id, postId: $postId, content: $content) { + id + content + author { + id + name + } + isPostObservedByMe + postObservingUsersCount + } +} diff --git a/backend/src/graphql/queries/comments/DeleteComment.gql b/backend/src/graphql/queries/comments/DeleteComment.gql new file mode 100644 index 000000000..ae5b809da --- /dev/null +++ b/backend/src/graphql/queries/comments/DeleteComment.gql @@ -0,0 +1,8 @@ +mutation DeleteComment($id: ID!) { + DeleteComment(id: $id) { + id + content + contentExcerpt + deleted + } +} diff --git a/backend/src/graphql/queries/comments/UpdateComment.gql b/backend/src/graphql/queries/comments/UpdateComment.gql new file mode 100644 index 000000000..2cedbeac6 --- /dev/null +++ b/backend/src/graphql/queries/comments/UpdateComment.gql @@ -0,0 +1,8 @@ +mutation UpdateComment($content: String!, $id: ID!) { + UpdateComment(content: $content, id: $id) { + id + content + createdAt + updatedAt + } +} diff --git a/backend/src/graphql/queries/currentUser.ts b/backend/src/graphql/queries/currentUser.ts deleted file mode 100644 index 3637a0c9d..000000000 --- a/backend/src/graphql/queries/currentUser.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { gql } from 'graphql-tag' - -export const currentUser = gql` - query currentUser { - currentUser { - id - slug - name - avatar { - url - } - email - role - activeCategories - following { - name - } - inviteCodes { - code - redeemedByCount - } - } - } -` diff --git a/backend/src/graphql/queries/donations/Donations.gql b/backend/src/graphql/queries/donations/Donations.gql new file mode 100644 index 000000000..11ed44363 --- /dev/null +++ b/backend/src/graphql/queries/donations/Donations.gql @@ -0,0 +1,8 @@ +query Donations { + Donations { + id + showDonations + goal + progress + } +} diff --git a/backend/src/graphql/queries/donations/UpdateDonations.gql b/backend/src/graphql/queries/donations/UpdateDonations.gql new file mode 100644 index 000000000..2901f51d3 --- /dev/null +++ b/backend/src/graphql/queries/donations/UpdateDonations.gql @@ -0,0 +1,10 @@ +mutation UpdateDonations($showDonations: Boolean, $goal: Int, $progress: Int) { + UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) { + id + showDonations + goal + progress + createdAt + updatedAt + } +} diff --git a/backend/src/graphql/queries/embed.gql b/backend/src/graphql/queries/embed.gql new file mode 100644 index 000000000..f7eef991a --- /dev/null +++ b/backend/src/graphql/queries/embed.gql @@ -0,0 +1,17 @@ +query embed($url: String!) { + embed(url: $url) { + type + title + author + publisher + date + description + url + image + audio + video + lang + sources + html + } +} diff --git a/backend/src/graphql/queries/embed.ts b/backend/src/graphql/queries/embed.ts deleted file mode 100644 index 910383eb6..000000000 --- a/backend/src/graphql/queries/embed.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { gql } from 'graphql-tag' - -export const embed = gql` - query ($url: String!) { - embed(url: $url) { - type - title - author - publisher - date - description - url - image - audio - video - lang - sources - html - } - } -` diff --git a/backend/src/graphql/queries/emotions/AddPostEmotions.gql b/backend/src/graphql/queries/emotions/AddPostEmotions.gql new file mode 100644 index 000000000..3890f40d2 --- /dev/null +++ b/backend/src/graphql/queries/emotions/AddPostEmotions.gql @@ -0,0 +1,11 @@ +mutation AddPostEmotions($to: _PostInput!, $data: _EMOTEDInput!) { + AddPostEmotions(to: $to, data: $data) { + from { + id + } + to { + id + } + emotion + } +} diff --git a/backend/src/graphql/queries/emotions/PostsEmotionsByCurrentUser.gql b/backend/src/graphql/queries/emotions/PostsEmotionsByCurrentUser.gql new file mode 100644 index 000000000..0cb75cb01 --- /dev/null +++ b/backend/src/graphql/queries/emotions/PostsEmotionsByCurrentUser.gql @@ -0,0 +1,3 @@ +query PostsEmotionsByCurrentUser($postId: ID!) { + PostsEmotionsByCurrentUser(postId: $postId) +} diff --git a/backend/src/graphql/queries/emotions/PostsEmotionsCountByEmotion.gql b/backend/src/graphql/queries/emotions/PostsEmotionsCountByEmotion.gql new file mode 100644 index 000000000..f4ec25122 --- /dev/null +++ b/backend/src/graphql/queries/emotions/PostsEmotionsCountByEmotion.gql @@ -0,0 +1,3 @@ +query PostsEmotionsCountByEmotion($postId: ID!, $data: _EMOTEDInput!) { + PostsEmotionsCountByEmotion(postId: $postId, data: $data) +} diff --git a/backend/src/graphql/queries/emotions/RemovePostEmotions.gql b/backend/src/graphql/queries/emotions/RemovePostEmotions.gql new file mode 100644 index 000000000..9fb4fd6f8 --- /dev/null +++ b/backend/src/graphql/queries/emotions/RemovePostEmotions.gql @@ -0,0 +1,11 @@ +mutation RemovePostEmotions($to: _PostInput!, $data: _EMOTEDInput!) { + RemovePostEmotions(to: $to, data: $data) { + from { + id + } + to { + id + } + emotion + } +} diff --git a/backend/src/graphql/queries/emotions/shout.gql b/backend/src/graphql/queries/emotions/shout.gql new file mode 100644 index 000000000..98a9afc5a --- /dev/null +++ b/backend/src/graphql/queries/emotions/shout.gql @@ -0,0 +1,3 @@ +mutation shout($id: ID!) { + shout(id: $id, type: Post) +} diff --git a/backend/src/graphql/queries/emotions/unshout.gql b/backend/src/graphql/queries/emotions/unshout.gql new file mode 100644 index 000000000..e5a08d121 --- /dev/null +++ b/backend/src/graphql/queries/emotions/unshout.gql @@ -0,0 +1,3 @@ +mutation unshout($id: ID!) { + unshout(id: $id, type: Post) +} diff --git a/backend/src/graphql/queries/fileReport.ts b/backend/src/graphql/queries/fileReport.ts deleted file mode 100644 index f362126c3..000000000 --- a/backend/src/graphql/queries/fileReport.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { gql } from 'graphql-tag' - -export const fileReport = gql` - mutation ($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) { - fileReport( - resourceId: $resourceId - reasonCategory: $reasonCategory - reasonDescription: $reasonDescription - ) { - createdAt - reasonCategory - reasonDescription - reportId - resource { - __typename - ... on User { - name - } - ... on Post { - title - } - ... on Comment { - content - } - } - } - } -` diff --git a/backend/src/graphql/queries/followUser.ts b/backend/src/graphql/queries/followUser.ts deleted file mode 100644 index ff132c4db..000000000 --- a/backend/src/graphql/queries/followUser.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { gql } from 'graphql-tag' - -export const followUser = gql` - mutation ($id: ID!) { - followUser(id: $id) { - id - name - followedBy { - id - name - } - followedByCurrentUser - } - } -` diff --git a/backend/src/graphql/queries/generateGroupInviteCode.ts b/backend/src/graphql/queries/generateGroupInviteCode.ts deleted file mode 100644 index 53fae1001..000000000 --- a/backend/src/graphql/queries/generateGroupInviteCode.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { gql } from 'graphql-tag' - -export const generateGroupInviteCode = gql` - mutation generateGroupInviteCode($groupId: ID!, $expiresAt: String, $comment: String) { - generateGroupInviteCode(groupId: $groupId, expiresAt: $expiresAt, comment: $comment) { - code - createdAt - generatedBy { - id - name - avatar { - url - } - } - redeemedBy { - id - name - avatar { - url - } - } - expiresAt - comment - invitedTo { - id - groupType - name - about - avatar { - url - } - } - isValid - } - } -` diff --git a/backend/src/graphql/queries/generatePersonalInviteCode.ts b/backend/src/graphql/queries/generatePersonalInviteCode.ts deleted file mode 100644 index 49bd08ada..000000000 --- a/backend/src/graphql/queries/generatePersonalInviteCode.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { gql } from 'graphql-tag' - -export const generatePersonalInviteCode = gql` - mutation generatePersonalInviteCode($expiresAt: String, $comment: String) { - generatePersonalInviteCode(expiresAt: $expiresAt, comment: $comment) { - code - createdAt - generatedBy { - id - name - avatar { - url - } - } - redeemedBy { - id - name - avatar { - url - } - } - expiresAt - comment - invitedTo { - id - groupType - name - about - avatar { - url - } - } - isValid - } - } -` diff --git a/backend/src/graphql/queries/groups/ChangeGroupMemberRole.gql b/backend/src/graphql/queries/groups/ChangeGroupMemberRole.gql new file mode 100644 index 000000000..bf40d0fad --- /dev/null +++ b/backend/src/graphql/queries/groups/ChangeGroupMemberRole.gql @@ -0,0 +1,12 @@ +mutation ChangeGroupMemberRole($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) { + ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) { + user { + id + name + slug + } + membership { + role + } + } +} diff --git a/backend/src/graphql/queries/groups/CreateGroup.gql b/backend/src/graphql/queries/groups/CreateGroup.gql new file mode 100644 index 000000000..09d2fd537 --- /dev/null +++ b/backend/src/graphql/queries/groups/CreateGroup.gql @@ -0,0 +1,50 @@ +mutation CreateGroup( + $id: ID + $name: String! + $slug: String + $about: String + $description: String! + $groupType: GroupType! + $actionRadius: GroupActionRadius! + $categoryIds: [ID] + $locationName: String # empty string '' sets it to null +) { + CreateGroup( + id: $id + name: $name + slug: $slug + about: $about + description: $description + groupType: $groupType + actionRadius: $actionRadius + categoryIds: $categoryIds + locationName: $locationName + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + descriptionExcerpt + groupType + actionRadius + categories { + id + slug + name + icon + } + locationName + location { + id + name + nameDE + nameEN + } + myRole + } +} diff --git a/backend/src/graphql/queries/groups/Group.gql b/backend/src/graphql/queries/groups/Group.gql new file mode 100644 index 000000000..2cd2e9947 --- /dev/null +++ b/backend/src/graphql/queries/groups/Group.gql @@ -0,0 +1,37 @@ +query Group($isMember: Boolean, $id: ID, $slug: String) { + Group(isMember: $isMember, id: $id, slug: $slug) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + descriptionExcerpt + groupType + actionRadius + categories { + id + slug + name + icon + } + avatar { + url + } + locationName + location { + id + name + nameDE + nameEN + } + myRole + inviteCodes { + code + redeemedByCount + } + } +} diff --git a/backend/src/graphql/queries/groups/GroupMembers.gql b/backend/src/graphql/queries/groups/GroupMembers.gql new file mode 100644 index 000000000..30a3749c8 --- /dev/null +++ b/backend/src/graphql/queries/groups/GroupMembers.gql @@ -0,0 +1,12 @@ +query GroupMembers($id: ID!) { + GroupMembers(id: $id) { + user { + id + name + slug + } + membership { + role + } + } +} diff --git a/backend/src/graphql/queries/groups/JoinGroup.gql b/backend/src/graphql/queries/groups/JoinGroup.gql new file mode 100644 index 000000000..f1e6ba749 --- /dev/null +++ b/backend/src/graphql/queries/groups/JoinGroup.gql @@ -0,0 +1,12 @@ +mutation JoinGroup($groupId: ID!, $userId: ID!) { + JoinGroup(groupId: $groupId, userId: $userId) { + user { + id + name + slug + } + membership { + role + } + } +} diff --git a/backend/src/graphql/queries/groups/LeaveGroup.gql b/backend/src/graphql/queries/groups/LeaveGroup.gql new file mode 100644 index 000000000..2ed6910ea --- /dev/null +++ b/backend/src/graphql/queries/groups/LeaveGroup.gql @@ -0,0 +1,12 @@ +mutation LeaveGroup($groupId: ID!, $userId: ID!) { + LeaveGroup(groupId: $groupId, userId: $userId) { + user { + id + name + slug + } + membership { + role + } + } +} diff --git a/backend/src/graphql/queries/groups/RemoveUserFromGroup.gql b/backend/src/graphql/queries/groups/RemoveUserFromGroup.gql new file mode 100644 index 000000000..87cd53d8b --- /dev/null +++ b/backend/src/graphql/queries/groups/RemoveUserFromGroup.gql @@ -0,0 +1,12 @@ +mutation RemoveUserFromGroup($groupId: ID!, $userId: ID!) { + RemoveUserFromGroup(groupId: $groupId, userId: $userId) { + user { + id + name + slug + } + membership { + role + } + } +} diff --git a/backend/src/graphql/queries/groups/UpdateGroup.gql b/backend/src/graphql/queries/groups/UpdateGroup.gql new file mode 100644 index 000000000..863fe0fbc --- /dev/null +++ b/backend/src/graphql/queries/groups/UpdateGroup.gql @@ -0,0 +1,51 @@ +mutation UpdateGroup( + $id: ID! + $name: String + $slug: String + $about: String + $description: String + $actionRadius: GroupActionRadius + $categoryIds: [ID] + $avatar: ImageInput + $locationName: String # empty string '' sets it to null +) { + UpdateGroup( + id: $id + name: $name + slug: $slug + about: $about + description: $description + actionRadius: $actionRadius + categoryIds: $categoryIds + avatar: $avatar + locationName: $locationName + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + descriptionExcerpt + groupType + actionRadius + categories { + id + slug + name + icon + } + # avatar # test this as result + locationName + location { + id + name + nameDE + nameEN + } + myRole + } +} diff --git a/backend/src/graphql/queries/groups/muteGroup.gql b/backend/src/graphql/queries/groups/muteGroup.gql new file mode 100644 index 000000000..7f6538ec9 --- /dev/null +++ b/backend/src/graphql/queries/groups/muteGroup.gql @@ -0,0 +1,6 @@ +mutation muteGroup($groupId: ID!) { + muteGroup(groupId: $groupId) { + id + isMutedByMe + } +} diff --git a/backend/src/graphql/queries/groups/pinGroupPost.gql b/backend/src/graphql/queries/groups/pinGroupPost.gql new file mode 100644 index 000000000..fbb493244 --- /dev/null +++ b/backend/src/graphql/queries/groups/pinGroupPost.gql @@ -0,0 +1,22 @@ +mutation pinGroupPost($id: ID!) { + pinGroupPost(id: $id) { + id + title + content + author { + id + name + slug + } + pinnedBy { + id + name + role + } + createdAt + updatedAt + pinnedAt + pinned + groupPinned + } +} diff --git a/backend/src/graphql/queries/groups/unmuteGroup.gql b/backend/src/graphql/queries/groups/unmuteGroup.gql new file mode 100644 index 000000000..5c39dc9c5 --- /dev/null +++ b/backend/src/graphql/queries/groups/unmuteGroup.gql @@ -0,0 +1,6 @@ +mutation unmuteGroup($groupId: ID!) { + unmuteGroup(groupId: $groupId) { + id + isMutedByMe + } +} diff --git a/backend/src/graphql/queries/groups/unpinGroupPost.gql b/backend/src/graphql/queries/groups/unpinGroupPost.gql new file mode 100644 index 000000000..fac4bd734 --- /dev/null +++ b/backend/src/graphql/queries/groups/unpinGroupPost.gql @@ -0,0 +1,22 @@ +mutation unpinGroupPost($id: ID!) { + unpinGroupPost(id: $id) { + id + title + content + author { + id + name + slug + } + pinnedBy { + id + name + role + } + createdAt + updatedAt + pinned + pinnedAt + groupPinned + } +} diff --git a/backend/src/graphql/queries/interactions/blockUser.gql b/backend/src/graphql/queries/interactions/blockUser.gql new file mode 100644 index 000000000..b2693f8f1 --- /dev/null +++ b/backend/src/graphql/queries/interactions/blockUser.gql @@ -0,0 +1,7 @@ +mutation blockUser($id: ID!) { + blockUser(id: $id) { + id + name + isBlocked + } +} diff --git a/backend/src/graphql/queries/interactions/blockedUsers.gql b/backend/src/graphql/queries/interactions/blockedUsers.gql new file mode 100644 index 000000000..f336b8d56 --- /dev/null +++ b/backend/src/graphql/queries/interactions/blockedUsers.gql @@ -0,0 +1,7 @@ +query blockedUsers { + blockedUsers { + id + name + isBlocked + } +} diff --git a/backend/src/graphql/queries/interactions/followUser.gql b/backend/src/graphql/queries/interactions/followUser.gql new file mode 100644 index 000000000..410ba260d --- /dev/null +++ b/backend/src/graphql/queries/interactions/followUser.gql @@ -0,0 +1,11 @@ +mutation followUser($id: ID!) { + followUser(id: $id) { + id + name + followedBy { + id + name + } + followedByCurrentUser + } +} diff --git a/backend/src/graphql/queries/interactions/muteUser.gql b/backend/src/graphql/queries/interactions/muteUser.gql new file mode 100644 index 000000000..4cf1d3148 --- /dev/null +++ b/backend/src/graphql/queries/interactions/muteUser.gql @@ -0,0 +1,7 @@ +mutation muteUser($id: ID!) { + muteUser(id: $id) { + id + name + isMuted + } +} diff --git a/backend/src/graphql/queries/interactions/mutedUsers.gql b/backend/src/graphql/queries/interactions/mutedUsers.gql new file mode 100644 index 000000000..4c41f2119 --- /dev/null +++ b/backend/src/graphql/queries/interactions/mutedUsers.gql @@ -0,0 +1,7 @@ +query mutedUsers { + mutedUsers { + id + name + isMuted + } +} diff --git a/backend/src/graphql/queries/interactions/unblockUser.gql b/backend/src/graphql/queries/interactions/unblockUser.gql new file mode 100644 index 000000000..630decdfe --- /dev/null +++ b/backend/src/graphql/queries/interactions/unblockUser.gql @@ -0,0 +1,7 @@ +mutation unblockUser($id: ID!) { + unblockUser(id: $id) { + id + name + isBlocked + } +} diff --git a/backend/src/graphql/queries/interactions/unfollowUser.gql b/backend/src/graphql/queries/interactions/unfollowUser.gql new file mode 100644 index 000000000..4fd7090d9 --- /dev/null +++ b/backend/src/graphql/queries/interactions/unfollowUser.gql @@ -0,0 +1,11 @@ +mutation unfollowUser($id: ID!) { + unfollowUser(id: $id) { + id + name + followedBy { + id + name + } + followedByCurrentUser + } +} diff --git a/backend/src/graphql/queries/interactions/unmuteUser.gql b/backend/src/graphql/queries/interactions/unmuteUser.gql new file mode 100644 index 000000000..d6f9f090c --- /dev/null +++ b/backend/src/graphql/queries/interactions/unmuteUser.gql @@ -0,0 +1,7 @@ +mutation unmuteUser($id: ID!) { + unmuteUser(id: $id) { + id + name + isMuted + } +} diff --git a/backend/src/graphql/queries/invalidateInviteCode.ts b/backend/src/graphql/queries/invalidateInviteCode.ts deleted file mode 100644 index dfbe96c1c..000000000 --- a/backend/src/graphql/queries/invalidateInviteCode.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { gql } from 'graphql-tag' - -export const invalidateInviteCode = gql` - mutation invalidateInviteCode($code: String!) { - invalidateInviteCode(code: $code) { - code - createdAt - generatedBy { - id - name - avatar { - url - } - } - redeemedBy { - id - name - avatar { - url - } - } - expiresAt - comment - invitedTo { - id - groupType - name - about - avatar { - url - } - } - isValid - } - } -` diff --git a/backend/src/graphql/queries/invites/authenticatedValidateInviteCode.gql b/backend/src/graphql/queries/invites/authenticatedValidateInviteCode.gql new file mode 100644 index 000000000..ac8b27140 --- /dev/null +++ b/backend/src/graphql/queries/invites/authenticatedValidateInviteCode.gql @@ -0,0 +1,22 @@ +query authenticatedValidateInviteCode($code: String!) { + validateInviteCode(code: $code) { + code + invitedTo { + id + groupType + name + about + avatar { + url + } + } + generatedBy { + id + name + avatar { + url + } + } + isValid + } +} diff --git a/backend/src/graphql/queries/invites/generateGroupInviteCode.gql b/backend/src/graphql/queries/invites/generateGroupInviteCode.gql new file mode 100644 index 000000000..f452e108d --- /dev/null +++ b/backend/src/graphql/queries/invites/generateGroupInviteCode.gql @@ -0,0 +1,32 @@ +mutation generateGroupInviteCode($groupId: ID!, $expiresAt: String, $comment: String) { + generateGroupInviteCode(groupId: $groupId, expiresAt: $expiresAt, comment: $comment) { + code + createdAt + generatedBy { + id + name + avatar { + url + } + } + redeemedBy { + id + name + avatar { + url + } + } + expiresAt + comment + invitedTo { + id + groupType + name + about + avatar { + url + } + } + isValid + } +} diff --git a/backend/src/graphql/queries/invites/generatePersonalInviteCode.gql b/backend/src/graphql/queries/invites/generatePersonalInviteCode.gql new file mode 100644 index 000000000..805149314 --- /dev/null +++ b/backend/src/graphql/queries/invites/generatePersonalInviteCode.gql @@ -0,0 +1,32 @@ +mutation generatePersonalInviteCode($expiresAt: String, $comment: String) { + generatePersonalInviteCode(expiresAt: $expiresAt, comment: $comment) { + code + createdAt + generatedBy { + id + name + avatar { + url + } + } + redeemedBy { + id + name + avatar { + url + } + } + expiresAt + comment + invitedTo { + id + groupType + name + about + avatar { + url + } + } + isValid + } +} diff --git a/backend/src/graphql/queries/invites/invalidateInviteCode.gql b/backend/src/graphql/queries/invites/invalidateInviteCode.gql new file mode 100644 index 000000000..996e95aae --- /dev/null +++ b/backend/src/graphql/queries/invites/invalidateInviteCode.gql @@ -0,0 +1,32 @@ +mutation invalidateInviteCode($code: String!) { + invalidateInviteCode(code: $code) { + code + createdAt + generatedBy { + id + name + avatar { + url + } + } + redeemedBy { + id + name + avatar { + url + } + } + expiresAt + comment + invitedTo { + id + groupType + name + about + avatar { + url + } + } + isValid + } +} diff --git a/backend/src/graphql/queries/invites/redeemInviteCode.gql b/backend/src/graphql/queries/invites/redeemInviteCode.gql new file mode 100644 index 000000000..f03ae887d --- /dev/null +++ b/backend/src/graphql/queries/invites/redeemInviteCode.gql @@ -0,0 +1,3 @@ +mutation redeemInviteCode($code: String!) { + redeemInviteCode(code: $code) +} diff --git a/backend/src/graphql/queries/invites/unauthenticatedValidateInviteCode.gql b/backend/src/graphql/queries/invites/unauthenticatedValidateInviteCode.gql new file mode 100644 index 000000000..2058aa464 --- /dev/null +++ b/backend/src/graphql/queries/invites/unauthenticatedValidateInviteCode.gql @@ -0,0 +1,22 @@ +query unauthenticatedValidateInviteCode($code: String!) { + validateInviteCode(code: $code) { + code + # eslint-disable-next-line @graphql-eslint/require-selections + invitedTo { + groupType + name + about + avatar { + url + } + } + # eslint-disable-next-line @graphql-eslint/require-selections + generatedBy { + name + avatar { + url + } + } + isValid + } +} diff --git a/backend/src/graphql/queries/login.ts b/backend/src/graphql/queries/login.ts deleted file mode 100644 index 19c5472c9..000000000 --- a/backend/src/graphql/queries/login.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const login = gql` - mutation ($email: String!, $password: String!) { - login(email: $email, password: $password) - } -` diff --git a/backend/src/graphql/queries/markAllAsRead.ts b/backend/src/graphql/queries/markAllAsRead.ts deleted file mode 100644 index 60e08b4af..000000000 --- a/backend/src/graphql/queries/markAllAsRead.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { gql } from 'graphql-tag' - -export const markAllAsRead = gql` - mutation { - markAllAsRead { - id - from { - __typename - ... on Post { - content - } - ... on Comment { - content - } - } - read - createdAt - } - } -` diff --git a/backend/src/graphql/queries/markAsRead.ts b/backend/src/graphql/queries/markAsRead.ts deleted file mode 100644 index 657d09395..000000000 --- a/backend/src/graphql/queries/markAsRead.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { gql } from 'graphql-tag' - -export const markAsRead = gql` - mutation ($id: ID!) { - markAsRead(id: $id) { - from { - __typename - ... on Post { - content - } - ... on Comment { - content - } - } - read - createdAt - } - } -` diff --git a/backend/src/graphql/queries/markTeaserAsViewed.ts b/backend/src/graphql/queries/markTeaserAsViewed.ts deleted file mode 100644 index 59922adea..000000000 --- a/backend/src/graphql/queries/markTeaserAsViewed.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const markTeaserAsViewed = gql` - mutation ($id: ID!) { - markTeaserAsViewed(id: $id) { - id - viewedTeaserCount - } - } -` diff --git a/backend/src/graphql/queries/messaging/CreateMessage.gql b/backend/src/graphql/queries/messaging/CreateMessage.gql new file mode 100644 index 000000000..d379306e1 --- /dev/null +++ b/backend/src/graphql/queries/messaging/CreateMessage.gql @@ -0,0 +1,18 @@ +mutation CreateMessage($roomId: ID!, $content: String!, $files: [FileInput]) { + CreateMessage(roomId: $roomId, content: $content, files: $files) { + id + content + senderId + username + avatar + date + saved + distributed + seen + files { + url + name + type + } + } +} diff --git a/backend/src/graphql/queries/messaging/CreateRoom.gql b/backend/src/graphql/queries/messaging/CreateRoom.gql new file mode 100644 index 000000000..045435d85 --- /dev/null +++ b/backend/src/graphql/queries/messaging/CreateRoom.gql @@ -0,0 +1,18 @@ +mutation CreateRoom($userId: ID!) { + CreateRoom(userId: $userId) { + id + roomId + roomName + lastMessageAt + unreadCount + #avatar + users { + _id + id + name + avatar { + url + } + } + } +} diff --git a/backend/src/graphql/queries/messaging/MarkMessagesAsSeen.gql b/backend/src/graphql/queries/messaging/MarkMessagesAsSeen.gql new file mode 100644 index 000000000..87f6c6ba8 --- /dev/null +++ b/backend/src/graphql/queries/messaging/MarkMessagesAsSeen.gql @@ -0,0 +1,3 @@ +mutation MarkMessagesAsSeen($messageIds: [String!]) { + MarkMessagesAsSeen(messageIds: $messageIds) +} diff --git a/backend/src/graphql/queries/messaging/Message.gql b/backend/src/graphql/queries/messaging/Message.gql new file mode 100644 index 000000000..119f6978c --- /dev/null +++ b/backend/src/graphql/queries/messaging/Message.gql @@ -0,0 +1,23 @@ +query Message($roomId: ID!, $first: Int, $offset: Int) { + Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { + _id + id + indexId + content + senderId + author { + id + } + username + avatar + date + saved + distributed + seen + files { + url + name + type + } + } +} diff --git a/backend/src/graphql/queries/messaging/Room.gql b/backend/src/graphql/queries/messaging/Room.gql new file mode 100644 index 000000000..1d66f862a --- /dev/null +++ b/backend/src/graphql/queries/messaging/Room.gql @@ -0,0 +1,30 @@ +query Room($first: Int, $offset: Int, $id: ID) { + Room(first: $first, offset: $offset, id: $id, orderBy: lastMessageAt_desc) { + id + roomId + roomName + avatar + lastMessageAt + unreadCount + lastMessage { + _id + id + content + senderId + username + avatar + date + saved + distributed + seen + } + users { + _id + id + name + avatar { + url + } + } + } +} diff --git a/backend/src/graphql/queries/messaging/UnreadRooms.gql b/backend/src/graphql/queries/messaging/UnreadRooms.gql new file mode 100644 index 000000000..547338750 --- /dev/null +++ b/backend/src/graphql/queries/messaging/UnreadRooms.gql @@ -0,0 +1,3 @@ +query UnreadRooms { + UnreadRooms +} diff --git a/backend/src/graphql/queries/moderation/fileReport.gql b/backend/src/graphql/queries/moderation/fileReport.gql new file mode 100644 index 000000000..7ab364131 --- /dev/null +++ b/backend/src/graphql/queries/moderation/fileReport.gql @@ -0,0 +1,27 @@ +mutation fileReport($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) { + fileReport( + resourceId: $resourceId + reasonCategory: $reasonCategory + reasonDescription: $reasonDescription + ) { + createdAt + reasonCategory + reasonDescription + reportId + resource { + __typename + ... on User { + id + name + } + ... on Post { + id + title + } + ... on Comment { + id + content + } + } + } +} diff --git a/backend/src/graphql/queries/moderation/reports.gql b/backend/src/graphql/queries/moderation/reports.gql new file mode 100644 index 000000000..33c64a46b --- /dev/null +++ b/backend/src/graphql/queries/moderation/reports.gql @@ -0,0 +1,42 @@ +query reports( + $orderBy: ReportOrdering + $reviewed: Boolean + $closed: Boolean + $first: Int + $offset: Int +) { + reports( + orderBy: $orderBy + reviewed: $reviewed + closed: $closed + first: $first + offset: $offset + ) { + id + createdAt + updatedAt + rule + disable + closed + resource { + __typename + ... on User { + id + } + ... on Post { + id + } + ... on Comment { + id + } + } + filed { + submitter { + id + } + createdAt + reasonCategory + reasonDescription + } + } +} diff --git a/backend/src/graphql/queries/moderation/review.gql b/backend/src/graphql/queries/moderation/review.gql new file mode 100644 index 000000000..bd960284d --- /dev/null +++ b/backend/src/graphql/queries/moderation/review.gql @@ -0,0 +1,33 @@ +mutation review($resourceId: ID!, $disable: Boolean, $closed: Boolean) { + review(resourceId: $resourceId, disable: $disable, closed: $closed) { + createdAt + updatedAt + resource { + __typename + ... on User { + id + disabled + } + ... on Post { + id + disabled + } + ... on Comment { + id + disabled + } + } + report { + id + createdAt + updatedAt + closed + reviewed { + createdAt + moderator { + id + } + } + } + } +} diff --git a/backend/src/graphql/queries/muteGroup.ts b/backend/src/graphql/queries/muteGroup.ts deleted file mode 100644 index e10424c18..000000000 --- a/backend/src/graphql/queries/muteGroup.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const muteGroup = gql` - mutation ($groupId: ID!) { - muteGroup(groupId: $groupId) { - id - isMutedByMe - } - } -` diff --git a/backend/src/graphql/queries/muteUser.ts b/backend/src/graphql/queries/muteUser.ts deleted file mode 100644 index 4e31ab1f3..000000000 --- a/backend/src/graphql/queries/muteUser.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const muteUser = gql` - mutation ($id: ID!) { - muteUser(id: $id) { - id - name - isMuted - } - } -` diff --git a/backend/src/graphql/queries/mutedUsers.ts b/backend/src/graphql/queries/mutedUsers.ts deleted file mode 100644 index b80fab852..000000000 --- a/backend/src/graphql/queries/mutedUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const mutedUsers = gql` - query { - mutedUsers { - id - name - isMuted - } - } -` diff --git a/backend/src/graphql/queries/notifications.ts b/backend/src/graphql/queries/notifications.ts deleted file mode 100644 index cd30a89c2..000000000 --- a/backend/src/graphql/queries/notifications.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { gql } from 'graphql-tag' - -export const notifications = gql` - query ($read: Boolean, $orderBy: NotificationOrdering) { - notifications(read: $read, orderBy: $orderBy) { - reason - relatedUser { - id - } - from { - __typename - ... on Post { - id - content - } - ... on Comment { - id - content - } - ... on Group { - id - } - } - read - createdAt - } - } -` diff --git a/backend/src/graphql/queries/notifications/markAllAsRead.gql b/backend/src/graphql/queries/notifications/markAllAsRead.gql new file mode 100644 index 000000000..6535f2bfb --- /dev/null +++ b/backend/src/graphql/queries/notifications/markAllAsRead.gql @@ -0,0 +1,18 @@ +mutation markAllAsRead { + markAllAsRead { + id + from { + __typename + ... on Post { + id + content + } + ... on Comment { + id + content + } + } + read + createdAt + } +} diff --git a/backend/src/graphql/queries/notifications/markAsRead.gql b/backend/src/graphql/queries/notifications/markAsRead.gql new file mode 100644 index 000000000..3ded805d0 --- /dev/null +++ b/backend/src/graphql/queries/notifications/markAsRead.gql @@ -0,0 +1,18 @@ +mutation markAsRead($id: ID!) { + markAsRead(id: $id) { + id + from { + __typename + ... on Post { + id + content + } + ... on Comment { + id + content + } + } + read + createdAt + } +} diff --git a/backend/src/graphql/queries/notifications/markTeaserAsViewed.gql b/backend/src/graphql/queries/notifications/markTeaserAsViewed.gql new file mode 100644 index 000000000..1a4983835 --- /dev/null +++ b/backend/src/graphql/queries/notifications/markTeaserAsViewed.gql @@ -0,0 +1,6 @@ +mutation markTeaserAsViewed($id: ID!) { + markTeaserAsViewed(id: $id) { + id + viewedTeaserCount + } +} diff --git a/backend/src/graphql/queries/notifications/notifications.gql b/backend/src/graphql/queries/notifications/notifications.gql new file mode 100644 index 000000000..35b31ef2e --- /dev/null +++ b/backend/src/graphql/queries/notifications/notifications.gql @@ -0,0 +1,25 @@ +query notifications($read: Boolean, $orderBy: NotificationOrdering) { + notifications(read: $read, orderBy: $orderBy) { + id + reason + relatedUser { + id + } + from { + __typename + ... on Post { + id + content + } + ... on Comment { + id + content + } + ... on Group { + id + } + } + read + createdAt + } +} diff --git a/backend/src/graphql/queries/pinGroupPost.ts b/backend/src/graphql/queries/pinGroupPost.ts deleted file mode 100644 index fbf95dc58..000000000 --- a/backend/src/graphql/queries/pinGroupPost.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { gql } from 'graphql-tag' - -export const pinGroupPost = gql` - mutation ($id: ID!) { - pinGroupPost(id: $id) { - id - title - content - author { - name - slug - } - pinnedBy { - id - name - role - } - createdAt - updatedAt - pinnedAt - pinned - groupPinned - } - } -` diff --git a/backend/src/graphql/queries/pinPost.ts b/backend/src/graphql/queries/pinPost.ts deleted file mode 100644 index 6bd8faa98..000000000 --- a/backend/src/graphql/queries/pinPost.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { gql } from 'graphql-tag' - -export const pinPost = gql` - mutation ($id: ID!) { - pinPost(id: $id) { - id - title - content - author { - name - slug - } - pinnedBy { - id - name - role - } - createdAt - updatedAt - pinnedAt - pinned - } - } -` diff --git a/backend/src/graphql/queries/posts/CreatePost.gql b/backend/src/graphql/queries/posts/CreatePost.gql new file mode 100644 index 000000000..6b809879f --- /dev/null +++ b/backend/src/graphql/queries/posts/CreatePost.gql @@ -0,0 +1,49 @@ +mutation CreatePost( + $id: ID + $title: String! + $slug: String + $content: String! + $categoryIds: [ID] + $groupId: ID + $postType: PostType + $eventInput: _EventInput +) { + CreatePost( + id: $id + title: $title + slug: $slug + content: $content + categoryIds: $categoryIds + groupId: $groupId + postType: $postType + eventInput: $eventInput + ) { + id + slug + title + content + disabled + deleted + postType + author { + id + name + } + categories { + id + } + eventStart + eventEnd + eventLocationName + eventVenue + eventIsOnline + eventLocation { + id + lng + lat + } + isObservedByMe + observingUsersCount + language + } +} diff --git a/backend/src/graphql/queries/posts/DeletePost.gql b/backend/src/graphql/queries/posts/DeletePost.gql new file mode 100644 index 000000000..9c99c3691 --- /dev/null +++ b/backend/src/graphql/queries/posts/DeletePost.gql @@ -0,0 +1,17 @@ +mutation DeletePost($id: ID!) { + DeletePost(id: $id) { + id + deleted + content + contentExcerpt + image { + url + } + comments { + id + deleted + content + contentExcerpt + } + } +} diff --git a/backend/src/graphql/queries/posts/Post.gql b/backend/src/graphql/queries/posts/Post.gql new file mode 100644 index 000000000..43088c615 --- /dev/null +++ b/backend/src/graphql/queries/posts/Post.gql @@ -0,0 +1,36 @@ +query Post($id: ID, $filter: _PostFilter, $first: Int, $offset: Int, $orderBy: [_PostOrdering]) { + Post(id: $id, filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { + id + title + content + contentExcerpt + eventStart + pinned + createdAt + pinnedAt + isObservedByMe + observingUsersCount + clickedCount + emotionsCount + emotions { + emotion + User { + id + } + } + author { + id + name + } + shoutedBy { + id + } + tags { + id + } + comments { + id + content + } + } +} diff --git a/backend/src/graphql/queries/posts/UpdatePost.gql b/backend/src/graphql/queries/posts/UpdatePost.gql new file mode 100644 index 000000000..039c7cf34 --- /dev/null +++ b/backend/src/graphql/queries/posts/UpdatePost.gql @@ -0,0 +1,42 @@ +mutation UpdatePost( + $id: ID! + $title: String! + $content: String! + $image: ImageInput + $categoryIds: [ID] + $postType: PostType + $eventInput: _EventInput +) { + UpdatePost( + id: $id + title: $title + content: $content + image: $image + categoryIds: $categoryIds + postType: $postType + eventInput: $eventInput + ) { + id + title + content + author { + id + name + slug + } + createdAt + updatedAt + categories { + id + } + postType + eventStart + eventLocationName + eventVenue + eventLocation { + id + lng + lat + } + } +} diff --git a/backend/src/graphql/queries/posts/pinPost.gql b/backend/src/graphql/queries/posts/pinPost.gql new file mode 100644 index 000000000..799721379 --- /dev/null +++ b/backend/src/graphql/queries/posts/pinPost.gql @@ -0,0 +1,21 @@ +mutation pinPost($id: ID!) { + pinPost(id: $id) { + id + title + content + author { + id + name + slug + } + pinnedBy { + id + name + role + } + createdAt + updatedAt + pinnedAt + pinned + } +} diff --git a/backend/src/graphql/queries/posts/profilePagePosts.gql b/backend/src/graphql/queries/posts/profilePagePosts.gql new file mode 100644 index 000000000..c2219ea27 --- /dev/null +++ b/backend/src/graphql/queries/posts/profilePagePosts.gql @@ -0,0 +1,13 @@ +query profilePagePosts( + $filter: _PostFilter + $first: Int + $offset: Int + $orderBy: [_PostOrdering] +) { + profilePagePosts(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { + id + title + content + groupPinned + } +} diff --git a/backend/src/graphql/queries/posts/pushPost.gql b/backend/src/graphql/queries/posts/pushPost.gql new file mode 100644 index 000000000..ecda910be --- /dev/null +++ b/backend/src/graphql/queries/posts/pushPost.gql @@ -0,0 +1,5 @@ +mutation pushPost($id: ID!) { + pushPost(id: $id) { + id + } +} diff --git a/backend/src/graphql/queries/posts/searchPosts.gql b/backend/src/graphql/queries/posts/searchPosts.gql new file mode 100644 index 000000000..ff0babb74 --- /dev/null +++ b/backend/src/graphql/queries/posts/searchPosts.gql @@ -0,0 +1,11 @@ +query searchPosts($query: String!, $firstPosts: Int, $postsOffset: Int) { + searchPosts(query: $query, firstPosts: $firstPosts, postsOffset: $postsOffset) { + postCount + posts { + __typename + id + title + content + } + } +} diff --git a/backend/src/graphql/queries/posts/toggleObservePost.gql b/backend/src/graphql/queries/posts/toggleObservePost.gql new file mode 100644 index 000000000..86be86e24 --- /dev/null +++ b/backend/src/graphql/queries/posts/toggleObservePost.gql @@ -0,0 +1,7 @@ +mutation toggleObservePost($id: ID!, $value: Boolean!) { + toggleObservePost(id: $id, value: $value) { + id + isObservedByMe + observingUsersCount + } +} diff --git a/backend/src/graphql/queries/posts/unpinPost.gql b/backend/src/graphql/queries/posts/unpinPost.gql new file mode 100644 index 000000000..547cdbe34 --- /dev/null +++ b/backend/src/graphql/queries/posts/unpinPost.gql @@ -0,0 +1,21 @@ +mutation unpinPost($id: ID!) { + unpinPost(id: $id) { + id + title + content + author { + id + name + slug + } + pinnedBy { + id + name + role + } + createdAt + updatedAt + pinned + pinnedAt + } +} diff --git a/backend/src/graphql/queries/posts/unpushPost.gql b/backend/src/graphql/queries/posts/unpushPost.gql new file mode 100644 index 000000000..0df02973b --- /dev/null +++ b/backend/src/graphql/queries/posts/unpushPost.gql @@ -0,0 +1,5 @@ +mutation unpushPost($id: ID!) { + unpushPost(id: $id) { + id + } +} diff --git a/backend/src/graphql/queries/profilePagePosts.ts b/backend/src/graphql/queries/profilePagePosts.ts deleted file mode 100644 index 04029c9a6..000000000 --- a/backend/src/graphql/queries/profilePagePosts.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { gql } from 'graphql-tag' - -export const profilePagePosts = gql` - query profilePagePosts( - $filter: _PostFilter - $first: Int - $offset: Int - $orderBy: [_PostOrdering] - ) { - profilePagePosts(filter: $filter, first: $first, offset: $offset, orderBy: $orderBy) { - id - title - content - groupPinned - } - } -` diff --git a/backend/src/graphql/queries/pushPost.ts b/backend/src/graphql/queries/pushPost.ts deleted file mode 100644 index daab22c9b..000000000 --- a/backend/src/graphql/queries/pushPost.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const pushPost = gql` - mutation pushPost($id: ID!) { - pushPost(id: $id) { - id - } - } -` diff --git a/backend/src/graphql/queries/queryLocations.gql b/backend/src/graphql/queries/queryLocations.gql new file mode 100644 index 000000000..5e01296b0 --- /dev/null +++ b/backend/src/graphql/queries/queryLocations.gql @@ -0,0 +1,6 @@ +query queryLocations($place: String!, $lang: String!) { + queryLocations(place: $place, lang: $lang) { + place_name + id + } +} diff --git a/backend/src/graphql/queries/queryLocations.ts b/backend/src/graphql/queries/queryLocations.ts deleted file mode 100644 index 0be730f25..000000000 --- a/backend/src/graphql/queries/queryLocations.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const queryLocations = gql` - query ($place: String!, $lang: String!) { - queryLocations(place: $place, lang: $lang) { - place_name - id - } - } -` diff --git a/backend/src/graphql/queries/redeemInviteCode.ts b/backend/src/graphql/queries/redeemInviteCode.ts deleted file mode 100644 index 0e82642be..000000000 --- a/backend/src/graphql/queries/redeemInviteCode.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const redeemInviteCode = gql` - mutation redeemInviteCode($code: String!) { - redeemInviteCode(code: $code) - } -` diff --git a/backend/src/graphql/queries/reports.ts b/backend/src/graphql/queries/reports.ts deleted file mode 100644 index c1a5f0ad6..000000000 --- a/backend/src/graphql/queries/reports.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { gql } from 'graphql-tag' - -export const reports = gql` - query ( - $orderBy: ReportOrdering - $reviewed: Boolean - $closed: Boolean - $first: Int - $offset: Int - ) { - reports( - orderBy: $orderBy - reviewed: $reviewed - closed: $closed - first: $first - offset: $offset - ) { - id - createdAt - updatedAt - rule - disable - closed - resource { - __typename - ... on User { - id - } - ... on Post { - id - } - ... on Comment { - id - } - } - filed { - submitter { - id - } - createdAt - reasonCategory - reasonDescription - } - } - } -` diff --git a/backend/src/graphql/queries/requestPasswordReset.ts b/backend/src/graphql/queries/requestPasswordReset.ts deleted file mode 100644 index b0c0c6eeb..000000000 --- a/backend/src/graphql/queries/requestPasswordReset.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const requestPasswordReset = gql` - mutation ($email: String!, $locale: String!) { - requestPasswordReset(email: $email, locale: $locale) - } -` diff --git a/backend/src/graphql/queries/resetPassword.ts b/backend/src/graphql/queries/resetPassword.ts deleted file mode 100644 index e9f376aef..000000000 --- a/backend/src/graphql/queries/resetPassword.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const resetPassword = gql` - mutation ($nonce: String!, $email: String!, $newPassword: String!) { - resetPassword(nonce: $nonce, email: $email, newPassword: $newPassword) - } -` diff --git a/backend/src/graphql/queries/resetTrophyBadgesSelected.ts b/backend/src/graphql/queries/resetTrophyBadgesSelected.ts deleted file mode 100644 index 18314f6ed..000000000 --- a/backend/src/graphql/queries/resetTrophyBadgesSelected.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { gql } from 'graphql-tag' - -export const resetTrophyBadgesSelected = gql` - mutation { - resetTrophyBadgesSelected { - badgeTrophiesCount - badgeTrophiesSelected { - id - isDefault - } - badgeTrophiesUnused { - id - } - badgeTrophiesUnusedCount - } - } -` diff --git a/backend/src/graphql/queries/review.ts b/backend/src/graphql/queries/review.ts deleted file mode 100644 index 32a2953fa..000000000 --- a/backend/src/graphql/queries/review.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { gql } from 'graphql-tag' - -export const review = gql` - mutation ($resourceId: ID!, $disable: Boolean, $closed: Boolean) { - review(resourceId: $resourceId, disable: $disable, closed: $closed) { - createdAt - updatedAt - resource { - __typename - ... on User { - id - disabled - } - ... on Post { - id - disabled - } - ... on Comment { - id - disabled - } - } - report { - id - createdAt - updatedAt - closed - reviewed { - createdAt - moderator { - id - } - } - } - } - } -` diff --git a/backend/src/graphql/queries/revokeBadge.ts b/backend/src/graphql/queries/revokeBadge.ts deleted file mode 100644 index 60786cc21..000000000 --- a/backend/src/graphql/queries/revokeBadge.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { gql } from 'graphql-tag' - -export const revokeBadge = gql` - mutation ($badgeId: ID!, $userId: ID!) { - revokeBadge(badgeId: $badgeId, userId: $userId) { - id - badgeTrophies { - id - } - badgeVerification { - id - isDefault - } - badgeTrophiesSelected { - id - isDefault - } - } - } -` diff --git a/backend/src/graphql/queries/rewardTrophyBadge.ts b/backend/src/graphql/queries/rewardTrophyBadge.ts deleted file mode 100644 index 5fb521296..000000000 --- a/backend/src/graphql/queries/rewardTrophyBadge.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { gql } from 'graphql-tag' - -export const rewardTrophyBadge = gql` - mutation rewardTrophyBadge($badgeId: ID!, $userId: ID!) { - rewardTrophyBadge(badgeId: $badgeId, userId: $userId) { - id - badgeVerification { - id - isDefault - } - badgeTrophiesCount - badgeTrophies { - id - } - badgeTrophiesSelected { - id - } - } - } -` diff --git a/backend/src/graphql/queries/saveCategorySettings.gql b/backend/src/graphql/queries/saveCategorySettings.gql new file mode 100644 index 000000000..147b15995 --- /dev/null +++ b/backend/src/graphql/queries/saveCategorySettings.gql @@ -0,0 +1,3 @@ +mutation saveCategorySettings($activeCategories: [String]) { + saveCategorySettings(activeCategories: $activeCategories) +} diff --git a/backend/src/graphql/queries/saveCategorySettings.ts b/backend/src/graphql/queries/saveCategorySettings.ts deleted file mode 100644 index 0c0e8bf86..000000000 --- a/backend/src/graphql/queries/saveCategorySettings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const saveCategorySettings = gql` - mutation ($activeCategories: [String]) { - saveCategorySettings(activeCategories: $activeCategories) - } -` diff --git a/backend/src/graphql/queries/searchPosts.ts b/backend/src/graphql/queries/searchPosts.ts deleted file mode 100644 index 501043f70..000000000 --- a/backend/src/graphql/queries/searchPosts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { gql } from 'graphql-tag' - -export const searchPosts = gql` - query ($query: String!, $firstPosts: Int, $postsOffset: Int) { - searchPosts(query: $query, firstPosts: $firstPosts, postsOffset: $postsOffset) { - postCount - posts { - __typename - id - title - content - } - } - } -` diff --git a/backend/src/graphql/queries/searchResults.gql b/backend/src/graphql/queries/searchResults.gql new file mode 100644 index 000000000..d0ed479f3 --- /dev/null +++ b/backend/src/graphql/queries/searchResults.gql @@ -0,0 +1,18 @@ +query searchResults($query: String!) { + searchResults(query: $query, limit: 5) { + __typename + ... on Post { + id + title + content + } + ... on User { + id + slug + name + } + ... on Tag { + id + } + } +} diff --git a/backend/src/graphql/queries/searchResults.ts b/backend/src/graphql/queries/searchResults.ts deleted file mode 100644 index b2d95da01..000000000 --- a/backend/src/graphql/queries/searchResults.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { gql } from 'graphql-tag' - -export const searchResults = gql` - query ($query: String!) { - searchResults(query: $query, limit: 5) { - __typename - ... on Post { - id - title - content - } - ... on User { - id - slug - name - } - ... on Tag { - id - } - } - } -` diff --git a/backend/src/graphql/queries/setTrophyBadgeSelected.ts b/backend/src/graphql/queries/setTrophyBadgeSelected.ts deleted file mode 100644 index 7b82626e0..000000000 --- a/backend/src/graphql/queries/setTrophyBadgeSelected.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { gql } from 'graphql-tag' - -export const setTrophyBadgeSelected = gql` - mutation setTrophyBadgeSelected($slot: Int!, $badgeId: ID) { - setTrophyBadgeSelected(slot: $slot, badgeId: $badgeId) { - badgeTrophiesCount - badgeTrophiesSelected { - id - isDefault - } - badgeTrophiesUnused { - id - } - badgeTrophiesUnusedCount - } - } -` diff --git a/backend/src/graphql/queries/setVerificationBadge.ts b/backend/src/graphql/queries/setVerificationBadge.ts deleted file mode 100644 index 74ba2c2cb..000000000 --- a/backend/src/graphql/queries/setVerificationBadge.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { gql } from 'graphql-tag' - -export const setVerificationBadge = gql` - mutation ($badgeId: ID!, $userId: ID!) { - setVerificationBadge(badgeId: $badgeId, userId: $userId) { - id - badgeVerification { - id - isDefault - } - badgeTrophies { - id - } - } - } -` diff --git a/backend/src/graphql/queries/shout.ts b/backend/src/graphql/queries/shout.ts deleted file mode 100644 index 7ccc4d461..000000000 --- a/backend/src/graphql/queries/shout.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const shout = gql` - mutation ($id: ID!) { - shout(id: $id, type: Post) - } -` diff --git a/backend/src/graphql/queries/statistics.gql b/backend/src/graphql/queries/statistics.gql new file mode 100644 index 000000000..6e94ec58f --- /dev/null +++ b/backend/src/graphql/queries/statistics.gql @@ -0,0 +1,25 @@ +query statistics { + statistics { + users + usersDeleted + posts + comments + notifications + emails + follows + shouts + invites + chatMessages + chatRooms + tags + locations + groups + inviteCodes + inviteCodesExpired + inviteCodesRedeemed + badgesRewarded + badgesDisplayed + usersVerified + reports + } +} diff --git a/backend/src/graphql/queries/statistics.ts b/backend/src/graphql/queries/statistics.ts deleted file mode 100644 index c74d5f122..000000000 --- a/backend/src/graphql/queries/statistics.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { gql } from 'graphql-tag' - -export const statistics = gql` - query statistics { - statistics { - users - usersDeleted - posts - comments - notifications - emails - follows - shouts - invites - chatMessages - chatRooms - tags - locations - groups - inviteCodes - inviteCodesExpired - inviteCodesRedeemed - badgesRewarded - badgesDisplayed - usersVerified - reports - } - } -` diff --git a/backend/src/graphql/queries/switchUserRole.ts b/backend/src/graphql/queries/switchUserRole.ts deleted file mode 100644 index 5c6d087b0..000000000 --- a/backend/src/graphql/queries/switchUserRole.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { gql } from 'graphql-tag' - -export const switchUserRole = gql` - mutation ($role: UserRole!, $id: ID!) { - switchUserRole(role: $role, id: $id) { - name - role - id - updatedAt - email - } - } -` diff --git a/backend/src/graphql/queries/toggleObservePost.ts b/backend/src/graphql/queries/toggleObservePost.ts deleted file mode 100644 index 41d506df3..000000000 --- a/backend/src/graphql/queries/toggleObservePost.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const toggleObservePost = gql` - mutation ($id: ID!, $value: Boolean!) { - toggleObservePost(id: $id, value: $value) { - isObservedByMe - observingUsersCount - } - } -` diff --git a/backend/src/graphql/queries/unblockUser.ts b/backend/src/graphql/queries/unblockUser.ts deleted file mode 100644 index 4b23f2ac1..000000000 --- a/backend/src/graphql/queries/unblockUser.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unblockUser = gql` - mutation ($id: ID!) { - unblockUser(id: $id) { - id - name - isBlocked - } - } -` diff --git a/backend/src/graphql/queries/unfollowUser.ts b/backend/src/graphql/queries/unfollowUser.ts deleted file mode 100644 index 9f68012b6..000000000 --- a/backend/src/graphql/queries/unfollowUser.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unfollowUser = gql` - mutation ($id: ID!) { - unfollowUser(id: $id) { - name - followedBy { - id - name - } - followedByCurrentUser - } - } -` diff --git a/backend/src/graphql/queries/unmuteGroup.ts b/backend/src/graphql/queries/unmuteGroup.ts deleted file mode 100644 index 47eeb47dd..000000000 --- a/backend/src/graphql/queries/unmuteGroup.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unmuteGroup = gql` - mutation ($groupId: ID!) { - unmuteGroup(groupId: $groupId) { - id - isMutedByMe - } - } -` diff --git a/backend/src/graphql/queries/unmuteUser.ts b/backend/src/graphql/queries/unmuteUser.ts deleted file mode 100644 index fefa2ddf2..000000000 --- a/backend/src/graphql/queries/unmuteUser.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unmuteUser = gql` - mutation ($id: ID!) { - unmuteUser(id: $id) { - id - name - isMuted - } - } -` diff --git a/backend/src/graphql/queries/unpinGroupPost.ts b/backend/src/graphql/queries/unpinGroupPost.ts deleted file mode 100644 index 197db59fe..000000000 --- a/backend/src/graphql/queries/unpinGroupPost.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unpinGroupPost = gql` - mutation ($id: ID!) { - unpinGroupPost(id: $id) { - id - title - content - author { - name - slug - } - pinnedBy { - id - name - role - } - createdAt - updatedAt - pinned - pinnedAt - groupPinned - } - } -` diff --git a/backend/src/graphql/queries/unpinPost.ts b/backend/src/graphql/queries/unpinPost.ts deleted file mode 100644 index bc64c18ea..000000000 --- a/backend/src/graphql/queries/unpinPost.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unpinPost = gql` - mutation ($id: ID!) { - unpinPost(id: $id) { - id - title - content - author { - name - slug - } - pinnedBy { - id - name - role - } - createdAt - updatedAt - pinned - pinnedAt - } - } -` diff --git a/backend/src/graphql/queries/unpushPost.ts b/backend/src/graphql/queries/unpushPost.ts deleted file mode 100644 index 9f60cd009..000000000 --- a/backend/src/graphql/queries/unpushPost.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unpushPost = gql` - mutation unpushPost($id: ID!) { - unpushPost(id: $id) { - id - } - } -` diff --git a/backend/src/graphql/queries/unshout.ts b/backend/src/graphql/queries/unshout.ts deleted file mode 100644 index 52d5e1369..000000000 --- a/backend/src/graphql/queries/unshout.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unshout = gql` - mutation ($id: ID!) { - unshout(id: $id, type: Post) - } -` diff --git a/backend/src/graphql/queries/updateOnlineStatus.ts b/backend/src/graphql/queries/updateOnlineStatus.ts deleted file mode 100644 index 01eaa70bb..000000000 --- a/backend/src/graphql/queries/updateOnlineStatus.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { gql } from 'graphql-tag' - -export const updateOnlineStatus = gql` - mutation ($status: OnlineStatus!) { - updateOnlineStatus(status: $status) - } -` diff --git a/backend/src/graphql/queries/userData.ts b/backend/src/graphql/queries/userData.ts deleted file mode 100644 index 4d2d5d455..000000000 --- a/backend/src/graphql/queries/userData.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { gql } from 'graphql-tag' - -export const userData = gql` - query ($id: ID!) { - userData(id: $id) { - user { - id - name - slug - } - posts { - id - title - content - comments { - content - author { - slug - } - } - } - } - } -` diff --git a/backend/src/graphql/queries/users/AddEmailAddress.gql b/backend/src/graphql/queries/users/AddEmailAddress.gql new file mode 100644 index 000000000..df8f75b3d --- /dev/null +++ b/backend/src/graphql/queries/users/AddEmailAddress.gql @@ -0,0 +1,7 @@ +mutation AddEmailAddress($email: String!) { + AddEmailAddress(email: $email) { + email + verifiedAt + createdAt + } +} diff --git a/backend/src/graphql/queries/users/CreateSocialMedia.gql b/backend/src/graphql/queries/users/CreateSocialMedia.gql new file mode 100644 index 000000000..5e4c29b0c --- /dev/null +++ b/backend/src/graphql/queries/users/CreateSocialMedia.gql @@ -0,0 +1,10 @@ +mutation CreateSocialMedia($url: String!) { + CreateSocialMedia(url: $url) { + id + url + ownedBy { + id + name + } + } +} diff --git a/backend/src/graphql/queries/users/DeleteSocialMedia.gql b/backend/src/graphql/queries/users/DeleteSocialMedia.gql new file mode 100644 index 000000000..107124165 --- /dev/null +++ b/backend/src/graphql/queries/users/DeleteSocialMedia.gql @@ -0,0 +1,6 @@ +mutation DeleteSocialMedia($id: ID!) { + DeleteSocialMedia(id: $id) { + id + url + } +} diff --git a/backend/src/graphql/queries/users/DeleteUser.gql b/backend/src/graphql/queries/users/DeleteUser.gql new file mode 100644 index 000000000..0ae9d9e9f --- /dev/null +++ b/backend/src/graphql/queries/users/DeleteUser.gql @@ -0,0 +1,26 @@ +mutation DeleteUser($id: ID!, $resource: [Deletable]) { + DeleteUser(id: $id, resource: $resource) { + id + name + about + deleted + contributions { + id + content + contentExcerpt + deleted + comments { + id + content + contentExcerpt + deleted + } + } + comments { + id + content + contentExcerpt + deleted + } + } +} diff --git a/backend/src/graphql/queries/users/UpdateSocialMedia.gql b/backend/src/graphql/queries/users/UpdateSocialMedia.gql new file mode 100644 index 000000000..daa1bf298 --- /dev/null +++ b/backend/src/graphql/queries/users/UpdateSocialMedia.gql @@ -0,0 +1,6 @@ +mutation UpdateSocialMedia($id: ID!, $url: String!) { + UpdateSocialMedia(id: $id, url: $url) { + id + url + } +} diff --git a/backend/src/graphql/queries/users/UpdateUser.gql b/backend/src/graphql/queries/users/UpdateUser.gql new file mode 100644 index 000000000..97469fc80 --- /dev/null +++ b/backend/src/graphql/queries/users/UpdateUser.gql @@ -0,0 +1,64 @@ +mutation UpdateUser( + $id: ID! + $slug: String + $name: String + $about: String + $allowEmbedIframes: Boolean + $showShoutsPublicly: Boolean + $emailNotificationSettings: [EmailNotificationSettingsInput] + $termsAndConditionsAgreedVersion: String + $avatar: ImageInput + $locationName: String # empty string '' sets it to null + $locale: String +) { + UpdateUser( + id: $id + slug: $slug + name: $name + about: $about + allowEmbedIframes: $allowEmbedIframes + showShoutsPublicly: $showShoutsPublicly + emailNotificationSettings: $emailNotificationSettings + termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion + avatar: $avatar + locationName: $locationName + locale: $locale + ) { + id + slug + name + about + allowEmbedIframes + showShoutsPublicly + termsAndConditionsAgreedVersion + termsAndConditionsAgreedAt + locationName + locale + location { + id + name + nameDE + nameEN + nameRU + } + emailNotificationSettings { + type + settings { + name + value + } + } + avatar { + url + alt + sensitive + aspectRatio + type + } + badgeVerification { + id + description + icon + } + } +} diff --git a/backend/src/graphql/queries/users/User.gql b/backend/src/graphql/queries/users/User.gql new file mode 100644 index 000000000..e4499efe3 --- /dev/null +++ b/backend/src/graphql/queries/users/User.gql @@ -0,0 +1,53 @@ +query User($id: ID, $name: String, $email: String) { + User(id: $id, name: $name, email: $email) { + id + name + badgeTrophiesCount + badgeTrophies { + id + } + badgeVerification { + id + isDefault + } + badgeTrophiesSelected { + id + isDefault + } + followedBy { + id + } + followedByCurrentUser + following { + id + name + slug + about + avatar { + url + } + comments { + id + content + contentExcerpt + } + contributions { + id + title + slug + image { + url + } + content + contentExcerpt + } + } + isMuted + isBlocked + location { + id + distanceToMe + } + activeCategories + } +} diff --git a/backend/src/graphql/queries/users/UserEmail.gql b/backend/src/graphql/queries/users/UserEmail.gql new file mode 100644 index 000000000..d13141619 --- /dev/null +++ b/backend/src/graphql/queries/users/UserEmail.gql @@ -0,0 +1,54 @@ +query UserEmail($id: ID, $name: String, $email: String) { + User(id: $id, name: $name, email: $email) { + id + name + email + badgeTrophiesCount + badgeTrophies { + id + } + badgeVerification { + id + isDefault + } + badgeTrophiesSelected { + id + isDefault + } + followedBy { + id + } + followedByCurrentUser + following { + id + name + slug + about + avatar { + url + } + comments { + id + content + contentExcerpt + } + contributions { + id + title + slug + image { + url + } + content + contentExcerpt + } + } + isMuted + isBlocked + location { + id + distanceToMe + } + activeCategories + } +} diff --git a/backend/src/graphql/queries/users/UserEmailNotificationSettings.gql b/backend/src/graphql/queries/users/UserEmailNotificationSettings.gql new file mode 100644 index 000000000..e14bb4930 --- /dev/null +++ b/backend/src/graphql/queries/users/UserEmailNotificationSettings.gql @@ -0,0 +1,60 @@ +query UserEmailNotificationSettings($id: ID, $name: String, $email: String) { + User(id: $id, name: $name, email: $email) { + id + name + badgeTrophiesCount + badgeTrophies { + id + } + badgeVerification { + id + isDefault + } + badgeTrophiesSelected { + id + isDefault + } + followedBy { + id + } + followedByCurrentUser + following { + id + name + slug + about + avatar { + url + } + comments { + id + content + contentExcerpt + } + contributions { + id + title + slug + image { + url + } + content + contentExcerpt + } + } + isMuted + isBlocked + location { + id + distanceToMe + } + emailNotificationSettings { + type + settings { + name + value + } + } + activeCategories + } +} diff --git a/backend/src/graphql/queries/users/VerifyEmailAddress.gql b/backend/src/graphql/queries/users/VerifyEmailAddress.gql new file mode 100644 index 000000000..d6183d13f --- /dev/null +++ b/backend/src/graphql/queries/users/VerifyEmailAddress.gql @@ -0,0 +1,7 @@ +mutation VerifyEmailAddress($email: String!, $nonce: String!) { + VerifyEmailAddress(email: $email, nonce: $nonce) { + email + createdAt + verifiedAt + } +} diff --git a/backend/src/graphql/queries/users/availableRoles.gql b/backend/src/graphql/queries/users/availableRoles.gql new file mode 100644 index 000000000..403a8b1e0 --- /dev/null +++ b/backend/src/graphql/queries/users/availableRoles.gql @@ -0,0 +1,3 @@ +query availableRoles { + availableRoles +} diff --git a/backend/src/graphql/queries/users/switchUserRole.gql b/backend/src/graphql/queries/users/switchUserRole.gql new file mode 100644 index 000000000..3dfe3b9a1 --- /dev/null +++ b/backend/src/graphql/queries/users/switchUserRole.gql @@ -0,0 +1,9 @@ +mutation switchUserRole($role: UserRole!, $id: ID!) { + switchUserRole(role: $role, id: $id) { + name + role + id + updatedAt + email + } +} diff --git a/backend/src/graphql/queries/users/updateOnlineStatus.gql b/backend/src/graphql/queries/users/updateOnlineStatus.gql new file mode 100644 index 000000000..771775da4 --- /dev/null +++ b/backend/src/graphql/queries/users/updateOnlineStatus.gql @@ -0,0 +1,3 @@ +mutation updateOnlineStatus($status: OnlineStatus!) { + updateOnlineStatus(status: $status) +} diff --git a/backend/src/graphql/queries/users/userData.gql b/backend/src/graphql/queries/users/userData.gql new file mode 100644 index 000000000..1b510a3ea --- /dev/null +++ b/backend/src/graphql/queries/users/userData.gql @@ -0,0 +1,22 @@ +query userData($id: ID!) { + userData(id: $id) { + user { + id + name + slug + } + posts { + id + title + content + comments { + id + content + author { + id + slug + } + } + } + } +} diff --git a/backend/src/graphql/queries/validateInviteCode.ts b/backend/src/graphql/queries/validateInviteCode.ts deleted file mode 100644 index 01aa918d8..000000000 --- a/backend/src/graphql/queries/validateInviteCode.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { gql } from 'graphql-tag' - -export const unauthenticatedValidateInviteCode = gql` - query validateInviteCode($code: String!) { - validateInviteCode(code: $code) { - code - invitedTo { - groupType - name - about - avatar { - url - } - } - generatedBy { - name - avatar { - url - } - } - isValid - } - } -` - -export const authenticatedValidateInviteCode = gql` - query validateInviteCode($code: String!) { - validateInviteCode(code: $code) { - code - invitedTo { - id - groupType - name - about - avatar { - url - } - } - generatedBy { - id - name - avatar { - url - } - } - isValid - } - } -` diff --git a/backend/src/graphql/resolvers/attachments/attachments.spec.ts b/backend/src/graphql/resolvers/attachments/attachments.spec.ts index 190301236..8e576647a 100644 --- a/backend/src/graphql/resolvers/attachments/attachments.spec.ts +++ b/backend/src/graphql/resolvers/attachments/attachments.spec.ts @@ -11,8 +11,8 @@ import { Upload } from '@aws-sdk/lib-storage' import Factory, { cleanDatabase } from '@db/factories' import { UserInputError } from '@graphql/errors' -import { CreateMessage } from '@graphql/queries/CreateMessage' -import { CreateRoom } from '@graphql/queries/CreateRoom' +import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql' +import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql' import { createApolloTestSetup } from '@root/test/helpers' import { attachments } from './attachments' diff --git a/backend/src/graphql/resolvers/badges.spec.ts b/backend/src/graphql/resolvers/badges.spec.ts index 6e2fa06fd..b1ba26dd1 100644 --- a/backend/src/graphql/resolvers/badges.spec.ts +++ b/backend/src/graphql/resolvers/badges.spec.ts @@ -4,11 +4,11 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ import { TROPHY_BADGES_SELECTED_MAX } from '@constants/badges' import Factory, { cleanDatabase } from '@db/factories' -import { revokeBadge } from '@graphql/queries/revokeBadge' -import { rewardTrophyBadge } from '@graphql/queries/rewardTrophyBadge' -import { setTrophyBadgeSelected } from '@graphql/queries/setTrophyBadgeSelected' -import { setVerificationBadge } from '@graphql/queries/setVerificationBadge' -import { User } from '@graphql/queries/User' +import revokeBadge from '@graphql/queries/badges/revokeBadge.gql' +import rewardTrophyBadge from '@graphql/queries/badges/rewardTrophyBadge.gql' +import setTrophyBadgeSelected from '@graphql/queries/badges/setTrophyBadgeSelected.gql' +import setVerificationBadge from '@graphql/queries/badges/setVerificationBadge.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/comments.spec.ts b/backend/src/graphql/resolvers/comments.spec.ts index a896879a6..455a2d851 100644 --- a/backend/src/graphql/resolvers/comments.spec.ts +++ b/backend/src/graphql/resolvers/comments.spec.ts @@ -3,9 +3,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateComment } from '@graphql/queries/CreateComment' -import { DeleteComment } from '@graphql/queries/DeleteComment' -import { UpdateComment as updateComment } from '@graphql/queries/UpdateComment' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import DeleteComment from '@graphql/queries/comments/DeleteComment.gql' +import updateComment from '@graphql/queries/comments/UpdateComment.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/donations.spec.ts b/backend/src/graphql/resolvers/donations.spec.ts index ec150006e..67faebf8f 100644 --- a/backend/src/graphql/resolvers/donations.spec.ts +++ b/backend/src/graphql/resolvers/donations.spec.ts @@ -4,8 +4,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { Donations } from '@graphql/queries/Donations' -import { UpdateDonations as updateDonations } from '@graphql/queries/UpdateDonations' +import Donations from '@graphql/queries/donations/Donations.gql' +import updateDonations from '@graphql/queries/donations/UpdateDonations.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/emails.spec.ts b/backend/src/graphql/resolvers/emails.spec.ts index da578f0df..f9ebba559 100644 --- a/backend/src/graphql/resolvers/emails.spec.ts +++ b/backend/src/graphql/resolvers/emails.spec.ts @@ -3,9 +3,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { AddEmailAddress } from '@graphql/queries/AddEmailAddress' -import { VerifyEmailAddress } from '@graphql/queries/VerifyEmailAddress' -import { VerifyNonce } from '@graphql/queries/VerifyNonce' +import VerifyNonce from '@graphql/queries/auth/VerifyNonce.gql' +import AddEmailAddress from '@graphql/queries/users/AddEmailAddress.gql' +import VerifyEmailAddress from '@graphql/queries/users/VerifyEmailAddress.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/embeds.spec.ts b/backend/src/graphql/resolvers/embeds.spec.ts index e2dfbfdcd..8c16546d2 100644 --- a/backend/src/graphql/resolvers/embeds.spec.ts +++ b/backend/src/graphql/resolvers/embeds.spec.ts @@ -8,7 +8,7 @@ import path from 'node:path' import fetch from 'node-fetch' -import { embed } from '@graphql/queries/embed' +import embed from '@graphql/queries/embed.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/follow.spec.ts b/backend/src/graphql/resolvers/follow.spec.ts index f9214d7fe..85901970c 100644 --- a/backend/src/graphql/resolvers/follow.spec.ts +++ b/backend/src/graphql/resolvers/follow.spec.ts @@ -3,9 +3,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { followUser } from '@graphql/queries/followUser' -import { unfollowUser } from '@graphql/queries/unfollowUser' -import { User } from '@graphql/queries/User' +import followUser from '@graphql/queries/interactions/followUser.gql' +import unfollowUser from '@graphql/queries/interactions/unfollowUser.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/groups.spec.ts b/backend/src/graphql/resolvers/groups.spec.ts index ee3f5a6f5..9e27df7a1 100644 --- a/backend/src/graphql/resolvers/groups.spec.ts +++ b/backend/src/graphql/resolvers/groups.spec.ts @@ -7,14 +7,14 @@ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable jest/no-commented-out-tests */ import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { Group as groupQuery } from '@graphql/queries/Group' -import { GroupMembers as groupMembersQuery } from '@graphql/queries/GroupMembers' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { LeaveGroup } from '@graphql/queries/LeaveGroup' -import { RemoveUserFromGroup } from '@graphql/queries/RemoveUserFromGroup' -import { UpdateGroup } from '@graphql/queries/UpdateGroup' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import groupQuery from '@graphql/queries/groups/Group.gql' +import groupMembersQuery from '@graphql/queries/groups/GroupMembers.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import LeaveGroup from '@graphql/queries/groups/LeaveGroup.gql' +import RemoveUserFromGroup from '@graphql/queries/groups/RemoveUserFromGroup.gql' +import UpdateGroup from '@graphql/queries/groups/UpdateGroup.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/index.ts b/backend/src/graphql/resolvers/index.ts index 3a1c8cf87..19536c0c3 100644 --- a/backend/src/graphql/resolvers/index.ts +++ b/backend/src/graphql/resolvers/index.ts @@ -5,5 +5,5 @@ import { mergeResolvers } from '@graphql-tools/merge' // the files must be correctly evaluated in built and dev state - therefore accept both js & ts files // eslint-disable-next-line n/no-sync -const resolversArray = loadFilesSync(path.join(__dirname, './!(*.spec).(ts|js)')) +const resolversArray = loadFilesSync(path.join(__dirname, './!(*.spec|index).(ts|js)')) export default mergeResolvers(resolversArray) diff --git a/backend/src/graphql/resolvers/inviteCodes.spec.ts b/backend/src/graphql/resolvers/inviteCodes.spec.ts index 92fea0a57..d416565f3 100644 --- a/backend/src/graphql/resolvers/inviteCodes.spec.ts +++ b/backend/src/graphql/resolvers/inviteCodes.spec.ts @@ -4,19 +4,17 @@ /* eslint-disable jest/expect-expect */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { currentUser } from '@graphql/queries/currentUser' -import { generateGroupInviteCode } from '@graphql/queries/generateGroupInviteCode' -import { generatePersonalInviteCode } from '@graphql/queries/generatePersonalInviteCode' -import { Group } from '@graphql/queries/Group' -import { GroupMembers } from '@graphql/queries/GroupMembers' -import { invalidateInviteCode } from '@graphql/queries/invalidateInviteCode' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { redeemInviteCode } from '@graphql/queries/redeemInviteCode' -import { - authenticatedValidateInviteCode, - unauthenticatedValidateInviteCode, -} from '@graphql/queries/validateInviteCode' +import currentUser from '@graphql/queries/auth/currentUser.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import Group from '@graphql/queries/groups/Group.gql' +import GroupMembers from '@graphql/queries/groups/GroupMembers.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import authenticatedValidateInviteCode from '@graphql/queries/invites/authenticatedValidateInviteCode.gql' +import generateGroupInviteCode from '@graphql/queries/invites/generateGroupInviteCode.gql' +import generatePersonalInviteCode from '@graphql/queries/invites/generatePersonalInviteCode.gql' +import invalidateInviteCode from '@graphql/queries/invites/invalidateInviteCode.gql' +import redeemInviteCode from '@graphql/queries/invites/redeemInviteCode.gql' +import unauthenticatedValidateInviteCode from '@graphql/queries/invites/unauthenticatedValidateInviteCode.gql' import { createApolloTestSetup, TEST_CONFIG } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -158,7 +156,7 @@ describe('validateInviteCode', () => { ) }) - it('returns the inviteCode when the code exists and hs not expired', async () => { + it('returns the inviteCode when the code exists and has not expired', async () => { await expect( query({ query: unauthenticatedValidateInviteCode, variables: { code: 'PERSNL' } }), ).resolves.toEqual( diff --git a/backend/src/graphql/resolvers/locations.spec.ts b/backend/src/graphql/resolvers/locations.spec.ts index bdb4a0e24..9d894f463 100644 --- a/backend/src/graphql/resolvers/locations.spec.ts +++ b/backend/src/graphql/resolvers/locations.spec.ts @@ -2,8 +2,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { UpdateUser } from '@graphql/queries/UpdateUser' -import { User } from '@graphql/queries/User' +import UpdateUser from '@graphql/queries/users/UpdateUser.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -174,9 +174,9 @@ describe('distanceToMe', () => { data: { User: [ expect.objectContaining({ - location: { + location: expect.objectContaining({ distanceToMe: 0, - }, + }), }), ], }, @@ -195,9 +195,9 @@ describe('distanceToMe', () => { data: { User: [ expect.objectContaining({ - location: { + location: expect.objectContaining({ distanceToMe: 0, - }, + }), }), ], }, @@ -216,9 +216,9 @@ describe('distanceToMe', () => { data: { User: [ expect.objectContaining({ - location: { + location: expect.objectContaining({ distanceToMe: 746, - }, + }), }), ], }, @@ -237,9 +237,9 @@ describe('distanceToMe', () => { data: { User: [ expect.objectContaining({ - location: { + location: expect.objectContaining({ distanceToMe: null, - }, + }), }), ], }, diff --git a/backend/src/graphql/resolvers/messages.spec.ts b/backend/src/graphql/resolvers/messages.spec.ts index c3f845d27..427a04ba2 100644 --- a/backend/src/graphql/resolvers/messages.spec.ts +++ b/backend/src/graphql/resolvers/messages.spec.ts @@ -11,11 +11,11 @@ import { Upload } from 'graphql-upload/public/index' import pubsubContext from '@context/pubsub' import Factory, { cleanDatabase } from '@db/factories' -import { CreateMessage } from '@graphql/queries/CreateMessage' -import { CreateRoom } from '@graphql/queries/CreateRoom' -import { MarkMessagesAsSeen } from '@graphql/queries/MarkMessagesAsSeen' -import { Message } from '@graphql/queries/Message' -import { Room } from '@graphql/queries/Room' +import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql' +import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql' +import MarkMessagesAsSeen from '@graphql/queries/messaging/MarkMessagesAsSeen.gql' +import Message from '@graphql/queries/messaging/Message.gql' +import Room from '@graphql/queries/messaging/Room.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/moderation.spec.ts b/backend/src/graphql/resolvers/moderation.spec.ts index 1181c04a0..330c6528f 100644 --- a/backend/src/graphql/resolvers/moderation.spec.ts +++ b/backend/src/graphql/resolvers/moderation.spec.ts @@ -4,7 +4,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { review } from '@graphql/queries/review' +import review from '@graphql/queries/moderation/review.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/notifications.spec.ts b/backend/src/graphql/resolvers/notifications.spec.ts index 112679040..f2777b5b0 100644 --- a/backend/src/graphql/resolvers/notifications.spec.ts +++ b/backend/src/graphql/resolvers/notifications.spec.ts @@ -5,10 +5,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-confusing-void-expression */ import Factory, { cleanDatabase } from '@db/factories' -import { DeletePost } from '@graphql/queries/DeletePost' -import { markAllAsRead } from '@graphql/queries/markAllAsRead' -import { markAsRead } from '@graphql/queries/markAsRead' -import { notifications } from '@graphql/queries/notifications' +import markAllAsRead from '@graphql/queries/notifications/markAllAsRead.gql' +import markAsRead from '@graphql/queries/notifications/markAsRead.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import DeletePost from '@graphql/queries/posts/DeletePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -319,8 +319,10 @@ describe('given some notifications', () => { const { data } = await mutate({ mutation: markAsRead, variables }) expect(data).toEqual({ markAsRead: { + id: expect.any(String), from: { __typename: 'Post', + id: 'p3', content: 'You have been mentioned in a post', }, read: true, @@ -356,8 +358,10 @@ describe('given some notifications', () => { const { data } = await mutate({ mutation: markAsRead, variables }) expect(data).toEqual({ markAsRead: { + id: expect.any(String), from: { __typename: 'Comment', + id: 'c2', content: 'You have been mentioned in a comment', }, read: true, @@ -398,13 +402,21 @@ describe('given some notifications', () => { expect.arrayContaining([ { createdAt: '2019-08-30T19:33:48.651Z', - from: { __typename: 'Comment', content: 'You have been mentioned in a comment' }, + from: { + __typename: 'Comment', + id: 'c2', + content: 'You have been mentioned in a comment', + }, id: 'mentioned_in_comment/c2/you', read: true, }, { createdAt: '2019-08-31T17:33:48.651Z', - from: { __typename: 'Post', content: 'You have been mentioned in a post' }, + from: { + __typename: 'Post', + id: 'p3', + content: 'You have been mentioned in a post', + }, id: 'mentioned_in_post/p3/you', read: true, }, diff --git a/backend/src/graphql/resolvers/passwordReset.spec.ts b/backend/src/graphql/resolvers/passwordReset.spec.ts index 1c5cf955e..b1a374573 100644 --- a/backend/src/graphql/resolvers/passwordReset.spec.ts +++ b/backend/src/graphql/resolvers/passwordReset.spec.ts @@ -3,9 +3,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ import registrationConstants from '@constants/registrationBranded' import Factory, { cleanDatabase } from '@db/factories' -import { login } from '@graphql/queries/login' -import { requestPasswordReset } from '@graphql/queries/requestPasswordReset' -import { resetPassword } from '@graphql/queries/resetPassword' +import login from '@graphql/queries/auth/login.gql' +import requestPasswordReset from '@graphql/queries/auth/requestPasswordReset.gql' +import resetPassword from '@graphql/queries/auth/resetPassword.gql' import { createApolloTestSetup } from '@root/test/helpers' import createPasswordReset from './helpers/createPasswordReset' diff --git a/backend/src/graphql/resolvers/posts.filter.spec.ts b/backend/src/graphql/resolvers/posts.filter.spec.ts index 7d46d4f42..13892e4f8 100644 --- a/backend/src/graphql/resolvers/posts.filter.spec.ts +++ b/backend/src/graphql/resolvers/posts.filter.spec.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ import Factory, { cleanDatabase } from '@db/factories' -import { CreatePost } from '@graphql/queries/CreatePost' -import { Post } from '@graphql/queries/Post' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import Post from '@graphql/queries/posts/Post.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/posts.group.pin.spec.ts b/backend/src/graphql/resolvers/posts.group.pin.spec.ts index 8cdb86c5d..113ec11b1 100644 --- a/backend/src/graphql/resolvers/posts.group.pin.spec.ts +++ b/backend/src/graphql/resolvers/posts.group.pin.spec.ts @@ -2,12 +2,12 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { pinGroupPost } from '@graphql/queries/pinGroupPost' -import { profilePagePosts } from '@graphql/queries/profilePagePosts' -import { unpinGroupPost } from '@graphql/queries/unpinGroupPost' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import pinGroupPost from '@graphql/queries/groups/pinGroupPost.gql' +import unpinGroupPost from '@graphql/queries/groups/unpinGroupPost.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import profilePagePosts from '@graphql/queries/posts/profilePagePosts.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -98,14 +98,6 @@ beforeEach(async () => { roleInGroup: 'admin', }, }) - await mutate({ - mutation: ChangeGroupMemberRole, - variables: { - groupId: 'closed-group', - userId: 'all-groups-user', - roleInGroup: 'usual', - }, - }) authenticatedUser = await anyUser.toJson() await mutate({ mutation: CreatePost, diff --git a/backend/src/graphql/resolvers/posts.inGroups.spec.ts b/backend/src/graphql/resolvers/posts.inGroups.spec.ts index bcdfbe26c..cd522694d 100644 --- a/backend/src/graphql/resolvers/posts.inGroups.spec.ts +++ b/backend/src/graphql/resolvers/posts.inGroups.spec.ts @@ -3,15 +3,15 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { LeaveGroup } from '@graphql/queries/LeaveGroup' -import { Post } from '@graphql/queries/Post' -import { profilePagePosts } from '@graphql/queries/profilePagePosts' -import { searchPosts } from '@graphql/queries/searchPosts' -import { SignupVerification } from '@graphql/queries/SignupVerification' +import SignupVerification from '@graphql/queries/auth/SignupVerification.gql' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import LeaveGroup from '@graphql/queries/groups/LeaveGroup.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import Post from '@graphql/queries/posts/Post.gql' +import profilePagePosts from '@graphql/queries/posts/profilePagePosts.gql' +import searchPosts from '@graphql/queries/posts/searchPosts.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/posts.markTeaserAsViewed.spec.ts b/backend/src/graphql/resolvers/posts.markTeaserAsViewed.spec.ts index 3791e76d0..d64edf095 100644 --- a/backend/src/graphql/resolvers/posts.markTeaserAsViewed.spec.ts +++ b/backend/src/graphql/resolvers/posts.markTeaserAsViewed.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { markTeaserAsViewed } from '@graphql/queries/markTeaserAsViewed' +import markTeaserAsViewed from '@graphql/queries/notifications/markTeaserAsViewed.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/posts.observe.spec.ts b/backend/src/graphql/resolvers/posts.observe.spec.ts index ab61cc22a..77d7ca53f 100644 --- a/backend/src/graphql/resolvers/posts.observe.spec.ts +++ b/backend/src/graphql/resolvers/posts.observe.spec.ts @@ -2,10 +2,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreatePost } from '@graphql/queries/CreatePost' -import { Post } from '@graphql/queries/Post' -import { toggleObservePost } from '@graphql/queries/toggleObservePost' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import Post from '@graphql/queries/posts/Post.gql' +import toggleObservePost from '@graphql/queries/posts/toggleObservePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/posts.spec.ts b/backend/src/graphql/resolvers/posts.spec.ts index 0b15fde55..4d247f95d 100644 --- a/backend/src/graphql/resolvers/posts.spec.ts +++ b/backend/src/graphql/resolvers/posts.spec.ts @@ -5,19 +5,19 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ /* eslint-disable jest/no-commented-out-tests */ import Factory, { cleanDatabase } from '@db/factories' -import { AddPostEmotions } from '@graphql/queries/AddPostEmotions' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { DeletePost } from '@graphql/queries/DeletePost' -import { pinPost } from '@graphql/queries/pinPost' -import { Post } from '@graphql/queries/Post' -import { PostsEmotionsByCurrentUser } from '@graphql/queries/PostsEmotionsByCurrentUser' -import { PostsEmotionsCountByEmotion } from '@graphql/queries/PostsEmotionsCountByEmotion' -import { pushPost } from '@graphql/queries/pushPost' -import { RemovePostEmotions } from '@graphql/queries/RemovePostEmotions' -import { unpinPost } from '@graphql/queries/unpinPost' -import { unpushPost } from '@graphql/queries/unpushPost' -import { UpdatePost } from '@graphql/queries/UpdatePost' +import AddPostEmotions from '@graphql/queries/emotions/AddPostEmotions.gql' +import PostsEmotionsByCurrentUser from '@graphql/queries/emotions/PostsEmotionsByCurrentUser.gql' +import PostsEmotionsCountByEmotion from '@graphql/queries/emotions/PostsEmotionsCountByEmotion.gql' +import RemovePostEmotions from '@graphql/queries/emotions/RemovePostEmotions.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import DeletePost from '@graphql/queries/posts/DeletePost.gql' +import pinPost from '@graphql/queries/posts/pinPost.gql' +import Post from '@graphql/queries/posts/Post.gql' +import pushPost from '@graphql/queries/posts/pushPost.gql' +import unpinPost from '@graphql/queries/posts/unpinPost.gql' +import unpushPost from '@graphql/queries/posts/unpushPost.gql' +import UpdatePost from '@graphql/queries/posts/UpdatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type Image from '@db/models/Image' diff --git a/backend/src/graphql/resolvers/registration.spec.ts b/backend/src/graphql/resolvers/registration.spec.ts index d0ec06601..a5ed50fbe 100644 --- a/backend/src/graphql/resolvers/registration.spec.ts +++ b/backend/src/graphql/resolvers/registration.spec.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-use-before-define */ import Factory, { cleanDatabase } from '@db/factories' -import { Signup } from '@graphql/queries/Signup' -import { SignupVerification } from '@graphql/queries/SignupVerification' +import Signup from '@graphql/queries/auth/Signup.gql' +import SignupVerification from '@graphql/queries/auth/SignupVerification.gql' import { createApolloTestSetup } from '@root/test/helpers' import type EmailAddress from '@db/models/EmailAddress' diff --git a/backend/src/graphql/resolvers/reports.spec.ts b/backend/src/graphql/resolvers/reports.spec.ts index 0a5be8e4f..a85810948 100644 --- a/backend/src/graphql/resolvers/reports.spec.ts +++ b/backend/src/graphql/resolvers/reports.spec.ts @@ -5,9 +5,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { fileReport } from '@graphql/queries/fileReport' -import { reports } from '@graphql/queries/reports' -import { review } from '@graphql/queries/review' +import fileReport from '@graphql/queries/moderation/fileReport.gql' +import reports from '@graphql/queries/moderation/reports.gql' +import review from '@graphql/queries/moderation/review.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/roles.spec.ts b/backend/src/graphql/resolvers/roles.spec.ts index ee449b542..91dc3a5ef 100644 --- a/backend/src/graphql/resolvers/roles.spec.ts +++ b/backend/src/graphql/resolvers/roles.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { availableRoles } from '@graphql/queries/availableRoles' +import availableRoles from '@graphql/queries/users/availableRoles.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/rooms.spec.ts b/backend/src/graphql/resolvers/rooms.spec.ts index d77220a97..a08d55b79 100644 --- a/backend/src/graphql/resolvers/rooms.spec.ts +++ b/backend/src/graphql/resolvers/rooms.spec.ts @@ -3,10 +3,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateMessage } from '@graphql/queries/CreateMessage' -import { CreateRoom } from '@graphql/queries/CreateRoom' -import { Room } from '@graphql/queries/Room' -import { UnreadRooms } from '@graphql/queries/UnreadRooms' +import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql' +import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql' +import Room from '@graphql/queries/messaging/Room.gql' +import UnreadRooms from '@graphql/queries/messaging/UnreadRooms.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/searches.spec.ts b/backend/src/graphql/resolvers/searches.spec.ts index d20f9f6eb..9fc61ce49 100644 --- a/backend/src/graphql/resolvers/searches.spec.ts +++ b/backend/src/graphql/resolvers/searches.spec.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { searchPosts } from '@graphql/queries/searchPosts' -import { searchResults } from '@graphql/queries/searchResults' +import searchPosts from '@graphql/queries/posts/searchPosts.gql' +import searchResults from '@graphql/queries/searchResults.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/shout.spec.ts b/backend/src/graphql/resolvers/shout.spec.ts index 1fd1e17a2..9c68a3c68 100644 --- a/backend/src/graphql/resolvers/shout.spec.ts +++ b/backend/src/graphql/resolvers/shout.spec.ts @@ -4,9 +4,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { Post } from '@graphql/queries/Post' -import { shout } from '@graphql/queries/shout' -import { unshout } from '@graphql/queries/unshout' +import shout from '@graphql/queries/emotions/shout.gql' +import unshout from '@graphql/queries/emotions/unshout.gql' +import Post from '@graphql/queries/posts/Post.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/socialMedia.spec.ts b/backend/src/graphql/resolvers/socialMedia.spec.ts index 7dc62fb7f..9e7c015d0 100644 --- a/backend/src/graphql/resolvers/socialMedia.spec.ts +++ b/backend/src/graphql/resolvers/socialMedia.spec.ts @@ -5,9 +5,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateSocialMedia } from '@graphql/queries/CreateSocialMedia' -import { DeleteSocialMedia } from '@graphql/queries/DeleteSocialMedia' -import { UpdateSocialMedia } from '@graphql/queries/UpdateSocialMedia' +import CreateSocialMedia from '@graphql/queries/users/CreateSocialMedia.gql' +import DeleteSocialMedia from '@graphql/queries/users/DeleteSocialMedia.gql' +import UpdateSocialMedia from '@graphql/queries/users/UpdateSocialMedia.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/statistics.spec.ts b/backend/src/graphql/resolvers/statistics.spec.ts index fdf203c2f..cb3e285ae 100644 --- a/backend/src/graphql/resolvers/statistics.spec.ts +++ b/backend/src/graphql/resolvers/statistics.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { statistics } from '@graphql/queries/statistics' +import statistics from '@graphql/queries/statistics.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/userData.spec.ts b/backend/src/graphql/resolvers/userData.spec.ts index 3e0a7b993..d5c1a073c 100644 --- a/backend/src/graphql/resolvers/userData.spec.ts +++ b/backend/src/graphql/resolvers/userData.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { userData } from '@graphql/queries/userData' +import userData from '@graphql/queries/users/userData.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/user_management.spec.ts b/backend/src/graphql/resolvers/user_management.spec.ts index 2741f1260..be81129ad 100644 --- a/backend/src/graphql/resolvers/user_management.spec.ts +++ b/backend/src/graphql/resolvers/user_management.spec.ts @@ -13,10 +13,10 @@ import { verify } from 'jsonwebtoken' import { categories } from '@constants/categories' import Factory, { cleanDatabase } from '@db/factories' -import { changePassword } from '@graphql/queries/changePassword' -import { currentUser } from '@graphql/queries/currentUser' -import { login } from '@graphql/queries/login' -import { saveCategorySettings } from '@graphql/queries/saveCategorySettings' +import changePassword from '@graphql/queries/auth/changePassword.gql' +import currentUser from '@graphql/queries/auth/currentUser.gql' +import login from '@graphql/queries/auth/login.gql' +import saveCategorySettings from '@graphql/queries/saveCategorySettings.gql' import { decode } from '@jwt/decode' import { encode } from '@jwt/encode' import { createApolloTestSetup, TEST_CONFIG } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/users.spec.ts b/backend/src/graphql/resolvers/users.spec.ts index 57e1977fd..059288586 100644 --- a/backend/src/graphql/resolvers/users.spec.ts +++ b/backend/src/graphql/resolvers/users.spec.ts @@ -8,14 +8,15 @@ import { categories } from '@constants/categories' import pubsubContext from '@context/pubsub' import Factory, { cleanDatabase } from '@db/factories' -import { DeleteUser } from '@graphql/queries/DeleteUser' -import { resetTrophyBadgesSelected } from '@graphql/queries/resetTrophyBadgesSelected' -import { saveCategorySettings } from '@graphql/queries/saveCategorySettings' -import { setTrophyBadgeSelected } from '@graphql/queries/setTrophyBadgeSelected' -import { switchUserRole } from '@graphql/queries/switchUserRole' -import { updateOnlineStatus } from '@graphql/queries/updateOnlineStatus' -import { UpdateUser } from '@graphql/queries/UpdateUser' -import { UserEmailNotificationSettings, User as userQuery } from '@graphql/queries/User' +import resetTrophyBadgesSelected from '@graphql/queries/badges/resetTrophyBadgesSelected.gql' +import setTrophyBadgeSelected from '@graphql/queries/badges/setTrophyBadgeSelected.gql' +import saveCategorySettings from '@graphql/queries/saveCategorySettings.gql' +import DeleteUser from '@graphql/queries/users/DeleteUser.gql' +import switchUserRole from '@graphql/queries/users/switchUserRole.gql' +import updateOnlineStatus from '@graphql/queries/users/updateOnlineStatus.gql' +import UpdateUser from '@graphql/queries/users/UpdateUser.gql' +import userQuery from '@graphql/queries/users/User.gql' +import UserEmailNotificationSettings from '@graphql/queries/users/UserEmailNotificationSettings.gql' import { createApolloTestSetup } from '@root/test/helpers' import type User from '@db/models/User' @@ -1103,6 +1104,7 @@ describe('setTrophyBadgeSelected', () => { expect.objectContaining({ data: { setTrophyBadgeSelected: { + id: expect.any(String), badgeTrophiesCount: 2, badgeTrophiesSelected: [ { @@ -1161,6 +1163,7 @@ describe('setTrophyBadgeSelected', () => { expect.objectContaining({ data: { setTrophyBadgeSelected: { + id: expect.any(String), badgeTrophiesCount: 2, badgeTrophiesSelected: [ { @@ -1230,6 +1233,7 @@ describe('setTrophyBadgeSelected', () => { expect.objectContaining({ data: { setTrophyBadgeSelected: { + id: expect.any(String), badgeTrophiesCount: 2, badgeTrophiesSelected: [ { @@ -1291,6 +1295,7 @@ describe('setTrophyBadgeSelected', () => { expect.objectContaining({ data: { setTrophyBadgeSelected: { + id: expect.any(String), badgeTrophiesCount: 2, badgeTrophiesSelected: [ { @@ -1406,6 +1411,7 @@ describe('resetTrophyBadgesSelected', () => { expect.objectContaining({ data: { resetTrophyBadgesSelected: { + id: expect.any(String), badgeTrophiesCount: 2, badgeTrophiesSelected: [ { diff --git a/backend/src/graphql/resolvers/users/blockedUsers.spec.ts b/backend/src/graphql/resolvers/users/blockedUsers.spec.ts index 4550a4211..ff6e7e1c2 100644 --- a/backend/src/graphql/resolvers/users/blockedUsers.spec.ts +++ b/backend/src/graphql/resolvers/users/blockedUsers.spec.ts @@ -4,11 +4,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable jest/expect-expect */ import { cleanDatabase } from '@db/factories' -import { blockedUsers } from '@graphql/queries/blockedUsers' -import { blockUser } from '@graphql/queries/blockUser' -import { Post } from '@graphql/queries/Post' -import { unblockUser } from '@graphql/queries/unblockUser' -import { User } from '@graphql/queries/User' +import blockedUsers from '@graphql/queries/interactions/blockedUsers.gql' +import blockUser from '@graphql/queries/interactions/blockUser.gql' +import unblockUser from '@graphql/queries/interactions/unblockUser.gql' +import Post from '@graphql/queries/posts/Post.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/users/location.spec.ts b/backend/src/graphql/resolvers/users/location.spec.ts index daa45c352..4e798b1c5 100644 --- a/backend/src/graphql/resolvers/users/location.spec.ts +++ b/backend/src/graphql/resolvers/users/location.spec.ts @@ -2,8 +2,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ import Factory, { cleanDatabase } from '@db/factories' -import { queryLocations } from '@graphql/queries/queryLocations' -import { UpdateUser } from '@graphql/queries/UpdateUser' +import queryLocations from '@graphql/queries/queryLocations.gql' +import UpdateUser from '@graphql/queries/users/UpdateUser.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/graphql/resolvers/users/mutedUsers.spec.ts b/backend/src/graphql/resolvers/users/mutedUsers.spec.ts index f94cf59fe..e2ad2ff9d 100644 --- a/backend/src/graphql/resolvers/users/mutedUsers.spec.ts +++ b/backend/src/graphql/resolvers/users/mutedUsers.spec.ts @@ -5,11 +5,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ import { cleanDatabase } from '@db/factories' -import { mutedUsers } from '@graphql/queries/mutedUsers' -import { muteUser } from '@graphql/queries/muteUser' -import { Post } from '@graphql/queries/Post' -import { unmuteUser } from '@graphql/queries/unmuteUser' -import { User } from '@graphql/queries/User' +import mutedUsers from '@graphql/queries/interactions/mutedUsers.gql' +import muteUser from '@graphql/queries/interactions/muteUser.gql' +import unmuteUser from '@graphql/queries/interactions/unmuteUser.gql' +import Post from '@graphql/queries/posts/Post.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/categories.spec.ts b/backend/src/middleware/categories.spec.ts index 3fef0d1fe..22b902bdc 100644 --- a/backend/src/middleware/categories.spec.ts +++ b/backend/src/middleware/categories.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-call */ import Factory, { cleanDatabase } from '@db/factories' -import { Category } from '@graphql/queries/Category' +import Category from '@graphql/queries/Category.gql' import { createApolloTestSetup } from '@root/test/helpers' import { categories } from '@src/constants/categories' diff --git a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.ts b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.ts index 62f33c701..27ca7627e 100644 --- a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.ts +++ b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.ts @@ -3,9 +3,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-shadow */ import { cleanDatabase } from '@db/factories' -import { CreatePost } from '@graphql/queries/CreatePost' -import { Post } from '@graphql/queries/Post' -import { UpdatePost } from '@graphql/queries/UpdatePost' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import Post from '@graphql/queries/posts/Post.gql' +import UpdatePost from '@graphql/queries/posts/UpdatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/languages/languages.spec.ts b/backend/src/middleware/languages/languages.spec.ts index 7c2c2b89a..3f0c04760 100644 --- a/backend/src/middleware/languages/languages.spec.ts +++ b/backend/src/middleware/languages/languages.spec.ts @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreatePost } from '@graphql/queries/CreatePost' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/notifications/notificationsMiddleware.emails.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.emails.spec.ts index f9ca50605..4b635d877 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.emails.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.emails.spec.ts @@ -2,13 +2,13 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { followUser } from '@graphql/queries/followUser' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { markAllAsRead } from '@graphql/queries/markAllAsRead' -import { notifications } from '@graphql/queries/notifications' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import followUser from '@graphql/queries/interactions/followUser.gql' +import markAllAsRead from '@graphql/queries/notifications/markAllAsRead.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -162,6 +162,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -174,6 +175,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -186,6 +188,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -241,6 +244,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -253,6 +257,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -265,6 +270,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -321,6 +327,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -333,6 +340,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -345,6 +353,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -396,6 +405,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -408,6 +418,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -420,6 +431,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -502,6 +514,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -514,6 +527,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -593,6 +607,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -605,6 +620,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -679,6 +695,7 @@ describe('emails sent for notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -691,6 +708,7 @@ describe('emails sent for notifications', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', diff --git a/backend/src/middleware/notifications/notificationsMiddleware.followed-users.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.followed-users.spec.ts index cc47ba678..47b55ee99 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.followed-users.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.followed-users.spec.ts @@ -2,10 +2,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { followUser } from '@graphql/queries/followUser' -import { notifications } from '@graphql/queries/notifications' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import followUser from '@graphql/queries/interactions/followUser.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/notifications/notificationsMiddleware.mentions-in-groups.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.mentions-in-groups.spec.ts index 55e2e0ac9..6bd48919e 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.mentions-in-groups.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.mentions-in-groups.spec.ts @@ -2,13 +2,13 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { markAllAsRead } from '@graphql/queries/markAllAsRead' -import { notifications } from '@graphql/queries/notifications' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import markAllAsRead from '@graphql/queries/notifications/markAllAsRead.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -306,6 +306,7 @@ describe('mentions in groups', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -318,6 +319,7 @@ describe('mentions in groups', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -423,6 +425,7 @@ describe('mentions in groups', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -435,6 +438,7 @@ describe('mentions in groups', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -528,6 +532,7 @@ describe('mentions in groups', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -540,6 +545,7 @@ describe('mentions in groups', () => { relatedUser: null, }, { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', diff --git a/backend/src/middleware/notifications/notificationsMiddleware.observing-posts.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.observing-posts.spec.ts index 094a04b69..b5a0cf13f 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.observing-posts.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.observing-posts.spec.ts @@ -2,10 +2,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreatePost } from '@graphql/queries/CreatePost' -import { notifications } from '@graphql/queries/notifications' -import { toggleObservePost } from '@graphql/queries/toggleObservePost' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import toggleObservePost from '@graphql/queries/posts/toggleObservePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/notifications/notificationsMiddleware.online-status.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.online-status.spec.ts index a0201f377..06a5c06bc 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.online-status.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.online-status.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-return */ import Factory, { cleanDatabase } from '@db/factories' -import { CreatePost } from '@graphql/queries/CreatePost' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/notifications/notificationsMiddleware.posts-in-groups.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.posts-in-groups.spec.ts index 1bf90d576..05371e7a6 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.posts-in-groups.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.posts-in-groups.spec.ts @@ -2,14 +2,14 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { markAllAsRead } from '@graphql/queries/markAllAsRead' -import { muteGroup } from '@graphql/queries/muteGroup' -import { notifications } from '@graphql/queries/notifications' -import { unmuteGroup } from '@graphql/queries/unmuteGroup' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import muteGroup from '@graphql/queries/groups/muteGroup.gql' +import unmuteGroup from '@graphql/queries/groups/unmuteGroup.gql' +import markAllAsRead from '@graphql/queries/notifications/markAllAsRead.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -124,7 +124,7 @@ describe('notify group members of new posts in group', () => { mutation: JoinGroup, variables: { groupId: 'g-1', - userId: 'group-member', + userId: 'email-less-member', }, }) authenticatedUser = await postAuthor.toJson() diff --git a/backend/src/middleware/notifications/notificationsMiddleware.spec.ts b/backend/src/middleware/notifications/notificationsMiddleware.spec.ts index 9b21ab8a0..76da25235 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.spec.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.spec.ts @@ -6,18 +6,18 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ import pubsubContext from '@context/pubsub' import Factory, { cleanDatabase } from '@db/factories' -import { ChangeGroupMemberRole } from '@graphql/queries/ChangeGroupMemberRole' -import { CreateComment } from '@graphql/queries/CreateComment' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreateMessage } from '@graphql/queries/CreateMessage' -import { CreatePost } from '@graphql/queries/CreatePost' -import { CreateRoom } from '@graphql/queries/CreateRoom' -import { JoinGroup } from '@graphql/queries/JoinGroup' -import { LeaveGroup } from '@graphql/queries/LeaveGroup' -import { markAsRead } from '@graphql/queries/markAsRead' -import { notifications } from '@graphql/queries/notifications' -import { RemoveUserFromGroup } from '@graphql/queries/RemoveUserFromGroup' -import { UpdatePost } from '@graphql/queries/UpdatePost' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import ChangeGroupMemberRole from '@graphql/queries/groups/ChangeGroupMemberRole.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import JoinGroup from '@graphql/queries/groups/JoinGroup.gql' +import LeaveGroup from '@graphql/queries/groups/LeaveGroup.gql' +import RemoveUserFromGroup from '@graphql/queries/groups/RemoveUserFromGroup.gql' +import CreateMessage from '@graphql/queries/messaging/CreateMessage.gql' +import CreateRoom from '@graphql/queries/messaging/CreateRoom.gql' +import markAsRead from '@graphql/queries/notifications/markAsRead.gql' +import notifications from '@graphql/queries/notifications/notifications.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' +import UpdatePost from '@graphql/queries/posts/UpdatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -176,6 +176,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'commented_on_post', @@ -218,6 +219,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'commented_on_post', @@ -345,6 +347,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'mentioned_in_post', @@ -387,6 +390,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'mentioned_in_post', @@ -459,6 +463,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'mentioned_in_post', @@ -588,6 +593,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Post', @@ -664,6 +670,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'mentioned_in_comment', @@ -700,6 +707,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, createdAt: expect.any(String), reason: 'commented_on_post', @@ -811,6 +819,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), createdAt: expect.any(String), from: { __typename: 'Comment', @@ -1108,6 +1117,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'user_joined_group', createdAt: expect.any(String), @@ -1150,6 +1160,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'user_joined_group', createdAt: expect.any(String), @@ -1211,6 +1222,7 @@ describe('notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), read: false, reason: 'user_left_group', createdAt: expect.any(String), @@ -1223,6 +1235,7 @@ describe('notifications', () => { }, }, { + id: expect.any(String), read: false, reason: 'user_joined_group', createdAt: expect.any(String), @@ -1271,6 +1284,7 @@ describe('notifications', () => { data: { notifications: expect.arrayContaining([ { + id: expect.any(String), read: false, reason: 'user_left_group', createdAt: expect.any(String), @@ -1283,6 +1297,7 @@ describe('notifications', () => { }, }, { + id: expect.any(String), read: false, reason: 'user_joined_group', createdAt: expect.any(String), @@ -1346,6 +1361,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'changed_group_member_role', createdAt: expect.any(String), @@ -1388,6 +1404,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'changed_group_member_role', createdAt: expect.any(String), @@ -1450,6 +1467,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'removed_user_from_group', createdAt: expect.any(String), @@ -1492,6 +1510,7 @@ describe('notifications', () => { data: { notifications: [ { + id: expect.any(String), read: false, reason: 'removed_user_from_group', createdAt: expect.any(String), diff --git a/backend/src/middleware/orderByMiddleware.spec.ts b/backend/src/middleware/orderByMiddleware.spec.ts index c5687c428..d4919bc24 100644 --- a/backend/src/middleware/orderByMiddleware.spec.ts +++ b/backend/src/middleware/orderByMiddleware.spec.ts @@ -1,5 +1,5 @@ import { cleanDatabase } from '@db/factories' -import { Post } from '@graphql/queries/Post' +import Post from '@graphql/queries/posts/Post.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/permissionsMiddleware.spec.ts b/backend/src/middleware/permissionsMiddleware.spec.ts index ecd07538d..792d32ed1 100644 --- a/backend/src/middleware/permissionsMiddleware.spec.ts +++ b/backend/src/middleware/permissionsMiddleware.spec.ts @@ -2,8 +2,9 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { Signup } from '@graphql/queries/Signup' -import { User, UserEmail } from '@graphql/queries/User' +import Signup from '@graphql/queries/auth/Signup.gql' +import User from '@graphql/queries/users/User.gql' +import UserEmail from '@graphql/queries/users/UserEmail.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/slugifyMiddleware.spec.ts b/backend/src/middleware/slugifyMiddleware.spec.ts index 1424d206a..809ec46f4 100644 --- a/backend/src/middleware/slugifyMiddleware.spec.ts +++ b/backend/src/middleware/slugifyMiddleware.spec.ts @@ -3,10 +3,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateGroup } from '@graphql/queries/CreateGroup' -import { CreatePost } from '@graphql/queries/CreatePost' -import { SignupVerification } from '@graphql/queries/SignupVerification' -import { UpdateGroup } from '@graphql/queries/UpdateGroup' +import SignupVerification from '@graphql/queries/auth/SignupVerification.gql' +import CreateGroup from '@graphql/queries/groups/CreateGroup.gql' +import UpdateGroup from '@graphql/queries/groups/UpdateGroup.gql' +import CreatePost from '@graphql/queries/posts/CreatePost.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.ts b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.ts index 79a06398b..c45cb4fb9 100644 --- a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.ts +++ b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.ts @@ -4,8 +4,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { Post } from '@graphql/queries/Post' -import { User } from '@graphql/queries/User' +import Post from '@graphql/queries/posts/Post.gql' +import User from '@graphql/queries/users/User.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' @@ -367,8 +367,8 @@ describe('softDeleteMiddleware', () => { it('conceals disabled comments', async () => { const expected = [ - { content: 'Enabled comment on public post' }, - { content: 'UNAVAILABLE' }, + { id: expect.any(String), content: 'Enabled comment on public post' }, + { id: expect.any(String), content: 'UNAVAILABLE' }, ] const { data } = await query({ query: Post, variables: { id: 'p3' } }) const { @@ -385,8 +385,8 @@ describe('softDeleteMiddleware', () => { it('shows disabled comments', async () => { const expected = [ - { content: 'Enabled comment on public post' }, - { content: 'Disabled comment' }, + { id: expect.any(String), content: 'Enabled comment on public post' }, + { id: expect.any(String), content: 'Disabled comment' }, ] const { data } = await query({ query: Post, variables: { id: 'p3' } }) const { diff --git a/backend/src/middleware/userInteractions.spec.ts b/backend/src/middleware/userInteractions.spec.ts index 70ecb49b0..0e7949053 100644 --- a/backend/src/middleware/userInteractions.spec.ts +++ b/backend/src/middleware/userInteractions.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { Post } from '@graphql/queries/Post' +import Post from '@graphql/queries/posts/Post.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/middleware/validation/validationMiddleware.spec.ts b/backend/src/middleware/validation/validationMiddleware.spec.ts index 3b469f930..9f0ba3579 100644 --- a/backend/src/middleware/validation/validationMiddleware.spec.ts +++ b/backend/src/middleware/validation/validationMiddleware.spec.ts @@ -2,11 +2,11 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import Factory, { cleanDatabase } from '@db/factories' -import { CreateComment } from '@graphql/queries/CreateComment' -import { fileReport } from '@graphql/queries/fileReport' -import { review } from '@graphql/queries/review' -import { UpdateComment } from '@graphql/queries/UpdateComment' -import { UpdateUser } from '@graphql/queries/UpdateUser' +import CreateComment from '@graphql/queries/comments/CreateComment.gql' +import UpdateComment from '@graphql/queries/comments/UpdateComment.gql' +import fileReport from '@graphql/queries/moderation/fileReport.gql' +import review from '@graphql/queries/moderation/review.gql' +import UpdateUser from '@graphql/queries/users/UpdateUser.gql' import { createApolloTestSetup } from '@root/test/helpers' import type { ApolloTestSetup } from '@root/test/helpers' diff --git a/backend/src/plugins/apolloLogger.spec.ts b/backend/src/plugins/apolloLogger.spec.ts index 42341c0f3..dd1f0c89f 100644 --- a/backend/src/plugins/apolloLogger.spec.ts +++ b/backend/src/plugins/apolloLogger.spec.ts @@ -2,8 +2,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import Factory, { cleanDatabase } from '@db/factories' +import login from '@graphql/queries/auth/login.gql' import { createApolloTestSetup } from '@root/test/helpers' -import { login } from '@src/graphql/queries/login' import ocelotLogger from '@src/logger' import { loggerPlugin } from '@src/plugins/apolloLogger' @@ -69,7 +69,7 @@ describe('apollo logger', () => { expect(loggerSpy).toHaveBeenCalledWith( 'Apollo Request', expect.any(String), - '"mutation ($email: String!, $password: String!) {\\n login(email: $email, password: $password)\\n}"', + '"mutation login($email: String!, $password: String!) {\\n login(email: $email, password: $password)\\n}"', JSON.stringify({ email: 'test@example.org', password: '***', diff --git a/backend/test/graphqlTransform.ts b/backend/test/graphqlTransform.ts new file mode 100644 index 000000000..6711691d0 --- /dev/null +++ b/backend/test/graphqlTransform.ts @@ -0,0 +1,15 @@ +import { parse } from 'graphql' + +export default { + process(sourceText: string, sourcePath: string) { + try { + return { + code: `module.exports = ${JSON.stringify(parse(sourceText))};`, + } + } catch (error: unknown) { + throw new Error( + `Failed to parse ${sourcePath}: ${error instanceof Error ? error.message : String(error)}`, + ) + } + }, +} diff --git a/backend/tsconfig.json b/backend/tsconfig.json index dcf6defeb..c659473b1 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -118,5 +118,5 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "exclude": ["eslint.config.ts", "prettier.config.mjs"] + "exclude": ["eslint.config.ts", "prettier.config.ts", "jest.config.ts"] } diff --git a/backend/yarn.lock b/backend/yarn.lock index 071b705be..cdb60d76f 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -1238,13 +1238,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@csstools/color-helpers@^5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@csstools/color-helpers/-/color-helpers-5.1.0.tgz#106c54c808cabfd1ab4c602d8505ee584c2996ef" @@ -1331,6 +1324,136 @@ resolved "https://registry.yarnpkg.com/@epic-web/invariant/-/invariant-1.0.0.tgz#1073e5dee6dd540410784990eb73e4acd25c9813" integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA== +"@esbuild/aix-ppc64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz#815b39267f9bffd3407ea6c376ac32946e24f8d2" + integrity sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg== + +"@esbuild/android-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz#19b882408829ad8e12b10aff2840711b2da361e8" + integrity sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg== + +"@esbuild/android-arm@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.3.tgz#90be58de27915efa27b767fcbdb37a4470627d7b" + integrity sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA== + +"@esbuild/android-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.3.tgz#d7dcc976f16e01a9aaa2f9b938fbec7389f895ac" + integrity sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ== + +"@esbuild/darwin-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz#9f6cac72b3a8532298a6a4493ed639a8988e8abd" + integrity sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg== + +"@esbuild/darwin-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz#ac61d645faa37fd650340f1866b0812e1fb14d6a" + integrity sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg== + +"@esbuild/freebsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz#b8625689d73cf1830fe58c39051acdc12474ea1b" + integrity sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w== + +"@esbuild/freebsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz#07be7dd3c9d42fe0eccd2ab9f9ded780bc53bead" + integrity sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA== + +"@esbuild/linux-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz#bf31918fe5c798586460d2b3d6c46ed2c01ca0b6" + integrity sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg== + +"@esbuild/linux-arm@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz#28493ee46abec1dc3f500223cd9f8d2df08f9d11" + integrity sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw== + +"@esbuild/linux-ia32@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz#750752a8b30b43647402561eea764d0a41d0ee29" + integrity sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg== + +"@esbuild/linux-loong64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz#a5a92813a04e71198c50f05adfaf18fc1e95b9ed" + integrity sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA== + +"@esbuild/linux-mips64el@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz#deb45d7fd2d2161eadf1fbc593637ed766d50bb1" + integrity sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw== + +"@esbuild/linux-ppc64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz#6f39ae0b8c4d3d2d61a65b26df79f6e12a1c3d78" + integrity sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA== + +"@esbuild/linux-riscv64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz#4c5c19c3916612ec8e3915187030b9df0b955c1d" + integrity sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ== + +"@esbuild/linux-s390x@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz#9ed17b3198fa08ad5ccaa9e74f6c0aff7ad0156d" + integrity sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw== + +"@esbuild/linux-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz#12383dcbf71b7cf6513e58b4b08d95a710bf52a5" + integrity sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA== + +"@esbuild/netbsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz#dd0cb2fa543205fcd931df44f4786bfcce6df7d7" + integrity sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA== + +"@esbuild/netbsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz#028ad1807a8e03e155153b2d025b506c3787354b" + integrity sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA== + +"@esbuild/openbsd-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz#e3c16ff3490c9b59b969fffca87f350ffc0e2af5" + integrity sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw== + +"@esbuild/openbsd-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz#c5a4693fcb03d1cbecbf8b422422468dfc0d2a8b" + integrity sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ== + +"@esbuild/openharmony-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz#082082444f12db564a0775a41e1991c0e125055e" + integrity sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g== + +"@esbuild/sunos-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz#5ab036c53f929e8405c4e96e865a424160a1b537" + integrity sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA== + +"@esbuild/win32-arm64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz#38de700ef4b960a0045370c171794526e589862e" + integrity sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA== + +"@esbuild/win32-ia32@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz#451b93dc03ec5d4f38619e6cd64d9f9eff06f55c" + integrity sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q== + +"@esbuild/win32-x64@0.27.3": + version "0.27.3" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz#0eaf705c941a218a43dba8e09f1df1d6cd2f1f17" + integrity sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA== + "@eslint-community/eslint-plugin-eslint-comments@^4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.6.0.tgz#2b38e666f7f1680fbe22c76c62ddf0cad12a7866" @@ -2124,29 +2247,16 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" - integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== - "@jridgewell/resolve-uri@^3.1.0": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": +"@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": version "1.5.5" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" @@ -3084,26 +3194,6 @@ json5 "^2.2.3" lodash.sortby "^4.7.0" -"@tsconfig/node10@^1.0.7": - version "1.0.12" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.12.tgz#be57ceac1e4692b41be9de6be8c32a106636dba4" - integrity sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@tybys/wasm-util@^0.10.0": version "0.10.1" resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.1.tgz#ecddd3205cf1e2d5274649ff0eedd2991ed7f414" @@ -3759,19 +3849,12 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.1.1: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== - dependencies: - acorn "^8.11.0" - acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.11.0, acorn@^8.15.0, acorn@^8.4.1, acorn@^8.5.0: +acorn@^8.15.0, acorn@^8.5.0: version "8.15.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== @@ -3893,11 +3976,6 @@ arg@1.0.0: resolved "https://registry.yarnpkg.com/arg/-/arg-1.0.0.tgz#444d885a4e25b121640b55155ef7cd03975d6050" integrity sha512-Wk7TEzl1KqvTGs/uyhmHO/3XLd3t1UeU4IstvPXVzGPM522cTjqjNZ99esCkcL52sjqjo8e8CTBcWhkxvGzoAw== -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -4745,11 +4823,6 @@ cosmiconfig@^8.1.0: parse-json "^5.2.0" path-type "^4.0.0" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-env@~10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-10.1.0.tgz#cfd2a6200df9ed75bfb9cb3d7ce609c13ea21783" @@ -5041,11 +5114,6 @@ diff-sequences@^29.0.0, diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -diff@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.4.tgz#7a6dbfda325f25f07517e9b518f897c08332e07d" - integrity sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -5408,6 +5476,38 @@ es-to-primitive@^1.3.0: is-date-object "^1.0.5" is-symbol "^1.0.4" +esbuild@~0.27.0: + version "0.27.3" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.3.tgz#5859ca8e70a3af956b26895ce4954d7e73bd27a8" + integrity sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.27.3" + "@esbuild/android-arm" "0.27.3" + "@esbuild/android-arm64" "0.27.3" + "@esbuild/android-x64" "0.27.3" + "@esbuild/darwin-arm64" "0.27.3" + "@esbuild/darwin-x64" "0.27.3" + "@esbuild/freebsd-arm64" "0.27.3" + "@esbuild/freebsd-x64" "0.27.3" + "@esbuild/linux-arm" "0.27.3" + "@esbuild/linux-arm64" "0.27.3" + "@esbuild/linux-ia32" "0.27.3" + "@esbuild/linux-loong64" "0.27.3" + "@esbuild/linux-mips64el" "0.27.3" + "@esbuild/linux-ppc64" "0.27.3" + "@esbuild/linux-riscv64" "0.27.3" + "@esbuild/linux-s390x" "0.27.3" + "@esbuild/linux-x64" "0.27.3" + "@esbuild/netbsd-arm64" "0.27.3" + "@esbuild/netbsd-x64" "0.27.3" + "@esbuild/openbsd-arm64" "0.27.3" + "@esbuild/openbsd-x64" "0.27.3" + "@esbuild/openharmony-arm64" "0.27.3" + "@esbuild/sunos-x64" "0.27.3" + "@esbuild/win32-arm64" "0.27.3" + "@esbuild/win32-ia32" "0.27.3" + "@esbuild/win32-x64" "0.27.3" + escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" @@ -6140,7 +6240,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.3.3, fsevents@~2.3.2: +fsevents@^2.3.3, fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== @@ -6256,6 +6356,13 @@ get-tsconfig@^4.10.0, get-tsconfig@^4.10.1, get-tsconfig@^4.8.1: dependencies: resolve-pkg-maps "^1.0.0" +get-tsconfig@^4.7.5: + version "4.13.6" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.6.tgz#2fbfda558a98a691a798f123afd95915badce876" + integrity sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw== + dependencies: + resolve-pkg-maps "^1.0.0" + get-video-id@3: version "3.7.0" resolved "https://registry.yarnpkg.com/get-video-id/-/get-video-id-3.7.0.tgz#a8ad5636e9dc256351332d8e5f710bd5da8362b8" @@ -6435,13 +6542,6 @@ graphql-subscriptions@^2.0.0: dependencies: iterall "^1.3.0" -graphql-tag@^2.12.6: - version "2.12.6" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" - integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== - dependencies: - tslib "^2.1.0" - graphql-tools@^4.0.7: version "4.0.8" resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.8.tgz#e7fb9f0d43408fb0878ba66b522ce871bafe9d30" @@ -7741,7 +7841,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json5@^2.2.2, json5@^2.2.3, json5@^2.x: +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -8087,7 +8187,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@^1.1.1, make-error@^1.3.6: +make-error@^1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -8392,7 +8492,7 @@ minimatch@^9.0.1, minimatch@^9.0.4, minimatch@^9.0.5: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.5: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -9582,13 +9682,6 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -require-json5@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/require-json5/-/require-json5-1.3.0.tgz#b47d236194e458f144c615dd061bdca085628474" - integrity sha512-FkOrdR0kqHFwIqrlifaXNg6fdg2YcUL5lX9bYlaENKLlWp+g0GO/tRMAvoWIM2pYzAGp57oF/jgkVLwxGk7KyQ== - dependencies: - json5 "^2.x" - resolve-alpn@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" @@ -10172,11 +10265,6 @@ strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1, strip-ansi@^7.0.1: dependencies: ansi-regex "^5.0.1" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== - strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -10479,25 +10567,6 @@ ts-jest@^29.4.6: type-fest "^4.41.0" yargs-parser "^21.1.1" -ts-node@^10.9.2: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - tsc-alias@^1.8.16: version "1.8.16" resolved "https://registry.yarnpkg.com/tsc-alias/-/tsc-alias-1.8.16.tgz#dbc74e797071801c7284f1a478259de920f852d4" @@ -10511,21 +10580,12 @@ tsc-alias@^1.8.16: normalize-path "^3.0.0" plimit-lit "^1.2.6" -tsconfig-paths@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" - integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== - dependencies: - json5 "^2.2.2" - minimist "^1.2.6" - strip-bom "^3.0.0" - tslib@^1.10.0, tslib@^1.9.0, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.1.0, tslib@^2.2.0, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2, tslib@^2.6.3, tslib@^2.8.1: +tslib@^2.0.3, tslib@^2.2.0, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2, tslib@^2.6.3, tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -10540,6 +10600,16 @@ tslog@^4.10.2: resolved "https://registry.yarnpkg.com/tslog/-/tslog-4.10.2.tgz#45c870d7fe9558d59ce288eeb86ba49eaaf25e1e" integrity sha512-XuELoRpMR+sq8fuWwX7P0bcj+PRNiicOKDEb3fGNURhxWVyykCi9BNq7c4uVz7h7P0sj8qgBsr5SWS6yBClq3g== +tsx@^4.21.0: + version "4.21.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.21.0.tgz#32aa6cf17481e336f756195e6fe04dae3e6308b1" + integrity sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw== + dependencies: + esbuild "~0.27.0" + get-tsconfig "^4.7.5" + optionalDependencies: + fsevents "~2.3.3" + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -10803,11 +10873,6 @@ uuid@^9.0.0, uuid@^9.0.1, uuid@~9.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - v8-to-istanbul@^9.0.1: version "9.3.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" @@ -11177,11 +11242,6 @@ yargs@^17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"