Skip to content

Instantly share code, notes, and snippets.

@tmeasday
Last active April 6, 2017 22:06
Show Gist options
  • Save tmeasday/e911f51fccf5fc105cfd1e2f20564ec4 to your computer and use it in GitHub Desktop.
Save tmeasday/e911f51fccf5fc105cfd1e2f20564ec4 to your computer and use it in GitHub Desktop.
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);
@rootedsoftware
Copy link

forceFetch is no longer supported as of Apollo Client 1.0

You might want to use fetchPolicy: 'network-only' instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment