Skip to content

Create GraphQL Type for PagesDomain

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

In order to move the pages UI to vue we need to expose Pages domains with GraphQL. We should add a GraphQL type named PagesDomain to the Project type. It can be queried on the Project as a simple list (instead of a connection) as I assume there will rarely be more than 10 domains per project.

The final type should follow the below spec:

type PagesDomain {
  id: ID!
  domain: String
  certificate: String
  verifiedAt: Datetime
  enabledUntil: Datetime
  removeAt: Datetime
  autoSslEnabled: Boolean
  certificateValidNotBefore: Datetime
  certificateValidNotAfter: Datetime
  certificateSource: CertificateSource
  wildcard: Boolean
  autoSslFailed: Boolean
}

enum CertificateSource {
  USER_PROVIDED
  GITLAB_PROVIDED
}

Implementation Guide

  1. Familiarise yourself with our GraphQL API style guide (No need to fully read it, just be aware it's a handy reference)
  2. Add the new type in a file at app/graphql/types/pages_domain.rb (You can use pages_deployment_type.rb as a reference
  3. Add the type to app/graphql/types/project_type.rb (again, you can use pages_deployments as a reference)
  4. For testing GraphQL, we prefer integration tests over unit tests. Add a spec to spec/requests/api/graphql/pages
Edited by 🤖 GitLab Bot 🤖