Add SKIP and OFFSET to the Orbit query editor

What does this MR do and why?

Orbit GQL is switching from cursor pagination (PAGE n AFTER 'token') to Cypher's SKIP n LIMIT m, with OFFSET as a synonym for SKIP. The query editor doesn't know about the new clauses yet, so SKIP shows as plain text and isn't suggested. This MR teaches the editor both keywords.

  • The editor highlights and suggests SKIP and OFFSET.
  • The GQL syntax reference lists SKIP 25 between ORDER BY and LIMIT, in the order the grammar requires.
  • When more rows match, the results alert now says "Raise the LIMIT, or use SKIP to get the next page."
  • The Schema tab treats skip and offset as reserved words when it names query aliases, matching the GQL grammar.

The editor reads only pagination.has_more from responses, and that field doesn't change. So the GKG change doesn't depend on this MR.

Merge this MR after the GKG release that ships SKIP reaches GitLab.com. Until then, the syntax reference would advertise a clause that the server rejects.

References

Screenshots or screen recordings

Before, on Caproni against the GKG MR branch: SKIP runs, but the editor shows it unhighlighted and the alert mentions only LIMIT. After screenshots to follow.

How to set up and validate locally

  1. Run a GKG build that includes gitlab-org/orbit/knowledge-graph!2924 (merged).
  2. Open Your work > GitLab Orbit > Query editor.
  3. Type SK and check that SKIP is suggested.
  4. Run MATCH (u:User) WHERE u.id >= 1 RETURN u.username ORDER BY u.id SKIP 2 LIMIT 2. SKIP is highlighted and the results start at the third user.
  5. Open Query reference and check that SKIP 25 appears before LIMIT 25.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Aaron Algutifan

Merge request reports

Loading
Loading