Types in GraphQL represent objects that you can fetch from a service.
We'll cover a quick intro to GraphQL types here but you can find more via the GraphQL website.
String/Int/JSON/Float/Date/Boolean are the built-in scalar types - these are types that resolve to a single scalar object, and can't have sub-selections in the query.String! means that the field is non-nullable, meaning that the GraphQL service promises to always give you a value when you query this field. In the type language, we'll represent those with an exclamation mark.[Company!]! represents an array of Company objects. Since it is also non-nullable, you can always expect an array (with zero or more items). And since Company! is also non-nullable, you can always expect every item of the array to be an Company object.type Company {
id: ID!
externalId: ID
name: String!
# Company Account Type
# msp/tenant/prospect i.e. MSP/Customer/Prospect
accountType: AccountType!
plan: Plan!
usage: [Usage!]!
dailyUsage: [DailyUsage!]!
clients: [Company!]!
# Array of users who can administer the platform
users: [User!]
# Array of all learners under the company
learners: [Learner!]
# uBreach Pro Add-On is enabled on the company
uBreachProEnabled: Boolean
# Domains monitored by uBreach Pro scans
uBreachProDomains: [String]
# Company settings data - This mirrors the input types when creating/updating company records
settings: CompanySettingsData
# MSP Default Tenant settings data - This mirrors the input types when creating/updating MSP company records
defaultTenantSettings: DefaultTenantSettingsData
}
# SimpleCompany is a more basic representation of a company offering less data
type SimpleCompany {
id: ID!
name: String!
externalId: ID
accountType: AccountType!
}
# Company account types
enum AccountType {
msp
tenant
distributor
prospect
}
# Company Settings data
# This only available on MSP and tenant accounts
type CompanySettingsData {
# Available on both MSP and tenant accounts
domainLock: Boolean
appThemeLogo: String
appThemeNavColor: String
appThemePrimaryColor: String
appThemeSecondaryColor: String
uBreachProEnabled: Boolean
# MSP Only
platformAccess: Boolean
# Tenants only
emailThemePrimaryColor: String
emailThemeSecondaryColor: String
emailThemeLogo: String
freeTrial: Boolean
learnerLimit: Int
uBreachEnabled: Boolean
uLearn: Boolean
uPhish: Boolean
uPolicy: Boolean,
allowBlockedFreeEmails: BlockedFreeEmailType
allowBlockedFreeEmailsLearner: Boolean
allowBlockedFreeEmailsUser: Boolean
policySignatureSettings: DefaultPolicySignatureSettings
uBreachProDomains: [String]
}
# MSP Default Tenant Settings - Applied when an MSP creates a new customer
type DefaultTenantSettingsData {
appThemeLogo: String
appThemeNavColor: String
appThemePrimaryColor: String
appThemeSecondaryColor: String
emailThemePrimaryColor: String
emailThemeSecondaryColor: String
emailThemeLogo: String
enableRiskScore: Boolean
uBreachEnabled: Boolean
uBreachProEnabled: Boolean
uLearn: Boolean
uPhish: Boolean
uPolicy: Boolean
policySignatureSettings: DefaultPolicySignatureSettings
}
type User {
id: ID!
companyId: ID!
company: Company!
email: String!
firstName: String!
lastName: String!
name: String!
createdAt: String!
updatedAt : String!
isVerified: Boolean!
commsType: CommsType
}
type Plan {
# Premium, Custom & freeTrial
# Premium = Domain lock on and no expiry date
# Custom = Domain lock off
# Free Trial = Company is on a 2 week free trial
name: String
# Count of active learners associated with the company
learnerCount: Int
# Maximum amount of learners this account can have
# Free trial defaults to 5000
learnerLimit: Int
# Domain lock stops companies adding learners with domains outside of the domain
# they signed up with.
domainLock: Boolean
# Domain the company signed up with
domain: String
}
type Usage {
# Start of billing period
startDate: Date
# Maximum amount of learners during this period
maxLearners: Int
currency: String
# Distributor Id of company
distributorId: ID
# uBreach Pro Add-On was enabled on the company during this period
uBreachProEnabled: Boolean
# The number of domains monitored under uBreach Pro on the company during this period
uBreachProDomains: Int
}
Note: This is currently limited to the last 100 days per client.
type DailyUsage {
# Start of billing period
date: Date
# Maximum amount of learners during this period
maxLearners: Int
}