// @flow import gql from 'graphql-tag'; import threadInfoFragment from '../thread/threadInfo'; import type { ThreadInfoType } from '../thread/threadInfo'; type Edge = { cursor: string, node: { ...$Exact, }, }; export type ThreadConnectionType = { pageInfo: { hasNextPage: boolean, hasPreviousPage: boolean, }, edges: Array, }; export type CommunityThreadConnectionType = { pinnedThread: { ...$Exact, }, watercooler: { ...$Exact, }, threadConnection: ThreadConnectionType, }; export default gql` fragment communityThreadConnection on Community { pinnedThread { ...threadInfo } watercooler { ...threadInfo } threadConnection(first: 10, after: $after, sort: $sort) @connection(key: "community-thread-connection", filter: ["sort"]) { pageInfo { hasNextPage hasPreviousPage } edges { cursor node { ...threadInfo } } } } ${threadInfoFragment} `;