mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
* lint @typescript-eslint/recommended * lint @typescript-eslint/recommended-requiring-type-checking fix type not detected locally due to wierd uuid typings missing save error not reported locally --------- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
33 lines
795 B
TypeScript
33 lines
795 B
TypeScript
/* eslint-disable @typescript-eslint/require-await */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
import scrape from './embeds/scraper'
|
|
import { undefinedToNullResolver } from './helpers/Resolver'
|
|
|
|
export default {
|
|
Query: {
|
|
embed: async (_object, { url }, _context, _resolveInfo) => {
|
|
return scrape(url)
|
|
},
|
|
},
|
|
Embed: {
|
|
...undefinedToNullResolver([
|
|
'type',
|
|
'title',
|
|
'author',
|
|
'publisher',
|
|
'date',
|
|
'description',
|
|
'url',
|
|
'image',
|
|
'audio',
|
|
'video',
|
|
'lang',
|
|
'html',
|
|
]),
|
|
sources: async (parent, _params, _context, _resolveInfo) => {
|
|
return typeof parent.sources === 'undefined' ? [] : parent.sources
|
|
},
|
|
},
|
|
}
|