Send only GQL to Orbit and remove the orbit_gql_queries flag

What does this MR do and why?

Orbit is removing its JSON query language and keeping GQL as the only one. This MR makes Rails and the Orbit dashboard default to GQL, so every user gets what the orbit_gql_queries flag turned on. The flag is removed. The query language stays a parameter, so adding a language later takes one new entry instead of new plumbing.

  • POST /api/v4/orbit/query and the MCP query_graph command accept only GQL text. A JSON object query gets 400 Bad Request or a tool error.
  • GET /api/v4/orbit/schema/dsl is removed.
  • The gRPC client maps language names through GrpcClient::QUERY_LANGUAGES and defaults every request to GQL, including the query runner.
  • The dashboard query editor loses its JSON mode and JSON examples. The Schema tab always shows an entity's starter query.
  • The Orbit tools on the main MCP server stop decoding JSON query objects, and their command cache stays keyed by query language.
  • Running a query right after picking an example now runs that example. Before, Monaco reported the edit a tick late, so the previous example ran.
  • The GQL syntax reference no longer lists NOT as unsupported.
  • The Orbit API docs use GQL examples.

This MR builds on !263077 (merged) (merged), which moved Orbit queries from Workhorse to the Rails query runner. Merge this MR before the GKG MR. Once GKG drops JSON, a GitLab that still sends JSON can't query Orbit. The GQL security review is done: https://gitlab.com/gitlab-com/gl-security/product-security/appsec/threat-models/-/merge_requests/109.

References

Screenshots or screen recordings

Users who had the flag on see the same editor. Users who had it off now get the GQL editor instead of the JSON editor. Taken on Caproni against the GKG MR branch.

Empty editor with the ghost query and examples Example run right after picking it
Empty GQL editor Example query results
JSON text gets a GQL syntax error GQL syntax reference
JSON query rejected GQL syntax reference
Schema tab starter query for User
Schema starter query

How to set up and validate locally

  1. Run GKG and point GDK at it.

  2. As a user with Orbit access, run a GQL query. It returns the matched user:

    curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
      --header "Content-Type: application/json" \
      --data '{"query": "MATCH (u:User {id: 1}) RETURN u"}' \
      --url "http://127.0.0.1:3000/api/v4/orbit/query"
  3. Send {"query": {"nodes": ["User"]}} instead. It returns 400 with query is invalid.

  4. Visit http://127.0.0.1:3000/dashboard/orbit/query. Pick an example and select Run query right away. It runs the example you picked.

  5. Open a Schema tab entity, then select Open in Query editor and run the starter query.

I ran this end to end on Caproni, with this branch in edit mode and the GKG MR branch as the webserver:

  • All five named queries ran over REST and MCP.
  • REST GQL queries returned traversal, aggregation, and LLM output. JSON object queries got 400, and schema/dsl returned 404.
  • /api/v4/orbit/mcp and the main /api/v4/mcp server ran query_graph with GQL. JSON queries got a tool error, and get_query_dsl was not found.
  • The editor, examples, Schema handoff, autocomplete, and query reference worked.
  • No request reached GKG as JSON. The Rails Orbit log had no "JSON Query DSL was removed" errors.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Aaron Algutifan

Merge request reports

Loading
Loading