// @flow import gql from 'graphql-tag' import {getApi} from './__settings.js'; import {AlumnosAsistencias} from './types/alumnosasistencias' export const asistenciasApi = { // Queries getByGrupoId : function (grupoId:string,cicloEscolarId:string?,periodo:number?,tipos:Array?){ return { select : async (selection:string):Promise> =>{ const {data : {asistenciasGetByGrupoId}} = await getApi().query({ query : gql` query asistenciasGetByGrupoId($grupoId: ID!,$cicloEscolarId: ID,$periodo: Int,$tipos: [Int]){ asistenciasGetByGrupoId(grupoId: $grupoId,cicloEscolarId: $cicloEscolarId,periodo: $periodo,tipos: $tipos){ ${selection} } } ` , variables : {grupoId,cicloEscolarId,periodo,tipos}, }); return asistenciasGetByGrupoId } } }, getByMaestroGrupoId : function (maestroGrupoId:string,cicloEscolarId:string?,periodo:number?,tipos:Array?){ return { select : async (selection:string):Promise> =>{ const {data : {asistenciasGetByMaestroGrupoId}} = await getApi().query({ query : gql` query asistenciasGetByMaestroGrupoId($maestroGrupoId: ID!,$cicloEscolarId: ID,$periodo: Int,$tipos: [Int]){ asistenciasGetByMaestroGrupoId(maestroGrupoId: $maestroGrupoId,cicloEscolarId: $cicloEscolarId,periodo: $periodo,tipos: $tipos){ ${selection} } } ` , variables : {maestroGrupoId,cicloEscolarId,periodo,tipos}, }); return asistenciasGetByMaestroGrupoId } } }, // Mutations }