-
-
Save rootedsoftware/4dbc48e05c47a268627baf5f6bca515d 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
import { graphql } from 'react-apollo'; | |
import gql from 'graphql-tag'; | |
import Inbox from './Inbox'; | |
import TaskList from '../components/TaskList'; | |
const withData = graphql( | |
gql` | |
query InboxQuery { | |
me { | |
pinnedTasks: tasks(state: TASK_PINNED) { | |
...TaskListTaskFragment | |
} | |
inboxTasks: tasks(state: TASK_INBOX) { | |
...TaskListTaskFragment | |
} | |
} | |
} | |
${TaskList.fragments.task} | |
`, | |
{ | |
options: { | |
fetchPolicy: 'network-only', | |
pollInterval: 10 * 1000, | |
}, | |
props({ data: { loading, error, me } }) { | |
if (loading) { | |
return { loading }; | |
} | |
if (error) { | |
return { error }; | |
} | |
const { pinnedTasks, inboxTasks } = me; | |
return { pinnedTasks, inboxTasks }; | |
}, | |
}, | |
); | |
export default withData(Inbox); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forceFetch is no longer supported as of Apollo Client 1.0