This commit is contained in:
Ulf Gebhardt 2026-02-23 10:29:57 +01:00
parent a3db2ae89e
commit 9a2ff64232
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
7 changed files with 22 additions and 14 deletions

View File

@ -28,8 +28,7 @@ export const defaultVerificationBadge = {
export default {
Query: {
Badge: (object, args, context, resolveInfo) =>
neo4jgraphql(object, args, context, resolveInfo),
Badge: (object, args, context, resolveInfo) => neo4jgraphql(object, args, context, resolveInfo),
},
Mutation: {

View File

@ -5,7 +5,7 @@ import { undefinedToNullResolver } from './helpers/Resolver'
export default {
Query: {
embed: (_object, { url }, _context, _resolveInfo) => {
embed: async (_object, { url }, _context, _resolveInfo) => {
return scrape(url)
},
},

View File

@ -43,8 +43,10 @@ export default {
default:
orderByClause = ''
}
const offset = args.offset && typeof args.offset === 'number' ? `SKIP ${String(args.offset)}` : ''
const limit = args.first && typeof args.first === 'number' ? `LIMIT ${String(args.first)}` : ''
const offset =
args.offset && typeof args.offset === 'number' ? `SKIP ${String(args.offset)}` : ''
const limit =
args.first && typeof args.first === 'number' ? `LIMIT ${String(args.first)}` : ''
const readTxResultPromise = session.readTransaction(async (transaction) => {
const notificationsTransactionResponse = await transaction.run(

View File

@ -80,7 +80,8 @@ export default {
const offset =
params.offset && typeof params.offset === 'number' ? `SKIP ${String(params.offset)}` : ''
const limit = params.first && typeof params.first === 'number' ? `LIMIT ${String(params.first)}` : ''
const limit =
params.first && typeof params.first === 'number' ? `LIMIT ${String(params.first)}` : ''
const reportsReadTxPromise = session.readTransaction(async (transaction) => {
const reportsTransactionResponse = await transaction.run(

View File

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
@ -77,9 +77,9 @@ export const createOrUpdateLocations = async (
const response: any = await fetch(
`https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(
String(locationName),
)}.json?access_token=${
String(context.config.MAPBOX_TOKEN)
}&types=region,place,country,address&language=${locales.join(',')}`,
)}.json?access_token=${String(
context.config.MAPBOX_TOKEN,
)}&types=region,place,country,address&language=${locales.join(',')}`,
{
signal: AbortSignal.timeout(REQUEST_TIMEOUT),
},

View File

@ -375,7 +375,7 @@ const publicRegistration = rule()(
(_parent, _args, context: Context) => context.config.PUBLIC_REGISTRATION,
)
const inviteRegistration = rule()((_parent, args, context: Context) => {
const inviteRegistration = rule()(async (_parent, args, context: Context) => {
if (!context.config.INVITE_REGISTRATION) return false
const { inviteCode } = args
return validateInviteCode(context, inviteCode)

View File

@ -14,7 +14,9 @@ const validateCreateComment: IMiddlewareResolver = async (resolve, root, args, c
const { postId } = args
if (!args.content || content.length < COMMENT_MIN_LENGTH) {
throw new UserInputError(`Comment must be at least ${String(COMMENT_MIN_LENGTH)} character long!`)
throw new UserInputError(
`Comment must be at least ${String(COMMENT_MIN_LENGTH)} character long!`,
)
}
const session = context.driver.session()
try {
@ -44,7 +46,9 @@ const validateCreateComment: IMiddlewareResolver = async (resolve, root, args, c
const validateUpdateComment: IMiddlewareResolver = (resolve, root, args, context, info) => {
const content = args.content.replace(/<(?:.|\n)*?>/gm, '').trim()
if (!args.content || content.length < COMMENT_MIN_LENGTH) {
throw new UserInputError(`Comment must be at least ${String(COMMENT_MIN_LENGTH)} character long!`)
throw new UserInputError(
`Comment must be at least ${String(COMMENT_MIN_LENGTH)} character long!`,
)
}
return resolve(root, args, context, info)
@ -125,7 +129,9 @@ export const validateNotifyUsers = (label: string, reason: string): void => {
const validateUpdateUser: IMiddlewareResolver = (resolve, root, params, context, info) => {
const { name } = params
if (typeof name === 'string' && name.trim().length < USERNAME_MIN_LENGTH)
throw new UserInputError(`Username must be at least ${String(USERNAME_MIN_LENGTH)} character long!`)
throw new UserInputError(
`Username must be at least ${String(USERNAME_MIN_LENGTH)} character long!`,
)
return resolve(root, params, context, info)
}