Initial commit

This commit is contained in:
Riccardo
2021-01-01 10:14:50 +01:00
parent 67a1e45386
commit bccea7574a
40 changed files with 15172 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
import React from 'react';
import Link from './Link';
import { useQuery, gql } from '@apollo/client';
const FEED_QUERY = gql`
{
feed {
id
links {
id
createdAt
url
description
}
}
}
`;
const LinkList = () => {
const { data } = useQuery(FEED_QUERY);
return (
<div>
{data && (
<>
{data.feed.links.map((link) => (
<Link key={link.id} link={link} />
))}
</>
)}
</div>
);
};
// const LinkList = () => {
// const linksToRender = [
// {
// id: '1',
// description:
// 'Link first😎',
// url: 'https://prisma.io'
// },
// {
// id: '2',
// description: 'Link zwei',
// url: 'https://www.apollographql.com/docs/react/'
// }
// ];
// return (
// <div>
// {linksToRender.map((link) => (
// <Link key={link.id} link={link} />
// ))}
// </div>
// );
// };
export default LinkList;