Skip to content

Remove GraphQL API and standardize on REST API only#6

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1768570319-remove-graphql-api
Open

Remove GraphQL API and standardize on REST API only#6
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1768570319-remove-graphql-api

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

This PR removes GraphQL support from the application, standardizing on the REST API only. The changes include:

  • Deleted the entire io.spring.graphql package (12 Java files including datafetchers, mutations, and exception handlers)
  • Removed the GraphQL schema file (schema.graphqls)
  • Removed Netflix DGS codegen plugin and GraphQL dependency from build.gradle
  • Removed /graphql and /graphiql endpoint permissions from security configuration
  • Updated README to remove GraphQL documentation

The shared business logic layer (io.spring.application, io.spring.core, io.spring.infrastructure) and REST controllers (io.spring.api) remain unchanged.

Review & Testing Checklist for Human

  • Verify REST endpoints work by running the app and testing: curl http://localhost:8080/tags and curl http://localhost:8080/articles
  • Consider removing the orphaned graphql-schema.png image file that's no longer referenced in README

Notes

All 68 existing tests pass. The compile and test steps completed successfully locally.

Link to Devin run: https://app.devin.ai/sessions/68f99d79a6bf48d295c968f2fe8a3308
Requested by: @SachetCognition

- Remove entire GraphQL package (src/main/java/io/spring/graphql/)
- Remove GraphQL schema file (src/main/resources/schema/schema.graphqls)
- Remove Netflix DGS codegen plugin and GraphQL dependency from build.gradle
- Remove /graphql and /graphiql endpoints from WebSecurityConfig.java
- Update README.md to remove GraphQL references

All REST API endpoints remain unchanged and functional.

Co-Authored-By: sachet.agarwal@windsurf.com <sachet.agarwal@windsurf.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

Original prompt from sachet.agarwal
# Task: Remove GraphQL API and Standardize on REST API Only

## Context
This Spring Boot RealWorld application currently supports both REST and GraphQL APIs. Both APIs share the same business logic layer (application services like `UserService`, `ArticleCommandService`, `ArticleQueryService`, etc.), with GraphQL acting as an additional adapter layer. We want to remove GraphQL and standardize on REST only, without losing any functionality.

## Files and Components to Remove

### 1. Remove GraphQL Package
Delete the entire GraphQL package directory:
- `src/main/java/io/spring/graphql/` (entire directory and all files within)

### 2. Remove GraphQL Schema
Delete the GraphQL schema file:
- `src/main/resources/schema/schema.graphqls`

### 3. Update Build Configuration (`build.gradle`)
Remove the following dependency:
- Line with `implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:4.9.21")` or similar DGS starter dependency

Remove the DGS codegen plugin configuration if present.

### 4. Update Security Configuration
In `src/main/java/io/spring/api/security/WebSecurityConfig.java`:
- Remove `/graphql` from the list of public endpoints
- Remove `/graphiql` from the list of public endpoints

These endpoints are currently configured as public in the security configuration.

### 5. Update Documentation
In `README.md`:
- Remove all references to GraphQL API
- Remove mentions of the dual API architecture
- Update the technology stack section to remove Netflix DGS Framework

## Important Notes
- **Do NOT modify** any files in the `io.spring.application` package - these contain the shared business logic
- **Do NOT modify** any files in the `io.spring.api` package - these are the REST controllers that will remain
- **Do NOT modify** any files in the `io.spring.core` or `io.spring.infrastructure` packages
- All REST API endpoints remain unchanged and functional

## Verification Steps
After making the changes:
1. Run `./gradlew build` to ensure the project compi... (559 chars truncated...)

@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@SachetCognition
Copy link
Copy Markdown
Owner

Can you also document the architectural changes into a word document

@devin-ai-integration
Copy link
Copy Markdown
Author

I've created a Word document documenting the architectural changes. The document covers:

  • Previous architecture (dual REST + GraphQL APIs)
  • All GraphQL components that were removed
  • Changes made to build configuration and security
  • New architecture (REST API only)
  • Benefits of the change
  • Unchanged components
  • Verification steps performed

I'll share the document with you directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant