type Query {
    networkStatus: NetworkStatus!
    userStatus: UserStatus!
    uiState: UiState!
}

type Mutation {
    requestStarted: Int!
    requestCompleted: Int!
    setAsLoggedIn(input: UserStatusInput!): UserStatus!
    setAsLoggedOut: UserStatus!
    setUiLanguage(languageCode: LanguageCode): LanguageCode
    setActiveChannel(channelId: ID!): UserStatus!
    updateUserChannels(channels: [CurrentUserChannelInput!]!): UserStatus!
}

type NetworkStatus {
    inFlightRequests: Int!
}

type UserStatus {
    username: String!
    isLoggedIn: Boolean!
    loginTime: String!
    permissions: [Permission!]!
    activeChannelId: ID
    channels: [CurrentUserChannel!]!
}

type UiState {
    language: LanguageCode!
}

input CurrentUserChannelInput {
    id: ID!
    token: String!
    code: String!
    permissions: [Permission!]!
}

input UserStatusInput {
    username: String!
    loginTime: String!
    activeChannelId: ID!
    channels: [CurrentUserChannelInput!]!
}
