Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleccool213/c2b42a114ec608f236aca18ff0e64d4c to your computer and use it in GitHub Desktop.
Save aleccool213/c2b42a114ec608f236aca18ff0e64d4c to your computer and use it in GitHub Desktop.
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