63 lines
854 B
GraphQL
63 lines
854 B
GraphQL
enum Role {
|
|
STUDENT
|
|
TEACHER
|
|
}
|
|
|
|
input UserQueryInput {
|
|
email: String
|
|
name: String
|
|
id: ID
|
|
role: Role
|
|
}
|
|
|
|
type AuthMethod {
|
|
provider: String
|
|
email: String
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
roles: [Role!]
|
|
name: String
|
|
emails: [String!]!
|
|
emailsOrNull: [String!]
|
|
emailsWithNulls: [String]!
|
|
emailsWithNullsOrNull: [String]
|
|
authMethods: [AuthMethod!]!
|
|
}
|
|
|
|
interface Content {
|
|
id: ID!
|
|
name: String!
|
|
parent: Topic
|
|
}
|
|
|
|
union LeafContent = Article | Video
|
|
|
|
type Article implements Content {
|
|
id: ID!
|
|
name: String!
|
|
parent: Topic!
|
|
text: String!
|
|
}
|
|
|
|
type Video implements Content {
|
|
id: ID!
|
|
name: String!
|
|
parent: Topic!
|
|
duration: Int!
|
|
}
|
|
|
|
type Topic implements Content {
|
|
id: ID!
|
|
name: String!
|
|
parent: Topic
|
|
children: [Content!]!
|
|
}
|
|
|
|
type Query {
|
|
user(query: UserQueryInput): User
|
|
root: Topic!
|
|
randomLeaf: LeafContent!
|
|
}
|