Strapi 5 GraphQL API changes

A plan for the GraphQL client changes that come with moving a Strapi project from v4 to Strapi 5, and how to migrate client queries without a big-bang cutover.

On this page

What changes for GraphQL clients when you upgrade Strapi to version 5

If your v4 project serves GraphQL to front ends or integrations, the upgrade to Strapi 5 changes what those clients send and receive, and you should plan for those changes before any code moves. The GraphQL work has four parts: the Apollo Server upgrade from v3 to v4 with GraphQL 16, the flattened response format, Relay-style connection queries, and documentId as the identifier clients use, since GraphQL never exposes the numeric id in Strapi 5. Strapi 5 is the path to stay on because Strapi v4 reached end of life on April 30, 2026, and its final release, 4.26.2 of June 9, 2026, will receive no further updates.

The GraphQL changes are not a separate project. The Strapi upgrade tool and codemods, the data migration that runs on first start of Strapi 5, and the breaking changes list all apply to the whole upgrade, and the docs say to back up the database first because downgrading is not supported. Treat the GraphQL client work as a workstream inside that upgrade, with its own test environment. The migration docs describe v4CompatibilityMode as the route for moving clients over in stages, so you can decide whether front ends switch together or one at a time. Confirm the setting's exact behavior for your target version in the migration docs before you commit to a sequence, because the answer changes how long the mixed period lasts.

Start with an inventory of every GraphQL query, fragment and client configuration in your front ends and integrations, and record which ones read id, rely on the nested v4 response shape or depend on Apollo Server behavior. The Apollo v4 change affects error handling, CSRF prevention and plugin configuration, so review any custom Apollo plugins and error formatting in your Strapi project as well. Ask your team to decide who owns each client, which clients move in the first stage, and how each stage is tested against a copy of the production data. Those decisions, more than the migration tool itself, set the effort and the risk for this part of the upgrade.

Which GraphQL changes affect your clients

This table lists each Strapi 5 GraphQL change, what it can affect in a client, and the first action to take. Read it as a checklist: find the rows that match the queries, plugins and error handling your clients use, then confirm exact field behavior against your own schema and the linked breaking change pages. The main takeaway is that most client breakage comes from response shape and identifier changes, so inventory those first.

ChangeImpactAction needed
Apollo Server v3 to v4 and GraphQL v15 to v16Error handling, CSRF prevention and plugin configuration may behave differently for requests and custom pluginsTest error responses and CSRF-protected requests, and review plugin configuration against the Apollo v4 breaking change page
Flattened response formatFields that clients read from nested data wrappers may move or change shapeList every query your clients send and compare its response shape before and after the upgrade
Relay-style *_connection queriesPaginated queries return nodes and pageInfo, so code that reads plain lists may fail or return empty resultsUpdate list and pagination code to read nodes and pageInfo, then confirm cursor behavior on your own collections
Numeric id not exposed through GraphQLClient code that stores or passes the numeric id will stop working for those recordsSwitch lookups, mutations and stored references to documentId, and check any saved ids in client data
v4CompatibilityMode for gradual migrationLets older clients keep working while others move, but it is a temporary bridge rather than a permanent settingConfirm the mode's availability and scope in your Strapi version, set a removal plan per client, and track which clients still depend on it

What to inventory and back up before changing GraphQL queries

Changing GraphQL behavior in Strapi 5 is only safe once you know what depends on it and can return to a known state. The cards below cover the backup, the inventory of client queries, the custom code tied to Apollo, a staging copy, supported runtimes and a test suite that exercises each query shape.

Back up the database first

Take a full database backup before running the upgrade tool or starting Strapi 5 for the first time. The data migration scripts run on first start, and the Strapi documentation states that downgrading is not supported, so the backup is the only practical way back. Confirm you can restore it on a separate host, and record the Strapi version and commit that produced it so the code and data can be paired again.

Upgrade FAQ

Inventory every GraphQL operation

List each query and mutation sent by every client: web front ends, mobile apps, scheduled jobs, internal tools and partner integrations. Note the operation name, the fields and arguments requested, and whether the client uses id values for lookups. Clients often live in different repositories, so the inventory should come from source code and from recent request logs, not from memory.

Find code tied to Apollo configuration

Search custom plugins, GraphQL extensions, resolvers and middleware for direct use of Apollo Server settings, error formatting, CSRF prevention and plugin hooks. Strapi 5 moves the GraphQL layer to Apollo Server 4 and GraphQL 16, so any code that reads or sets those options needs a review. Record each file and the owner who will check it after the upgrade.

Build a staging copy of the data

Restore the backup to a staging environment with the same database engine and similar volume, then run the upgrade there first. Staging shows which queries return different shapes, how long the migration takes and whether custom code breaks on real content. Keep staging on the same Strapi commit and environment variables as production so the results carry over.

Confirm runtime and database versions

Strapi 5 supports PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3, and it does not support MongoDB or other NoSQL databases. It runs only on Active or Maintenance LTS Node.js versions. Check the installed Node.js and database versions on every host before the upgrade, and plan any database engine change as a separate project.

Installation requirements

Write a test suite per query shape

Create automated tests that run each inventoried operation against staging and assert on the response structure, not only on status codes. Cover list queries, single-item lookups, connection queries with pagination and any mutation that writes content. Include a check that the numeric id is absent from GraphQL responses, since the API no longer exposes it. Run the suite before and after the upgrade and keep the results.

How to move GraphQL clients to Strapi 5 in order

This sequence moves a Strapi GraphQL API from v4 behavior to Strapi 5 one client at a time, with a rollback point after each step so a failed change does not block the rest of the upgrade.

  1. Back up the database and code first

    Before any change, the team takes a full database backup and tags the current code in version control. The docs say to back up the database first because downgrading is not supported, so this backup is the only reliable way back. Rollback at this point means restoring the pre-upgrade database and code, which is still the state the production system runs on. Done when the backup restores cleanly to a scratch database and the tag exists in the repository.

  2. Run the upgrade tool on a branch

    An engineer creates a branch, runs the Strapi v4 to v5 upgrade tool and its codemods, and commits the changes separately from any feature work. The team reviews every codemod change that touches GraphQL schema, resolvers, plugin configuration or Apollo setup, since those files drive the client contract. Rollback at this point means discarding the branch, because nothing has reached a shared environment. Done when the diff is reviewed and the branch builds locally.

  3. Start Strapi 5 in staging to run the data migration

    The team points a staging environment at a copy of the production database and starts Strapi 5 so the data migration scripts run on first start. The engineer checks the logs for migration errors and confirms that content counts and key relations match the source. Rollback at this point means discarding the staging database copy and redeploying the v4 build, with production untouched. Done when the migration completes without errors and spot checks of entries match the source.

  4. Update Apollo and GraphQL server configuration

    The team updates server configuration for the Apollo v4 and GraphQL 16 changes, reviewing error handling, CSRF prevention and any plugin configuration that depends on the previous Apollo version. An engineer compares error payloads and introspection behavior against the staging baseline. Rollback at this point means reverting this change on the branch and restoring the staging copy from the backup. Done when the GraphQL endpoint starts, responds to a basic query, and returns errors in the expected shape.

  5. Move queries to the new format one client at a time

    Each client is switched separately to the flattened format and the Relay-style connection shape with nodes and pageInfo, while v4CompatibilityMode keeps the rest of the clients working. The team migrates the lowest-risk client first, confirms it, and then moves the next one. Rollback for a single client means reverting that client's queries while the others stay on the new server. Done when each client's test suite passes against staging and the compatibility setting can be removed with no client still depending on the old shape.

  6. Replace numeric id usage with documentId

    Clients and internal code that reference the numeric id are changed to use documentId, because GraphQL no longer exposes the numeric id in Strapi 5. The team searches client code, saved queries, caches and stored links for id references and updates each one. Rollback means reverting the affected client change, since the compatibility mode does not restore id fields. Done when a search of the codebases finds no id references in GraphQL calls and cached links resolve through documentId.

  7. Retest and confirm the release

    The team runs the full regression set for every client, checks authenticated and public queries, drafts and published content, and pagination across connection queries, then repeats the staging check with a fresh copy of production data. Operations confirms that monitoring and logs show no new GraphQL errors. Rollback means restoring the pre-upgrade database and code, which the team keeps available until this step is signed off. Done when every client passes on the final build and the production cutover plan is approved in writing.

Gradual migration or single cutover for GraphQL clients

When a single front end is owned by one team that can release it in the same window as the back end, a single cutover is usually the lowest-risk option. The team updates queries to the flattened format, switches list queries to the *_connection pattern where they need paging, and deploys the client alongside the upgraded Strapi instance. There is no long-lived compatibility layer to maintain, and the test effort concentrates in one codebase.

  • Query inventory: List every GraphQL operation the client sends, including fragments and generated types, before the upgrade starts.
  • Single release window: Confirm the client can be deployed in the same window as the Strapi 5 cutover, with a rollback plan for both.
  • Numeric id removal: Check for any code that reads a numeric id, since GraphQL no longer exposes it and documentId replaces it.
  • Staging run: Run the full client against a staging copy of the upgraded Strapi project, not only unit tests.
  • Pagination rewrite: Replace offset-style list handling with nodes and pageInfo where the client paginates.

Ask the client owner whether any mobile builds or cached clients will still call the old schema after the cutover, because a single cutover does not reach those users.

What makes a GraphQL migration take longer

This table lists the factors that stretch a Strapi 5 GraphQL migration and shows what each one increases. Read each row as a question to answer about your own project before you request a quote. The main takeaway is that client count, custom resolver code and test coverage usually matter more than the upgrade tool itself.

DriverWhy it changes effortWhat to ask for in a quote
Number of GraphQL clients and release cadenceEach client that queries the API must be updated and released, and frequent client releases lengthen the window when both formats must work.A list of clients, their release schedules and who approves each release.
Custom resolvers and controllersHand-written resolvers and controllers that call the old Entity Service or return v4 shapes need rewriting for the Strapi 5 GraphQL behavior.A count of custom resolvers and controllers and a review of each one's data access.
Custom Apollo plugins and error handlingApollo Server 4 changes error handling, CSRF prevention and plugin configuration, so custom plugins and error formats need checking.An inventory of Apollo plugins and client error handling, with the expected test steps for each.
Reliance on the numeric idGraphQL never exposes the numeric id in Strapi 5, so any client or logic that stores or sends ids must move to documentId.A search of client and server code for id usage and a plan for storing documentId.
Schema size and query varietyA large schema with many components, dynamic zones and nested relations produces more query shapes to test against the new connection format.The number of content types, components and common query patterns, and how they will be verified.
Data volume for the migration runLarger databases take longer to run the Strapi 5 data migration scripts and to verify the result on a copy.Database size, the planned test run on a copy and the expected rehearsal count.
Availability of test coverageWithout automated GraphQL tests, every query and client path must be checked by hand, which adds the most unplanned time.Existing test coverage for queries and mutations, and whether the partner will write missing tests in scope.

How a client query moves through the upgraded Strapi stack

A GraphQL request starts at the client and crosses a trust boundary before it reaches the Strapi instance, where the Apollo Server 4 layer parses and validates it. The query then runs against the Document Service API and the database, and the response returns in the flattened format unless v4CompatibilityMode is enabled for a client that still expects v4 shapes. Check error handling, CSRF behavior and the *_connection query shape at the boundary, since those are the points where existing clients usually break.

Request path from client to database, with the trust boundary around the Strapi instance.

Questions teams ask before changing GraphQL queries in Strapi 5

How much does a GraphQL migration to Strapi 5 cost?

The cost depends on how many queries, fragments and clients use the GraphQL API, how much of the schema changed for your content types, and how much testing your front ends need. Costs fall into two groups: the work to inventory and rewrite queries and client code, and the work to test and release each client. Both are one-time effort, while the Strapi license cost is separate: the Community Edition is free, and the self-hosted Growth plan is listed at 45 US dollars per month including 3 users, per the Strapi self-hosted pricing page. DeployOpen does not publish prices. Ask for a written scope that lists each client, each query group, the test environments and the release steps, so the quote can be compared against your own estimate.

How long does updating GraphQL queries for Strapi 5 take?

Duration depends on the number of clients, how many queries they send, whether they use the Relay-style connection shape, and how many separate apps must release together. Teams with one client and a small schema usually finish faster than teams with mobile apps, partner integrations and several front ends that release on different schedules. Your own team should also account for approval cycles and staging availability. Ask for a timeline with dependencies listed per client, and confirm which clients can be updated behind a compatibility layer and which need a coordinated cutover.

Can our own developers update the GraphQL queries without a partner?

Yes, many teams do this in-house if they know their GraphQL client and the Strapi 5 schema well. The work needs developers who can read the schema, write and test queries in each client framework, and handle Apollo Client configuration. Someone also needs to own the Strapi side, including the GraphQL plugin settings and the Apollo Server 4 changes that affect error handling and CSRF prevention. A partner is most useful when the team lacks capacity, has many clients to coordinate, or needs an independent test plan before release. Confirm your internal skills against the breaking change notes before deciding.

What do we need to provide for a GraphQL upgrade project?

The work needs named owners for each client application, a list of every query and fragment in use, and representative test data in a staging environment that matches production content types. You also need staging access to a Strapi 5 instance, a current copy of the GraphQL schema, and access to the client repositories and release pipelines. Client owners should confirm which fields and filters their screens depend on, and who signs off on behavior changes. Missing test data is one of the most common causes of delay, so ask for a checklist of data sets before the work starts.

Does v4CompatibilityMode let us delay the GraphQL cutover?

It can let some clients keep working while others move, but it is a transition setting, not a permanent state. Strapi documents it as a way to ease migration, and the v4 response behavior it preserves should be confirmed in the Strapi v4 to v5 migration documentation for your exact version. Plan to remove it once every client has moved, and track its use in your release plan so it does not stay in production indefinitely. Confirm with your Strapi version how the setting applies to GraphQL specifically before relying on it for a staged rollout.

Does removing the numeric id break existing GraphQL clients?

Yes, it can, if a client reads, stores or compares the numeric id field. Strapi 5 GraphQL never exposes the numeric id, so clients need to use documentId for identity, including caching keys, routing parameters and mutation targets. Search your clients for id references, including stored records, analytics events and URLs that depend on the value. Plan a mapping step for any data that already holds numeric ids, and test every screen that loads a single entry. Confirm the exact field behavior for your schema in the Strapi GraphQL API documentation before you change client code.

Which Apollo Server changes affect our GraphQL endpoint after upgrading?

Strapi 5 moves the GraphQL layer to Apollo Server 4 and GraphQL 16, which changes how errors are returned, how CSRF prevention is configured and how plugin settings are written. Clients that parse error objects, send requests without the expected headers or rely on older plugin options can fail even when queries look correct. Your engineers should review the Apollo v4 breaking change page, then run a test suite that checks error paths, authentication failures and each custom plugin. Ask your partner or internal lead to list each change that affects your specific endpoint before the upgrade is scheduled.

How DeployOpen works on this

DeployOpen approaches Strapi 5 GraphQL API changes as a scoped piece of work inside your own infrastructure. We start by inventorying the GraphQL clients, queries and plugins that depend on the v4 schema, then plan the Apollo Server 4 and GraphQL 16 changes, the flattened format and the move to connection queries and documentId.

How we scope

  • Inventory every GraphQL client, saved query and front-end component that reads the v4 schema.
  • Identify plugins and custom resolvers that depend on Apollo Server 3 behavior or v4 response shapes.
  • Agree the written scope, deliverables and timeline with you before any build work starts.

How we build

  • Update queries to flattened fields, *_connection queries with nodes and pageInfo, and documentId references.
  • Run a gradual migration with v4CompatibilityMode on a staging copy, then remove it client by client.
  • Test error handling, CSRF prevention and plugin configuration against the upgraded Apollo Server setup.

How we hand over

  • Deliver a written record of changed queries, schema differences and the compatibility mode removal plan.
  • Document the test cases used to confirm each client works against the Strapi 5 GraphQL API.
  • Walk your engineers through the remaining work so they can maintain the queries after handover.

How we support

  • Offer ongoing support and upgrades as a retainer after the initial migration is complete.
  • Provide continued testing as Strapi 5 minor releases ship, so schema changes are caught early.
  • Confirm with your team which releases to track and how frequently the GraphQL test suite runs.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.