feat(GraphQL): Initial revision of APIv2 GraphQL

This commit is contained in:
Josepablo C
2024-08-06 03:59:11 -06:00
parent 15abfe6c45
commit ae920ca2c7
13 changed files with 439 additions and 3 deletions

View File

@@ -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
};