// @flow import gql from 'graphql-tag' import {getApi} from './__settings.js'; import {tiposIncidencias} from './types/tiposincidencias' export const tiposApi = { // Queries incidenciasGetAll : function (tipo:number){ return { select : async (selection:string):Promise> =>{ const {data : {tiposIncidenciasGetAll}} = await getApi().query({ query : gql` query tiposIncidenciasGetAll($tipo: Int!){ tiposIncidenciasGetAll(tipo: $tipo){ ${selection} } } ` , variables : {tipo}, }); return tiposIncidenciasGetAll } } }, incidenciasGetById : function (id:string){ return { select : async (selection:string):Promise =>{ const {data : {tiposIncidenciasGetById}} = await getApi().query({ query : gql` query tiposIncidenciasGetById($id: ID!){ tiposIncidenciasGetById(id: $id){ ${selection} } } ` , variables : {id}, }); return tiposIncidenciasGetById } } }, // Mutations }