mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
31 lines
623 B
JavaScript
31 lines
623 B
JavaScript
import { UserInputError } from 'apollo-server'
|
|
import Resolver from './helpers/Resolver'
|
|
import { queryLocations } from './users/location'
|
|
|
|
export default {
|
|
Location: {
|
|
...Resolver('Location', {
|
|
undefinedToNull: [
|
|
'nameEN',
|
|
'nameDE',
|
|
'nameFR',
|
|
'nameNL',
|
|
'nameIT',
|
|
'nameES',
|
|
'namePT',
|
|
'namePL',
|
|
'nameRU',
|
|
],
|
|
}),
|
|
},
|
|
Query: {
|
|
queryLocations: async (object, args, context, resolveInfo) => {
|
|
try {
|
|
return queryLocations(args)
|
|
} catch (e) {
|
|
throw new UserInputError(e.message)
|
|
}
|
|
},
|
|
},
|
|
}
|