import {
  QUERY_ALL_TASKS_PAGINATED,
  QUERY_JOB_TASKS_PAGINATED,
  QUERY_MY_TASKS_PAGINATED
} from "../../graphql/tasks.queries.js";

const getQueryName = (query) => Object.keys(query)[0];

const refetchRouteMappings = [
  {query: getQueryName({QUERY_MY_TASKS_PAGINATED}), route: "/manage/tasks/mytasks"},
  {query: getQueryName({QUERY_ALL_TASKS_PAGINATED}), route: "/manage/tasks/alltasks"},
  {query: getQueryName({QUERY_JOB_TASKS_PAGINATED}), route: "/manage/jobs"}
];

export default refetchRouteMappings;
