Last active
April 6, 2017 22:06
-
-
Save tmeasday/e911f51fccf5fc105cfd1e2f20564ec4 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: { | |
forceFetch: true, | |
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
You might want to use
fetchPolicy: 'network-only'
instead