day 11
This commit is contained in:
Executable
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* activity_log 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.activity_log.intersection(graphqlFields(info));
|
||||
|
||||
return await db.activity_log.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_activity_log -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* calendar 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.calendar.intersection(graphqlFields(info));
|
||||
|
||||
return await db.calendar.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_calendar -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -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');
|
||||
}
|
||||
};
|
||||
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');
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* image 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.image.intersection(graphqlFields(info));
|
||||
|
||||
return await db.image.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_image -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* Link Resolve Single
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
const { formatError } = require('../../utils/formatError');
|
||||
|
||||
module.exports = async (_, __, { db, user }) => {
|
||||
try {
|
||||
const link = await db.link.getByFields({
|
||||
status: 1,
|
||||
user_id: user.id,
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
data: link,
|
||||
};
|
||||
} catch (error) {
|
||||
return formatError(error);
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* note 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.note.intersection(graphqlFields(info));
|
||||
|
||||
return await db.note.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_note -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* profile 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.profile.intersection(graphqlFields(info));
|
||||
|
||||
return await db.profile.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_profile -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* refer_log 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.refer_log.intersection(graphqlFields(info));
|
||||
|
||||
return await db.refer_log.getByPK(id);
|
||||
} catch (error) {
|
||||
console.log('single_refer_log -> error', error);
|
||||
return new ApolloError('InternalServerError');
|
||||
}
|
||||
};
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
/*Powered By: Manaknightdigital Inc. https://manaknightdigital.com/ Year: 2021*/
|
||||
/**
|
||||
* User Resolve Single
|
||||
* @copyright 2021 Manaknightdigital Inc.
|
||||
* @link https://manaknightdigital.com
|
||||
* @license Proprietary Software licensing
|
||||
* @author Ryan Wong
|
||||
*
|
||||
*/
|
||||
|
||||
module.exports = async (_, __, { directives: { verifyUser } }) => {
|
||||
return {
|
||||
success: true,
|
||||
data: verifyUser?.user,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user