feat(GraphQL): Initial revision of APIv2 GraphQL
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
const { DateResolver, DateTimeResolver } = require('graphql-scalars');
|
||||
const { Account, User, Company } = require('../../Domain');
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// Queries
|
||||
//////////////////////////////////////////////
|
||||
async function account( args, context ) {
|
||||
const account = new Account( context.graphQLContext.userId );
|
||||
return account;
|
||||
}
|
||||
|
||||
async function profile( args, context ) {
|
||||
const profile = new User( context.graphQLContext.userId );
|
||||
return profile;
|
||||
}
|
||||
|
||||
async function company( args, context ) {
|
||||
const company = new Company( context.graphQLContext.companyId );
|
||||
return company;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// Mutations
|
||||
//////////////////////////////////////////////
|
||||
|
||||
module.exports = {
|
||||
account,
|
||||
profile,
|
||||
company
|
||||
};
|
||||
Reference in New Issue
Block a user