Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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