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