title: How to jump to a specific date in a cursor based relay pagination?
body: <p>I’ve got a cursor base paginated relay connection which is ordered by a startDatetime timestamp. The query looks like this;</p>
  <pre><code>query UnassignedShiftsQuery($first: Int, $cursor: String) {
  user {
      id
      unassignedShifts(first: $first, after: $cursor) {
        edges {
          __typename
          cursor
          node {
            ...OpenShiftFragment
          }
        }
        pageInfo {
          ...PageInfoFragment
        }
        __typename
      }
    }
  }
  
  ${OPEN_SHIFT_FRAGMENT}
  ${PAGE_INFO_FRAGMENT}
  </code></pre>
  <p>And the relevant schema in Absinthe:</p>
  <pre><code>connection(node_type: :open_shift, non_null_edges: true, non_null_edge: true) do
    edge do
      field :node, non_null(:open_shift)
    end
  end
  
  object :user do
    field :id, non_null(:string)
    connection field :unassigned_shifts, node_type: :open_shift, non_null_connection: true do           resolve(&amp;Resolvers.Shifts.list_shifts/3)
    end
  end
  
  object :open_shift do
    field :id, non_null(:string)
    field :start_datetime, non_null(:datetime)
  end
  </code></pre>
  <p>And the Shifts resolver;</p>
  <pre><code>def list_shifts(_parent, args, %{context: %{current_user: user}}) do
    Absinthe.Relay.Connection.from_query(
      Shifts.unassigned_shifts(user),
      &amp;get_preloaded_shifts/1,
      args
    )
  end
  
  defp get_preloaded_shifts(query) do
    query
    |&gt; Repo.all()
    |&gt; Repo.preload([:shift_type])
  end
  </code></pre>
  <p>Where, for the sake of brevity Shifts.unassigned_shifts could be assumed to be;</p>
  <pre><code>def unassigned_shifts(user) do
    from shifts in Backend.Shifts.Shift,
      order_by: shifts.start_datetime,
      where: shifts.user_id == ^user.id
  end
  </code></pre>
  <p>After the the initial query is rendered, the user can select an arbitrary date that they would like to jump to whist remaining in the paginated list. This thing is huge, so they may want to jump to a date and then scroll back and forth from there.</p>
  <p>In subsequent queries I can pass that date in the fetchMore query, but how to I apply that in the Absinthe.Relay.Connection.from_query call in the resolver. Simplistically I’m thinking I need to take the date, turn that into a cursor and pass that cursor into the args that from_query takes, but I’m not sure if I’m on the right track or how to go about it.</p>
  <p>I’m reasonably new to Elixir so haven’t been able to work this out from reading the Absinthe source so any pointers would be really helpful.</p>
  <p>Thanks!</p>