This commit is contained in:
23
models/graphql/resolvers.ts
Normal file
23
models/graphql/resolvers.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
export const resolvers = {
|
||||
Query: {
|
||||
_empty: (): null => null,
|
||||
},
|
||||
|
||||
Mutation: {
|
||||
addTorrent: async (_: any, { input }: any, context: any) => {
|
||||
const { broker } = context;
|
||||
if (!broker) throw new Error("Broker not available in context");
|
||||
|
||||
return broker.call("qbittorrent.addTorrent", {
|
||||
torrentToDownload: input.torrentToDownload,
|
||||
comicObjectId: input.comicObjectId,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
JSON: {
|
||||
__parseValue: (value: any) => value,
|
||||
__serialize: (value: any) => value,
|
||||
__parseLiteral: (ast: any) => ast.value,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user