query DomainDatabasesPage(
    $id: ID!
) {
    mode {
        isDemo
    }
    viewer {
        login
        permissions {
            manageServerDb
            manageServerBackup
        }
    }
    os {
        isWindows
    }
    domain: node(id: $id) {
        ... on Domain {
            id
            relatedDatabase {
                id
                domain {
                    name
                }
            }
            databases {
                ...CommonDatabaseFields
            }
            baseDomain {
                id
                databases {
                    ...CommonDatabaseFields
                }
            }
            subscription {
                isDatabasesAvailable
                status
                limits {
                    database {
                        isLimitAvailable
                        isUnlimited
                        remaining
                    }
                    mssql {
                        isLimitAvailable
                        isUnlimited
                        remaining
                    }
                }
            }
        }
    }
}


fragment CommonDatabaseFields on Database {
    id
    name
    tablesCount
    formattedSize
    allowCheckAndFix
    allowClone
    allowDump
    allowImport
    allowRecreateDatabase
    domain {
        id
        name
    }
    users {
        id
        login
    }
    server {
        id
        type
        host
        port
        fork
        lastError
        isWebadminInstalled
    }
}
