Remove GraphQL (Netflix DGS) layer and cursor-based pagination infrastructure#13
Conversation
…tructure
Phase 1: Added HTML test report configuration to build.gradle
Phase 2: Added RestApiComprehensiveTest with 12 pre-migration REST coverage tests
Phase 3: Removed entire GraphQL layer - deleted graphql package (12 files),
schema.graphqls, DGS plugin/dependency/codegen task from build.gradle
Phase 4: Removed cursor-based pagination - deleted CursorPager, CursorPageParameter,
DateTimeCursor, PageCursor, Node; cleaned up ArticleData, CommentData,
ArticleQueryService, CommentQueryService, ArticleReadService,
CommentReadService, and MyBatis mapper XMLs
Phase 5: Removed graphql/graphiql permitAll rules from WebSecurityConfig
Phase 6: Added GraphQLRemovedTest (verifies GraphQL endpoints return 401,
no GraphQL classes on classpath) and RestApiSmokeTest (end-to-end
smoke test covering all 19 REST endpoints)
Phase 7: Final test run - all 81 tests pass, 0 failures
No business functionality lost - every GraphQL operation has a REST equivalent.
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Original prompt from sachet.agarwal
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…sed import in RestApiSmokeTest Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Summary
Removes the entire Netflix DGS GraphQL layer and all cursor-based pagination infrastructure, standardizing on REST API only. No business functionality is lost — every GraphQL operation already had a REST equivalent.
Deleted (18 files):
src/main/java/io/spring/graphql/— 12 GraphQL resolver/mutation/exception filessrc/main/resources/schema/schema.graphqlsCursorPager,CursorPageParameter,DateTimeCursor,PageCursor,NodeModified (11 files):
build.gradle— removed DGS plugin, dependency, and codegen task; added HTML test reportingWebSecurityConfig.java— removed/graphqland/graphiqlpermitAll rulesArticleQueryService.java/CommentQueryService.java— removed cursor-based query methodsArticleData.java/CommentData.java— removedimplements NodeandgetCursor()ArticleReadService.java/CommentReadService.java(interfaces) — removed cursor method declarations<select>blocksArticleQueryServiceTest.java— removed cursor pagination test.github/workflows/gradle.yml— upgradedactions/checkout,actions/setup-java,actions/cachefrom v2 → v4 (v2 is deprecated and was causing CI failures)Added (3 test files):
RestApiComprehensiveTest.java— 12@WebMvcTestcases covering REST equivalents of GraphQL operations (filtering, pagination, auth, error cases)GraphQLRemovedTest.java— verifies/graphqland/graphiqlendpoints return 401; reflection check that noio.spring.graphqlclasses remain on classpathRestApiSmokeTest.java— full@SpringBootTestend-to-end smoke test exercising all 19 REST endpoints sequentially (register → login → CRUD articles/comments → follow/unfollow → feed → delete)Local Testing Results
Verified locally via
./gradlew bootRun+ curl against key endpoints:GET /tags→ 200, returned tag list ✓POST /users→ 201, user registered ✓GET /user(with auth) → 200 ✓POST /articles→ 200, article created ✓GET /articles/{slug}→ 200 ✓GET /articles→ 200, listed articles ✓GET /articles/feed(with auth) → 200 ✓POST /graphql→ 401 (confirmed GraphQL is gone) ✓DELETE /articles/{slug}→ 204 ✓Review & Testing Checklist for Human
CursorPager,CursorPageParameter,DateTimeCursor,PageCursor,Node(the interface),graphql, ordgs. The diff removes all known references, but a full-text search will catch anything missed.new ObjectMapper()instead of the Spring-autowired one. This was a deliberate workaround because the app's ObjectMapper hasUNWRAP_ROOT_VALUEenabled, which breaksreadTree(). Verify this doesn't mask any serialization mismatches.dev.db: Uses nanoTime-based unique usernames to avoid collisions, but data is never cleaned up within a test run. Confirm this is acceptable given./gradlew cleandeletesdev.db../gradlew bootRun, then hit a few key endpoints (GET /tags,POST /users,POST /articles,GET /articles/feedwith auth) to confirm the app works end-to-end outside of the test harness.Notes
RestApiSmokeTestis a single sequential test method by design — it validates the full user journey but does mean a mid-flow failure skips later assertionsLink to Devin session: https://app.devin.ai/sessions/67ae76a372c14a2aa3f31b1ecaee72b3
Requested by: @SachetCognition