Skip to content

Instantly share code, notes, and snippets.

@kulakowka
Created November 24, 2018 21:13
Show Gist options
  • Save kulakowka/0af9a73990adb5f9d06d024bb42c3f74 to your computer and use it in GitHub Desktop.
Save kulakowka/0af9a73990adb5f9d06d024bb42c3f74 to your computer and use it in GitHub Desktop.
type Query {
viewer: User
feed: [Lesson]!
file(id: ID!): File!
lesson(id: ID!): Lesson!
lessons(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): LessonConnection!
skill(id: ID!): Skill!
skills(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): SkillConnection!
user(id: ID!): User!
users(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): UserConnection!
achievements(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): AchievementConnection!
}
type Mutation {
createFeedBack(input: CreateFeedBackInput!): Boolean!
signIn(input: SignInInput!): SignInOutput!
createFile(input: CreateFileInput!): File!
updateSettings(input: UpdateSettingsInput!): User!
updateUser(input: UpdateUserInput!): User!
completeLesson(id: ID!): ID!
createLesson(input: CreateLessonInput!): [Lesson]!
updateLesson(input: UpdateLessonInput!): Lesson!
deleteLessons(ids: [ID]!): [ID]!
publishLessons(ids: [ID]!): [ID]!
unpublishLessons(ids: [ID]!): [ID]!
learnSkill(id: ID!): ID!
unlearnSkill(id: ID!): ID!
createSkill(input: CreateSkillInput!): Skill!
updateSkill(input: UpdateSkillInput!): Skill!
deleteSkills(ids: [ID]!): [ID]!
}
scalar URL
scalar DateTime
scalar JSON
scalar Email
type SkillConnection {
nodes: [Skill]!
count: Int!
}
type LessonConnection {
nodes: [Lesson]!
count: Int!
}
type AchievementConnection {
nodes: [Achievement]!
count: Int!
}
type UserConnection {
nodes: [User]!
count: Int!
}
type Achievement {
id: ID!
lesson: Lesson!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
}
type File {
id: ID!
url: URL!
filename: String
mimetype: String
encoding: String
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
}
type Skill {
id: ID!
image: File
title: String!
description: String
creator: User!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
viewerHasLearning: Boolean!
learners(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): UserConnection!
lessons(
skip: Int = 0
limit: Int = 10
order: String = "desc"
orderBy: String = "createdAt"
): LessonConnection!
}
type Lesson {
id: ID!
title: String!
image: File
video: URL!
skill: Skill
creator: User!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
publishedAt: DateTime
viewerHasCompleted: Boolean!
completionCount: Int!
}
type SignInOutput {
viewer: User!
token: String!
}
type User {
id: ID!
name: String!
photo: File
email: Email!
emailConfirmed: Boolean!
createdAt: DateTime!
updatedAt: DateTime!
deletedAt: DateTime
role: [String]!
createdLessons: LessonConnection!
completedLessons: LessonConnection!
learningSkills: SkillConnection!
}
input UpdateUserInput {
id: ID!
name: String!
photoId: ID
email: Email!
newPassword: String
role: [String]!
}
input UpdateSettingsInput {
name: String!
photoId: ID
email: Email!
password: String!
newPassword: String
}
input CreateLessonInput {
video: URL
playlist: String
skillId: ID!
}
input UpdateLessonInput {
id: ID!
title: String!
video: URL!
imageId: ID!
skillId: ID!
}
input SignInInput {
email: String!
password: String!
}
input CreateFileInput {
file: Upload!
format: String!
}
input CreateSkillInput {
title: String!
description: String!
imageId: ID!
}
input UpdateSkillInput {
id: ID!
title: String!
description: String!
imageId: ID!
}
input CreateFeedBackInput {
message: String!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment