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