Create Appointment works
This commit is contained in:
36
client/src/components/Events.js
Normal file
36
client/src/components/Events.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import React from 'react';
|
||||
import { useQuery, gql } from '@apollo/client';
|
||||
|
||||
export const APPOINTMENTS_QUERY = gql`
|
||||
{
|
||||
allAppointments{
|
||||
title
|
||||
description
|
||||
start
|
||||
end
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
var EventsList = [];
|
||||
|
||||
const Events = () => {
|
||||
|
||||
const { data } = useQuery(APPOINTMENTS_QUERY);
|
||||
|
||||
|
||||
// if (data !== undefined) {
|
||||
console.log("Data:", data.allAppointments);
|
||||
EventsList = data.allAppointments;
|
||||
return (
|
||||
EventsList
|
||||
);
|
||||
// } else {
|
||||
// return (
|
||||
// EventsList
|
||||
// )
|
||||
// }
|
||||
|
||||
};
|
||||
|
||||
export default EventsList;
|
||||
Reference in New Issue
Block a user