This commit is contained in:
ryanwong
2022-02-06 22:15:10 -05:00
parent 46625dd6cd
commit a07577bffa
145 changed files with 12008 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"use strict";
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
/**
* code Resolve Single
* @copyright 2021 Manaknightdigital Inc.
* @link https://manaknightdigital.com
* @license Proprietary Software licensing
* @author Ryan Wong
*
*/
const { ApolloError } = require('apollo-server-express');
const graphqlFields = require('graphql-fields');
module.exports = async (_, {id}, {db}, info) => {
try {
const attributes = db.code.intersection(graphqlFields(info));
return await db.code.getByPK(id);
} catch (error) {
console.log('single_code -> error', error);
return new ApolloError('InternalServerError');
}
};