refactor(backend): move resolvers into graphql folder (#8470)

* move resolvers into graphql folder

* lint fixes
This commit is contained in:
Ulf Gebhardt 2025-05-02 09:47:39 +02:00 committed by GitHub
parent 5e24f51cf7
commit 839ffb29ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
84 changed files with 7 additions and 8 deletions

View File

@ -10,7 +10,7 @@ import { Factory } from 'rosie'
import slugify from 'slug' import slugify from 'slug'
import { v4 as uuid } from 'uuid' import { v4 as uuid } from 'uuid'
import generateInviteCode from '@schema/resolvers/helpers/generateInviteCode' import generateInviteCode from '@graphql/resolvers/helpers/generateInviteCode'
import { getDriver, getNeode } from './neo4j' import { getDriver, getNeode } from './neo4j'

View File

@ -10,7 +10,7 @@ import { throwError, concat } from 'rxjs'
import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators' import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators'
import { getDriver } from '@db/neo4j' import { getDriver } from '@db/neo4j'
import normalizeEmail from '@schema/resolvers/helpers/normalizeEmail' import normalizeEmail from '@graphql/resolvers/helpers/normalizeEmail'
export const description = ` export const description = `
This migration merges duplicate :User and :EmailAddress nodes. It became This migration merges duplicate :User and :EmailAddress nodes. It became

View File

@ -4,7 +4,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { mergeWith, isArray } from 'lodash' import { mergeWith, isArray } from 'lodash'
import { getMutedUsers } from '@schema/resolvers/users' import { getMutedUsers } from '@graphql/resolvers/users'
export const filterForMutedUsers = async (params, context) => { export const filterForMutedUsers = async (params, context) => {
if (!context.user) return params if (!context.user) return params

View File

@ -1,9 +1,11 @@
/* eslint-disable import/no-cycle */
/* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable security/detect-object-injection */ /* eslint-disable security/detect-object-injection */
import { getUnreadRoomsCount } from '@graphql/resolvers/rooms'
import { sendMail } from '@middleware/helpers/email/sendMail' import { sendMail } from '@middleware/helpers/email/sendMail'
import { import {
chatMessageTemplate, chatMessageTemplate,
@ -11,8 +13,6 @@ import {
} from '@middleware/helpers/email/templateBuilder' } from '@middleware/helpers/email/templateBuilder'
import { isUserOnline } from '@middleware/helpers/isUserOnline' import { isUserOnline } from '@middleware/helpers/isUserOnline'
import { validateNotifyUsers } from '@middleware/validation/validationMiddleware' import { validateNotifyUsers } from '@middleware/validation/validationMiddleware'
// eslint-disable-next-line import/no-cycle
import { getUnreadRoomsCount } from '@schema/resolvers/rooms'
import { pubsub, NOTIFICATION_ADDED, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '@src/server' import { pubsub, NOTIFICATION_ADDED, ROOM_COUNT_UPDATED, CHAT_MESSAGE_ADDED } from '@src/server'
import extractMentionedUsers from './mentions/extractMentionedUsers' import extractMentionedUsers from './mentions/extractMentionedUsers'

View File

@ -8,8 +8,8 @@ import { rule, shield, deny, allow, or, and } from 'graphql-shield'
import CONFIG from '@config/index' import CONFIG from '@config/index'
import { getNeode } from '@db/neo4j' import { getNeode } from '@db/neo4j'
import { validateInviteCode } from '@graphql/resolvers/transactions/inviteCodes'
import SocialMedia from '@models/SocialMedia' import SocialMedia from '@models/SocialMedia'
import { validateInviteCode } from '@schema/resolvers/transactions/inviteCodes'
const debug = !!CONFIG.DEBUG const debug = !!CONFIG.DEBUG
const allowExternalErrors = true const allowExternalErrors = true

View File

@ -18,10 +18,10 @@ import Redis from 'ioredis'
import CONFIG from './config' import CONFIG from './config'
import { getNeode, getDriver } from './db/neo4j' import { getNeode, getDriver } from './db/neo4j'
import schema from './graphql/schema'
import decode from './jwt/decode' import decode from './jwt/decode'
// eslint-disable-next-line import/no-cycle // eslint-disable-next-line import/no-cycle
import middleware from './middleware' import middleware from './middleware'
import schema from './schema'
export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED' export const NOTIFICATION_ADDED = 'NOTIFICATION_ADDED'
export const CHAT_MESSAGE_ADDED = 'CHAT_MESSAGE_ADDED' export const CHAT_MESSAGE_ADDED = 'CHAT_MESSAGE_ADDED'

View File

@ -38,7 +38,6 @@
"@jwt/*": ["./src/jwt/*"], "@jwt/*": ["./src/jwt/*"],
"@middleware/*": ["./src/middleware/*"], "@middleware/*": ["./src/middleware/*"],
"@models/*": ["./src/models/*"], "@models/*": ["./src/models/*"],
"@schema/*": ["./src/schema/*"],
"@src/*": ["./src/*"], "@src/*": ["./src/*"],
"@root/*": ["./*"] "@root/*": ["./*"]
}, },