Skip to content

Instantly share code, notes, and snippets.

@ryanclark
Created May 13, 2020 06:24
Show Gist options
  • Save ryanclark/c12c27200632f533c167745300c8d977 to your computer and use it in GitHub Desktop.
Save ryanclark/c12c27200632f533c167745300c8d977 to your computer and use it in GitHub Desktop.
export function BuildList(props: BuildListProps) {
const { data, hasPrevious, hasNext } = usePaginationFragment<
BuildListQuery,
BuildList_builds$key
>(
graphql`
fragment BuildList_builds on Query
@refetchable(queryName: "BuildListQuery") {
builds(
first: $first
after: $after
last: $last
before: $before
filter: $filter
pipelineId: $pipelineId
includeArchived: false
) @connection(key: "Query_builds", filters: []) {
totalCount
edges {
__id
cursor
node {
...BuildItem_build
}
}
pageInfo {
endCursor
hasPreviousPage
hasNextPage
startCursor
}
}
}
`,
props.rootQuery
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment