Skip to content

Code Insights: [FE] Clean up code base structure after GQL API adoption

Administrator requested to merge vk/clean-up-api-after-gql-api-adoption into main

Created by: vovakulikov

Context

This PR is the first part of the setting migration cleaning up process (the second part would be about removing setting-based API completely). During the adoption of GQL API, we omitted a lot of unnecessary but important stuff in our code base. This includes

  • Old methods to select data
  • Bunch of legacy helpers
  • Duplication of logic
  • Just unused methods and functions

This PR comes up with a new structure for Code Insights FE APIs and removes all things from the list above.

The new structure of the backend directory looks like this now

  • /core -Sharable logic between different API backends (mostly network requests and fetchers)
  • /gql-api - All related to GQL API things, helpers, utils, and code insights GQL class itself
  • /setting-based-api - All related things to Setting-based API
  • /utils - Sharable helpers for both APIs (maybe could be placed in core directory, unsure)
  • code-insights-backend.ts - Main API interface that all implementations must follow
  • code-insights-backend-context.ts - React context object with default mocked implementation of API
  • code-insights-backend-types.ts - Mostly just moved input and output methods types for code-insights-backend.ts interface

Merge request reports

Loading