Quick revision
The short answer
Before approving GraphQL over 30 REST services as a company direction, I would settle who owns the schema, because a central team becomes a bottleneck while federation spreads ownership but adds tooling. I would also look at how performance and cost are controlled for arbitrary queries, accept that caching is harder than with HTTP GET resources, and require authorisation per field and per object that stays consistent with the REST APIs. Then I would start with one BFF-style GraphQL layer for one client, measure the results, and only expand when the numbers justify it.
What to remember
In this answer, we looked at what to weigh before making GraphQL over 30 REST services a company direction. Schema ownership decides team structure: a central team becomes a bottleneck, while federation spreads ownership at the cost of tooling. Arbitrary queries need batching, limits and persisted queries to control performance and cost; HTTP caching becomes harder; and authorisation has to work per field and per object, consistent with REST. The sensible path is a BFF-style GraphQL for one client, measured against clear numbers, before any wider commitment.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Before approving GraphQL over 30 REST services as a company direction, I would settle who owns the schema, because a central team becomes a bottleneck while federation spreads ownership but adds tooling. I would also look at how performance and cost are controlled for arbitrary queries, accept that caching is harder than with HTTP GET resources, and require authorisation per field and per object that stays consistent with the REST APIs. Then I would start with one BFF-style GraphQL layer for one client, measure the results, and only expand when the numbers justify it.
Why this question is asked
GraphQL proposals usually come from a real pain: a mobile screen needs data from six services, so the app makes six calls, over-fetches large responses, and every new screen needs a new backend endpoint. A GraphQL layer promises one request per screen and fewer backend changes. Approving it for the whole company, though, is a decision that will shape APIs, team structure and operating costs for many years. Interviewers ask this leadership question to see whether we can separate a promising tool from a company direction. In this answer, we will clarify the problem being solved, then look at ownership, performance and cost, caching, authorisation, and finally a staged way to decide.
1Starting From the Problem, Not the Technology
The first question a senior person asks is what problem GraphQL would solve and for whom. Typical answers are: clients make many round trips per screen, they download far more data than they show, and backend teams are slowed down by a stream of client-specific endpoint requests. These are real, and GraphQL addresses them well, because a client describes exactly the fields it needs and one gateway gathers them.
But each of those problems has other solutions too: a backend for frontend (BFF), a small service owned by the client team that aggregates REST calls for one app, or better-designed REST resources. So the decision is not "GraphQL yes or no" but whether GraphQL is the best way to solve these problems at our scale, given what it costs. Writing the problem down with numbers, for example "the home screen makes 9 calls and takes 1.8 seconds on 4G", gives us something to measure any solution against.
2Who Owns the Schema?
A GraphQL layer over 30 services has one schema that every client sees. Someone must own it: decide naming, review changes and keep it coherent. If a central API team owns it, every product change that needs a new field waits for that team, and with 30 services feeding it, that team becomes a bottleneck within a year.
Federation spreads the ownership. Each domain team owns a subgraph, its part of the schema, and a gateway or router composes the subgraphs into one supergraph. That removes the bottleneck, but it adds tooling: a composition step in CI that catches conflicts, a schema registry, a router to operate, and conventions for how types owned by one team are extended by another. Neither option is free, and choosing between them is really a choice about team structure.
| Model | Strength | Cost |
|---|---|---|
| Central team owns one schema | coherent design, simple tooling | bottleneck for 30 teams |
| Federation (subgraph per domain) | teams move independently | composition, registry, router to run |
| BFF per client app | client team owns its needs | no shared graph, some duplication |
3Performance, Cost and Caching
With REST, each endpoint has a known cost that its owner can tune. With GraphQL, clients compose queries, so the cost of a request depends on the query. One nested query can fan out into hundreds of calls to the underlying REST services. So the platform needs batching through DataLoaders, depth and complexity limits, timeouts, and usually persisted queries for first-party clients. Each of those has to be built and maintained, and the 30 services behind the graph must cope with the new traffic patterns the gateway creates.
Caching also changes. REST GET resources are cached by browsers, CDNs and proxies using URLs and standard headers. GraphQL requests are usually POSTs to one URL, so that whole layer of HTTP caching is lost by default. Persisted queries sent as GET requests can bring some of it back, and response or entity caches in the gateway can help, but it is extra work, and for public, cache-heavy content REST often remains cheaper.
4Authorisation Per Field and Per Object
In REST, authorisation is usually checked per endpoint: this user may call GET /orders/{id} for their own orders. In GraphQL, the same Order object can be reached through many paths: from the customer, from a shipment, from a search result. If authorisation lives only at the entry points, a nested path can expose data that no REST endpoint would have returned.
So authorisation must be enforced per object and per field, ideally by the same rules the REST services already apply. The safest design is that the GraphQL layer passes the user's identity to the underlying services and lets them enforce their own rules, rather than calling them with a powerful service account and re-implementing the rules in the gateway. Two copies of authorisation logic eventually disagree, and that disagreement is a security incident.
5A Staged Decision: One Client First
Rather than approving a company direction on paper, I would approve an experiment with clear success criteria. One client team, say the mobile app, builds a BFF-style GraphQL layer for its own screens, over the handful of services it needs, using Spring for GraphQL or similar. It owns the schema, which keeps ownership simple. We measure what matters: calls and latency per screen, data transferred, the time to ship a new screen, the load on underlying services, incidents, and the effort spent on the GraphQL platform itself.
After three to six months, we have facts. If the mobile home screen went from 9 calls and 1.8 seconds to 1 call and 0.7 seconds, and feature work got faster without new incidents, expanding to a second client and considering federation is justified. If most gains came from aggregation that a REST BFF could also provide, we have learned that cheaply. Either way, the company direction is decided by evidence, not by the excitement of the first demo.
- Write down the problem with numberscalls, latency, over-fetching, lead time
- Choose one client and a BFF-style GraphQLclient team owns the schema
- Build guardrails from day onebatching, limits, persisted queries, field authorisation
- Measure for 3 to 6 monthslatency, load, lead time, incidents, platform effort
- Gains clear and costs acceptable?YesExpand; decide central vs federationNoKeep BFF or improve REST
5 steps in order. Play them, or step through them one at a time.
6Follow-up questions
Does GraphQL replace the 30 REST services?
No. In this proposal it is a layer in front of them. The services keep their REST APIs for other consumers and for service-to-service calls, and the GraphQL layer calls them. That means two API styles to maintain, which is part of the cost we weigh.
When would you say no to GraphQL?
When the clients' needs are stable and well served by a few aggregated REST endpoints, when most traffic is public and benefits from HTTP caching, or when nobody can own the schema and the guardrails properly. A GraphQL layer without an owner and without cost controls is worse than the REST APIs it replaced.
How do you keep authorisation consistent between REST and GraphQL?
By not duplicating it. The GraphQL layer forwards the user's token or identity to the REST services, which enforce their own rules, and the gateway adds only field-level checks for data it computes itself. Shared authorisation tests that run the same cases through both APIs catch drift.
7Conclusion
In this answer, we looked at what to weigh before making GraphQL over 30 REST services a company direction. Schema ownership decides team structure: a central team becomes a bottleneck, while federation spreads ownership at the cost of tooling. Arbitrary queries need batching, limits and persisted queries to control performance and cost; HTTP caching becomes harder; and authorisation has to work per field and per object, consistent with REST. The sensible path is a BFF-style GraphQL for one client, measured against clear numbers, before any wider commitment.
Open with
I would first ask what problem we are solving, with numbers, for example the home screen making nine calls and taking almost two seconds, because a BFF or better REST resources might solve it too.
Then, if they want more
Then I would look at four things. Ownership: with one schema over 30 services, a central team becomes a bottleneck, while federation lets each domain own a subgraph but adds composition, a registry and a router to run, so it is really a team-structure decision.
Performance and cost: clients compose queries, so one request can fan out to hundreds of backend calls; we would need DataLoader batching, depth and complexity limits, timeouts and persisted queries from day one. Caching: GraphQL usually means POSTs to one URL, so we lose CDN and browser caching of GET resources unless we add persisted GET queries or gateway caches.
And authorisation: objects can be reached through many paths, so it must be enforced per object and per field, ideally by passing the user's identity to the REST services so the rules are not duplicated.
My recommendation would be not to approve a company direction yet, but to let one client team build a BFF-style GraphQL for its own screens, measure latency, load, lead time and platform effort for a few months, and expand only if the gains are clear.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Spring Web MVC
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Product teams want a GraphQL layer over 30 REST services. What do you consider before...": https://scrivio-interview-library.netlify.app/spring-boot/web-other/69d9051c39/