"""The root Query"""
type Query {
  hello: String
  void: String
  userapp(
    """Unique app name for user"""
    name: String

    """Unique app name for user"""
    clientId: ID
  ): Application
  applications: [Application]
  myapplications: [Application]
  application(
    """The ID to search by"""
    clientId: ID!
  ): Application
  myclients: [Application]
  scopes(
    """Unique app name for user"""
    search: String

    """Unique app name for user"""
    values: [ID]
  ): [Scope]
  scope(
    """Unique app name for user"""
    key: String!
  ): Scope
  user(
    """The email of the user"""
    email: String

    """The email of the user"""
    id: ID
  ): User
  me: User
  users(
    username: String
    email: String

    """Filter by values"""
    ids: [ID]

    """Search for substring of username"""
    search: String
  ): [User]

  """Get a group"""
  group(
    """Unique app name fddor user"""
    id: ID

    """Unique app name fddor user"""
    name: String
  ): Group

  """Get a list of users"""
  groups(
    name: String

    """Filter by values"""
    ids: [ID]

    """Search for substring of username"""
    search: String
  ): [Group]

  """Get a list of users"""
  mygroups(
    """Unique app name for user"""
    name: String
  ): [Group]

  """Get a group"""
  channel(
    """Unique app name fddor user"""
    id: ID
  ): Channel

  """Get a list of users"""
  channels(
    name: String

    """Filter by values"""
    ids: [ID]

    """Search for substring of username"""
    search: String

    """Filter by user"""
    user: ID
  ): [Channel]

  "Comments for a specific object\n\n    This query returns all comments for a specific object. The object is\n    specified by the `model` and `id` arguments. The `model` argument is\n    a string that is the name of the model. The `id` argument is the id of\n    the object.\n\n    You can only query for comments for objects that you have access to.\n\n    "
  commentsfor(
    deep: Boolean

    """The identifier of the object"""
    identifier: String!
    object: ID!
  ): [Comment]
  mymentions: [Comment]
  comment(id: ID!): Comment
  client(
    """The FaktApp ID"""
    id: ID

    """The client id of one associated oauth2 application"""
    clientId: ID

    """The FaktApp ID"""
    token: ID
  ): Client
  myPrivateClients: [Client]
  clients: [Client]
  myPublicClients: [Client]
  app(
    """The FaktApp ID"""
    id: ID

    """Unique app name for user"""
    identifier: String

    """Unique app name for user"""
    version: String

    """The client id of one associated oauth2 application"""
    clientId: ID
  ): App
  apps(
    """Search for substring of identifier"""
    search: String
  ): [App]
  release(
    """The FaktApp ID"""
    id: ID

    """Unique app name for user"""
    identifier: String

    """Unique app name for user"""
    version: String

    """The client id of one associated oauth2 application"""
    clientId: ID
  ): Release
  releases(
    """Filter by app"""
    app: ID
  ): [Release]
  filter(
    """The FaktApp ID"""
    id: ID

    """Unique app name for user"""
    name: String
  ): Filter
  filters(
    """Filter by linker"""
    linker: ID

    """Search for methods of identifier"""
    methods: [FilterMethod]
  ): [Filter]
  linker(
    """The FaktApp ID"""
    id: ID

    """Unique app name for user"""
    name: String
  ): Linker
  linkers(
    """Filter by template"""
    template: ID

    """Search for substring of identifier"""
    search: String
  ): [Linker]
  configuration(
    """The FaktApp ID"""
    id: ID

    """Unique app name for user"""
    name: String
  ): Configuration
  configurations(
    """Search for substring of identifier"""
    search: String
  ): [Configuration]

  """Get information on your Docker Template"""
  member(
    """The Whale ID"""
    id: ID!
  ): Member
  graphs: [Graph]
}

type Application {
  """"""
  id: ID!

  """"""
  clientId: String!

  """"""
  user: User

  """The associated Redirect Uris"""
  redirectUris: [String]

  """"""
  clientType: ApplicationClientType!

  """"""
  authorizationGrantType: ApplicationAuthorizationGrantType!

  """"""
  name: String!

  """"""
  skipAuthorization: Boolean!

  """"""
  created: DateTime!

  """"""
  updated: DateTime!

  """"""
  algorithm: ApplicationAlgorithm
  client: Client

  """The Url of the Image"""
  image: String
}

type User {
  """"""
  id: ID!

  """
  The groups this user belongs to. A user will get all permissions granted to each of their groups.
  """
  groups: [Group!]!

  """Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."""
  username: String!

  """"""
  firstName: String!

  """"""
  lastName: String!

  """"""
  email: String!

  """
  Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
  """
  isActive: Boolean!
  profile: Profile

  """The associated rules of this """
  roles: [String]
}

type Group {
  """"""
  id: ID!

  """"""
  name: String!

  """
  The groups this user belongs to. A user will get all permissions granted to each of their groups.
  """
  userSet: [User!]!
  profile: GroupProfile
}

type GroupProfile {
  """"""
  id: ID!

  """"""
  name: String

  """"""
  group: Group!
  avatar: String
}

type Profile {
  """"""
  id: ID!

  """"""
  name: String

  """"""
  user: User!
  avatar: String
}

"""An enumeration."""
enum ApplicationClientType {
  """Confidential"""
  CONFIDENTIAL

  """Public"""
  PUBLIC
}

"""An enumeration."""
enum ApplicationAuthorizationGrantType {
  """Authorization code"""
  AUTHORIZATION_CODE

  """Implicit"""
  IMPLICIT

  """Resource owner password-based"""
  PASSWORD

  """Client credentials"""
  CLIENT_CREDENTIALS

  """OpenID connect hybrid"""
  OPENID_HYBRID
}

"""
The `DateTime` scalar type represents a DateTime
value as specified by
[iso8601](https://en.wikipedia.org/wiki/ISO_8601).
"""
scalar DateTime

"""An enumeration."""
enum ApplicationAlgorithm {
  """No OIDC support"""
  A_

  """RSA with SHA-2 256"""
  RS256

  """HMAC with SHA-2 256"""
  HS256
}

type Client {
  """"""
  id: ID!

  """"""
  release: Release

  """"""
  oauth2Client: Application!

  """"""
  kind: ClientKind

  """"""
  token: String!

  """"""
  clientId: String!

  """"""
  clientSecret: String!
  scopes: [String]!

  """"""
  creator: User!

  """"""
  user: User
}

type Release {
  """"""
  id: ID!

  """"""
  app: App!

  """"""
  version: String!

  """"""
  name: String!
  logo: String

  """"""
  clients: [Client!]!
}

type App {
  """"""
  id: ID!

  """"""
  name: String!

  """"""
  identifier: String!
  logo: String

  """"""
  releases: [Release!]!
}

"""An enumeration."""
enum ClientKind {
  """Website"""
  WEBSITE

  """Dekstop"""
  DESKTOP

  """User"""
  USER
}

type Scope {
  value: String!
  label: String!
  description: String
}

type Channel {
  """"""
  id: ID!

  """"""
  name: String

  """"""
  user: User!

  """"""
  token: String
}

"""
A comment

A comment is a user generated comment on a commentable object. A comment can be a reply to another comment or a top level comment.
Comments can be nested to any depth. A comment can be edited and deleted by the user that created it.
"""
type Comment {
  """"""
  id: ID!

  """The identifier of the object that this comment is on"""
  identifier: String

  """The Object this comment is on"""
  object: ID!

  """"""
  user: User!

  """"""
  text: String!

  """"""
  createdAt: DateTime!

  """"""
  parent: Comment

  """The descendents of the comment (this referes to the Comment Tree)"""
  descendents: [Descendent]

  """"""
  mentions: [User!]!

  """"""
  resolved: DateTime

  """"""
  resolvedBy: User

  """Comments that are replies to this comment"""
  children(
    """How many children to return"""
    limit: Int

    """The offset for the children"""
    offset: Int
  ): [Comment]
}

"""A descendent of a node in the comment tree"""
interface Descendent {
  typename: String
}

type Filter {
  """"""
  id: ID!

  """"""
  linker: Linker!
  method: FilterMethod!

  """"""
  value: String!
}

type Linker {
  """"""
  id: ID!

  """"""
  name: String!

  """"""
  template: Configuration!

  """"""
  priority: Int!

  """"""
  filters: [Filter!]!
}

type Configuration {
  """"""
  id: ID!

  """"""
  name: String!

  """"""
  body: String!

  """"""
  linkers: [Linker!]!
}

enum FilterMethod {
  HOST_REGEX
  HOST_IS
  HOST_IS_NOT
  PORT_IS
  PORT_IS_NOT
  VERSION_IS
  VERSION_IS_NOT
  VERSION_REGEX
  IDENTIFIER_IS
  IDENTIFIER_IS_NOT
  IDENTIFIER_REGEX
  USER_IS
  USER_IS_DEVELOPER
}

type Member {
  """"""
  id: ID!

  """"""
  name: String!
}

type Graph {
  """"""
  id: ID!

  """"""
  name: String!

  """"""
  version: String!

  """Is this appearing on a selection of hosts?"""
  host: String!

  """"""
  elements: [Element!]!

  """"""
  codes: [DeviceCode!]!
}

type Element {
  """"""
  id: ID!

  """"""
  graph: Graph!

  """"""
  name: String!
  values: GenericScalar
}

"""
The `GenericScalar` scalar type represents a generic
GraphQL scalar value that could be:
String, Boolean, Int, Float, List or Object.
"""
scalar GenericScalar

type DeviceCode {
  """"""
  id: ID!

  """"""
  createdAt: DateTime!

  """"""
  code: String!

  """"""
  user: User

  """"""
  name: String

  """"""
  version: String

  """"""
  identifier: String
  scopes: GenericScalar

  """"""
  graph: Graph

  """"""
  logo: String
}

"""The root Mutation"""
type Mutation {
  deleteApplication(
    """The ID of the application"""
    clientId: ID!
  ): DeleteApplicationResult
  createApplication(
    """The Grant Type"""
    grantType: GrantType!

    """The Name of this Application"""
    name: String!

    """Available Redirect Uris for this Grant (required for implicit)"""
    redirectUris: [String]
  ): Application
  createUserLoginApp(
    """The Name of this Application"""
    name: String!

    """Available Redirect Uris for this Grant (required for code)"""
    redirectUris: [String]
  ): Application
  createUserApp(
    """The Identifier of this Application"""
    identifier: String!

    """The Name of this Application"""
    name: String!

    """The Version of this Application"""
    version: String!
  ): CreatedBackendApp
  changeMe(email: Email, firstName: String, lastName: String): User
  updateUser(active: Boolean, avatar: Upload, email: Email, firstName: String, id: ID!, lastName: String): User
  updateGroup(
    avatar: Upload
    id: ID!

    """The name of the group (non unique)"""
    name: String
  ): Group
  deleteChannel(
    """The ID of the application"""
    token: String!
  ): DeleteChannelResult
  createChannel(
    """The channel you want to create or update"""
    name: String

    """The expo token"""
    token: String!
  ): Channel
  publishToChannel(channel: ID!, message: String!, title: String!): PublishResult
  notifyUser(channels: [String], message: String!, title: String!, user: ID!): [PublishResult]

  """
  Create an Comment
  
      This mutation creates a comment. It takes a commentable_id and a commentable_type.
      If this is the first comment on the commentable, it will create a new comment thread.
      If there is already a comment thread, it will add the comment to the thread (by setting
      it's parent to the last parent comment in the thread).
  
      CreateComment takes a list of Descendents, which are the comment tree. The Descendents
      are a recursive structure, where each Descendent can have a list of Descendents as children.
      The Descendents are either a Leaf, which is a text node, or a MentionDescendent, which is a
      reference to another user on the platform.
  
      Please convert your comment tree to a list of Descendents before sending it to the server.
      TODO: Add a converter from a comment tree to a list of Descendents.
  
  
      (only signed in users)
  """
  createComment(
    """The comment tree"""
    descendents: [DescendendInput]!

    """The commentable identifier"""
    identifier: String!

    """Should we notify the mentioned users?"""
    notifyMentions: Boolean

    """The Representationss this sROI belongs to"""
    object: ID!

    """The parent comment"""
    parent: ID
  ): Comment

  """
  Reply to an Comment
  
      This mutation creates a comment. It takes a commentable_id and a commentable_type.
      If this is the first comment on the commentable, it will create a new comment thread.
      If there is already a comment thread, it will add the comment to the thread (by setting
      it's parent to the last parent comment in the thread).
  
      CreateComment takes a list of Descendents, which are the comment tree. The Descendents
      are a recursive structure, where each Descendent can have a list of Descendents as children.
      The Descendents are either a Leaf, which is a text node, or a MentionDescendent, which is a
      reference to another user on the platform.
  
      Please convert your comment tree to a list of Descendents before sending it to the server.
      TODO: Add a converter from a comment tree to a list of Descendents.
  
  
      (only signed in users)
  """
  replyTo(
    """The comment tree"""
    descendents: [DescendendInput]!

    """The parent comment"""
    parent: ID!
  ): Comment

  """
  Create an Comment
  
      This mutation resolves a comment. By resolving a comment, it will be marked as resolved,
      and the user that resolved it will be set as the resolver.
  
      (only signed in users)
  """
  resolveComment(
    """The comments id"""
    id: ID!

    """
    Should we imitate the resolving by another user (requires imitate permission)
    """
    imitate: ID
  ): Comment
  createPrivateClient(
    """The Name of this Elemet"""
    identifier: String!

    """The ID of the User to imitate (only managers can do this)"""
    imitate: ID

    """The Logo of this Apps"""
    logoUrl: String

    """A list of potential scopes for this app"""
    scopes: [String]!

    """The Repo of the Docker (Repo on Dockerhub)"""
    version: String!
  ): Client
  createPublicClient(
    """The Name of this Elemet"""
    identifier: String!

    """The kind of this app"""
    kind: PublicFaktType!

    """The Logo of this Apps"""
    logoUrl: String

    """A list of potential redirects for this app"""
    redirectUris: [String]!

    """A list of potential scopes for this app"""
    scopes: [String]!

    """The Repo of the Docker (Repo on Dockerhub)"""
    version: String!
  ): Client
  deleteClient(
    """The ID of the application"""
    id: ID!
  ): DeleteClientResult
  updateApp(
    """The id of the app"""
    id: ID!

    """The Logo of this Apps"""
    logo: Upload
  ): App
  createLinker(
    """The Filters of this Elemet"""
    filters: [FilterInput]!

    """The Repo of the Docker (Repo on Dockerhub)"""
    name: String!

    """The Priority of this Elemet"""
    priority: Int!

    """The Repo of the Docker (Repo on Dockerhub)"""
    template: ID!
  ): Linker
  deleteLinker(
    """The ID of the application"""
    id: ID!
  ): DeleteLinkerResult
  createConfiguration(
    """The Name of this Elemet"""
    body: String!

    """The Repo of the Docker (Repo on Dockerhub)"""
    name: String!
  ): Configuration
  deleteConfiguration(
    """The ID of the application"""
    id: ID!
  ): DeleteConfigurationResult
  createElement(
    """The Repo of the Docker (Repo on Dockerhub)"""
    graph: ID!

    """The Name of this Elemet"""
    name: String!

    """The configuraiton"""
    values: Config!
  ): Element
  createGraph(
    """The Name of this Elemet"""
    name: String!
  ): Graph
}

type DeleteApplicationResult {
  clientId: ID
}

enum GrantType {
  CLIENT_CREDENTIALS
  IMPLICIT
  PASSWORD
  AUTHORIZATION_CODE
}

type CreatedBackendApp {
  clientSecret: String
  clientId: String
}

scalar Email

"""
Create scalar that ignores normal serialization/deserialization, since
that will be handled by the multipart request spec
"""
scalar Upload

type DeleteChannelResult {
  token: String
}

type PublishResult {
  channel: Channel
  status: String
}

input DescendendInput {
  children: [DescendendInput]

  """The type of the descendent"""
  kind: DescendendKind

  """The user that is mentioned"""
  user: String

  """Is this a bold leaf?"""
  bold: Boolean

  """Is this a italic leaf?"""
  italic: Boolean

  """Is this a code leaf?"""
  code: Boolean

  """The text of the leaf"""
  text: String
}

"""The kind of the comment"""
enum DescendendKind {
  MENTION
  PARAGRAPH
  LEAF
}

enum PublicFaktType {
  DEKSTOP
  WEBSITE
}

type DeleteClientResult {
  id: ID
}

input FilterInput {
  method: FilterMethod!
  value: String!
}

type DeleteLinkerResult {
  id: ID
}

type DeleteConfigurationResult {
  id: ID
}

"""The configuration"""
scalar Config

"""The root Subscriptions"""
type Subscription {
  "My Mentions\n\n    Returns an event of a new mention for the user if the user\n    was mentioned in a comment.\n    "
  mymentions(
    """The identifier of the objects you want to listen to?"""
    identifier: String
  ): MentionEvent
}

type MentionEvent {
  deleted: ID
  update: Comment
  create: Comment
}

"""A node in the comment tree"""
interface CommentNode {
  children: [Descendent]
  untypedChildren: GenericScalar
}

"""A leaf in the comment tree. Representations some sort of text"""
type Leaf implements Descendent {
  typename: String

  """Is this a bold leaf?"""
  bold: Boolean

  """Is this a italic leaf?"""
  italic: Boolean

  """Is this a code leaf?"""
  code: Boolean

  """The text of the leaf"""
  text: String
}

"""
A mention in the comment tree. This  is a reference to another user on the platform
"""
type MentionDescendent implements CommentNode & Descendent {
  children: [Descendent]
  untypedChildren: GenericScalar
  typename: String

  """The user that is mentioned"""
  user: User!
}

"""
A paragraph in the comment tree. This paragraph contains other nodes (list nodes)
"""
type ParagraphDescendent implements CommentNode & Descendent {
  children: [Descendent]
  untypedChildren: GenericScalar
  typename: String

  """The size of the paragraph"""
  size: String
}