team-client-lib

1.0.34 • Public • Published

team-client-lib

module with gqhl queries

1. Installation

You�ll need to have Node >= 6 on your local development machine (but it�s not required on the server).

To add module to you project, run a single command:

 npm install team-client-lib

or if you are using yarn

 yarn add team-client-lib

Create file in your project with content: apiService.js

import mainService from 'team-client-lib';
 import {makeRequest, mutate} from '$CHANGE_PATH';
 

 export const {
     clientService,
     expenseService,
     expenseTypeService,
     leaveService,
     leaveTypeService,
     projectService,
     departmentActions,
     customerService,
     locationService,
     feedService,
     notificationService,
     pricingService,
     labelService,
     taskAssignmentService,
     taskReportTimeService,
     taskService,
     timerService,
     staffService,
     userService
 } = mainService(makeRequest, mutate);

 
 
 

You need to change path to makeRequest and mutate functions, This function must look like:


   const client = new ApolloClient({
       ...
   });
   
   
   export const makeRequest = client.query;
   export const mutate = client.mutate;
   

P.S. you can also add wrapper for you functions, for example:


    export const makeRequest = (queryObject) => {
        //Simple logger
        console.log(queryObject);
       
        return client.query(queryObject)
    }; 
    

###Usage So then you can use this services:


   import {clientService} from './apiService.js'
   
   const getClients = _ => {
       clientService.fetchClients().then(({data, error, errors})=>{
       
       });
   };
   
               
   

Readme

Keywords

none

Package Sidebar

Install

npm i team-client-lib

Weekly Downloads

1

Version

1.0.34

License

MIT

Unpacked Size

186 kB

Total Files

60

Last publish

Collaborators

  • roman.realizeideas.net