Zero-Downtime GraphQL Evolution in GitLab: Fixing Multi-Node Upgrades with @gl_introduced
A deep dive into GraphQL schema evolution, rolling deployments, mixed-version infrastructure, and backward-compatible frontend queries. Distributed applications rarely upgrade every server instance simultaneously. In a multi-node deployment, different application versions can temporarily coexist while a rolling upgrade is in progress. This creates an important compatibility challenge: frontend…
GitLab's Credits user page on the GitLab platform experienced issues during multi-node upgrades due to mixed-version deployments. In this scenario, some nodes had upgraded to GitLab 19.6 while others remained on the previous version, GitLab 19.5. This created a compatibility challenge between the frontend and backend components.
The problem arose when new GraphQL arguments, such as `includeNonBillable`, were introduced in the 19.6 version. The updated frontend queries started using this argument, for example, `usedFlowTypes(includeNonBillable: true)`. However, the older 19.5 nodes could not recognize this new argument, resulting in validation errors.
The @gl_introduced directive was introduced to address this issue. It allows frontend GraphQL operations to declare when a field or selection was introduced, enabling the system to handle mixed-version deployments more effectively. By using this directive, new GraphQL fields and arguments become compatible with older versions of the system during rolling upgrades, ensuring a smoother deployment process.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.