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