Adding Custom Domain to Project
Overview
This example shows how to add a custom domain to a project using the Zeet GraphQL API.
Prerequisites
Before making API requests, make sure that you have the Zeet GraphQL API ready and working. You can use the Getting Started guide for reference. This assumes you have a project already created, and that you have a domain name ready to use.
Example
For this example, we'll use the api v0 endpoint. Ensure you are making requests to the correct GraphQL endpoint! This is a single request that will connect a domain to a project:
# using v0 API endpoint:
# https://anchor.zeet.co/graphql
mutation {
  addRepoCustomDomain(
    input: {
      id: $YOUR_PROJECT_ID
      domain: "example.com"
      certManagerChallengerType: "http01"
    }
  ) {
    id
    clusterDomains {
      id
      domains {
        id
        id
        domain
        isApex
        cnameTargets
        ipTargets
        disableCertManager
        certManagerChallengeType
        syncDomain {
          id
        }
        instructions {
          domain
          type
          value
        }
        certificate {
          dnsNames
          ready
          issuing
          challenges {
            dnsName
            solver
            statusReason
            statusState
            type
            wildcard
          }
          instructions {
            domain
            type
            value
          }
        }
      }
    }
  }
}
Next, you'll want to validate the domain with your DNS provider. You can do this by following the instructions in the instructions field of the response. Once the domain is validated, the certificate will be issued and the domain will be connected to your project.