import React from 'react'; import Appointment from './Appointment'; import { useQuery, gql } from '@apollo/client'; export const APPOINTMENTS_QUERY = gql` { allAppointments{ _id title description start end } } `; const AppointmentList = () => { const { data, loading } = useQuery(APPOINTMENTS_QUERY); if (data !== undefined) { return (
{ data.allAppointments.map((appointment) => ( )) }
); } else { return (
Rendering...
) } }; export default AppointmentList;