more types

This commit is contained in:
Ulf Gebhardt 2026-02-23 10:34:04 +01:00
parent 455a5c93d2
commit e036678dbc
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 9 additions and 9 deletions

View File

@ -147,7 +147,7 @@ const multiSearchMap = [
export default {
Query: {
searchPosts: (_parent, args, context, _resolveInfo) => {
const { query, postsOffset, firstPosts } = args
const { query, postsOffset, firstPosts } = args as { query: string; postsOffset: number; firstPosts: number }
let userId = null
if (context.user) userId = context.user.id
return {
@ -170,7 +170,7 @@ export default {
}
},
searchUsers: (_parent, args, context, _resolveInfo) => {
const { query, usersOffset, firstUsers } = args
const { query, usersOffset, firstUsers } = args as { query: string; usersOffset: number; firstUsers: number }
return {
userCount: getSearchResults(
context,
@ -189,7 +189,7 @@ export default {
}
},
searchHashtags: (_parent, args, context, _resolveInfo) => {
const { query, hashtagsOffset, firstHashtags } = args
const { query, hashtagsOffset, firstHashtags } = args as { query: string; hashtagsOffset: number; firstHashtags: number }
return {
hashtagCount: getSearchResults(
context,
@ -208,7 +208,7 @@ export default {
}
},
searchGroups: (_parent, args, context, _resolveInfo) => {
const { query, groupsOffset, firstGroups } = args
const { query, groupsOffset, firstGroups } = args as { query: string; groupsOffset: number; firstGroups: number }
let userId = null
if (context.user) userId = context.user.id
return {
@ -231,7 +231,7 @@ export default {
}
},
searchResults: async (_parent, args, context, _resolveInfo) => {
const { query, limit } = args
const { query, limit } = args as { query: string; limit: number }
const userId = context.user?.id || null
const searchType = query.replace(/^([!@#&]?).*$/, '$1')

View File

@ -63,9 +63,9 @@ const createLocation = async (session, mapboxData) => {
}
export const createOrUpdateLocations = async (
nodeLabel,
nodeId,
locationName,
nodeLabel: string,
nodeId: string,
locationName: string | null | undefined,
session,
context: Context,
) => {
@ -157,7 +157,7 @@ export const createOrUpdateLocations = async (
})
}
export const queryLocations = async ({ place, lang }, context: Context) => {
export const queryLocations = async ({ place, lang }: { place: string; lang: string }, context: Context) => {
const res: any = await fetch(
`https://api.mapbox.com/geocoding/v5/mapbox.places/${place}.json?access_token=${context.config.MAPBOX_TOKEN}&types=region,place,country&language=${lang}`,
{