// @flow import gql from 'graphql-tag' import {getApi} from './__settings.js'; import {calendarios} from './types/calendarios' export const calendariosApi = { // Queries getAll : function (){ return { select : async (selection:string):Promise> =>{ const {data : {calendariosGetAll}} = await getApi().query({ query : gql` query calendariosGetAll{ calendariosGetAll{ ${selection} } } ` , variables : {}, }); return calendariosGetAll } } }, getById : function (id:string){ return { select : async (selection:string):Promise =>{ const {data : {calendariosGetById}} = await getApi().query({ query : gql` query calendariosGetById($id: ID!){ calendariosGetById(id: $id){ ${selection} } } ` , variables : {id}, }); return calendariosGetById } } }, // Mutations }