Migrate REST API to GraphQL

Gradually transition an existing REST API surface to GraphQL without breaking clients.

category:modernization
graphql
api
migration
backend
workflow
multi-step
0

Prompt

This workflow is intended for teams that want to introduce GraphQL while preserving REST compatibility during the transition.

## Steps:

1. Inventory the main REST endpoints and group them by resource.

2. Design an initial GraphQL schema that covers the most-used endpoints.

3. Implement resolvers that internally call the existing REST handlers.

4. Introduce batching and dataloaders to avoid N+1 calls.

5. Deploy GraphQL in parallel with existing REST endpoints.

6. Document the migration path for clients and add deprecation headers on REST.

7. Gradually move clients to GraphQL, monitoring performance and errors.

8. Remove unused REST endpoints once clients are fully migrated.