This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
calendar-demo/client/src/components/Events.js
2021-01-06 11:09:19 +01:00

36 lines
579 B
JavaScript

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;