Skip to content

Switch to GraphQL query from environment.json endpoint in Environment Index page

Proposal

Use the new GraphQL query introduced in #368680 (closed)

Example

{
  project(fullPath: "shinya.maeda/pipeline-playground") {
    environments {
      nodes {
        name
        state
      }
    }
  }
}

Technical proposal

  1. Replace the resolvers in app/assets/javascripts/environments/graphql/resolvers/base.js and their associated client queries with fully realized GraphQL queries and mutations.
  2. Clean up client types in app/assets/javascripts/environments/graphql/typedefs.graphql, to remove ones replaced by their backend counterparts, and update the remaining client types to utilize the backend ones.
  3. Update the components in app/assets/javascripts/environments/ to ensure the UI still functions for all changed queries.
Edited by Andrew Fontaine