day 11
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* credential 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.credential.intersection(graphqlFields(info));
|
||||
|
||||
return await db.credential.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_credential -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user