88 lines
1.5 KiB
GraphQL
88 lines
1.5 KiB
GraphQL
type Comment {
|
|
id: String!
|
|
content: String!
|
|
createdAt: Date!
|
|
userId: String!
|
|
}
|
|
|
|
type CommentCollection {
|
|
items: [Comment!]!
|
|
cursor: String
|
|
totalCount: Int!
|
|
}
|
|
|
|
type Resource {
|
|
id: String!
|
|
name: String!
|
|
createdAt: DateTime!
|
|
comments(limit: Int! = 10, cursor: String = null): CommentCollection!
|
|
}
|
|
|
|
type ResourceCollection {
|
|
items: [Resource!]!
|
|
cursor: String
|
|
totalCount: Int!
|
|
}
|
|
|
|
type User {
|
|
id: String!
|
|
name: String!
|
|
resources(limit: Int! = 10, cursor: String = null): ResourceCollection!
|
|
}
|
|
|
|
type Organization {
|
|
id: String!
|
|
name: String!
|
|
}
|
|
|
|
type Region {
|
|
id: String!
|
|
name: String!
|
|
}
|
|
|
|
type Query {
|
|
user(id: String!): User
|
|
users: [User!]
|
|
|
|
resource(id: String!, userId: String!): Resource
|
|
|
|
organizations: [Organization!]
|
|
regions: [Region!]
|
|
}
|
|
|
|
input ResourceCreateInput {
|
|
userId: String!
|
|
name: String!
|
|
organizationId: String = null
|
|
regionId: String = null
|
|
}
|
|
|
|
input OrganizationAcl {
|
|
userId: String!
|
|
organizationId: String!
|
|
}
|
|
|
|
input CommentInput {
|
|
userId: String!
|
|
content: String!
|
|
resourceId: String!
|
|
}
|
|
|
|
input UserCreateArgs {
|
|
name: String!
|
|
}
|
|
|
|
type Mutation {
|
|
createUser(input: UserCreateArgs!): String!
|
|
registerRegion(
|
|
name: String!
|
|
connectionString: String!
|
|
sslCaCert: String
|
|
): String!
|
|
createOrganization(name: String!): String!
|
|
addRegionToOrganization(organizationId: String!, regionId: String!): Boolean
|
|
addUserToOrganization(input: OrganizationAcl!): Boolean
|
|
createResource(input: ResourceCreateInput!): String!
|
|
addComment(input: CommentInput!): String!
|
|
}
|