Created
May 12, 2020 13:31
-
-
Save aleccool213/c2b42a114ec608f236aca18ff0e64d4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GITHUB_ISSUES_LIST_QUERY = gql` | |
query GithubIssuesListContainerQuery { | |
organization { | |
id | |
name | |
} | |
issues { | |
totalCount | |
pageInfo { | |
endCursor | |
hasNextPage | |
} | |
edges { | |
node { | |
id | |
title | |
description | |
} | |
} | |
} | |
`; | |
const GithubIssueListContainer = () => { | |
const { loading, error, data } = useQuery(GITHUB_ISSUES_LIST_QUERY); | |
return ( | |
{data.issues.edges.map( | |
edge => | |
( | |
<span key={edge.node.id}> | |
<GithubIssueInfoCard issueDetails={edge.node} /> | |
</span> | |
), | |
)} | |
); | |
} | |
interface GithubIssueInfoCardProps { | |
issueDetails: { | |
id: string; | |
title: string; | |
description: string; | |
} | |
} | |
const GithubIssueInfoCard = ({ issueDetails }) => { | |
return ( | |
<> | |
{issueDetails.id} {issueDetails.title} {issueDetails.description} | |
</> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment