Clean up code, make Query and Mutation more standard compliant
This commit is contained in:
parent
37af5c0412
commit
928f9027d3
|
|
@ -1,5 +1,7 @@
|
||||||
|
export const SELECTED_CLASS_ID = 987;
|
||||||
|
export const SELECTED_CLASS_ID_ENCODED = btoa(`SchoolClassNode:${SELECTED_CLASS_ID}`);
|
||||||
const selectedClass = {
|
const selectedClass = {
|
||||||
id: btoa('SchoolClassNode:selectedClassId'),
|
id: SELECTED_CLASS_ID_ENCODED,
|
||||||
name: 'Moordale',
|
name: 'Moordale',
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
code: 'XXXX',
|
code: 'XXXX',
|
||||||
|
|
@ -100,7 +102,7 @@ export default {
|
||||||
appearance: 'blue',
|
appearance: 'blue',
|
||||||
description: 'A Room description',
|
description: 'A Room description',
|
||||||
schoolClass: {
|
schoolClass: {
|
||||||
id: 'selectedClassId',
|
id: SELECTED_CLASS_ID_ENCODED,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
RoomEntryNode: () => ({
|
RoomEntryNode: () => ({
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@ describe('Objective Visibility', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display the correct objectives', () => {
|
//todo: finish writing this test, this does nothing
|
||||||
|
it.skip('should display the correct objectives', () => {
|
||||||
cy.fakeLogin('rachel.green', 'test');
|
cy.fakeLogin('rachel.green', 'test');
|
||||||
|
|
||||||
cy.visit('/module/lohn-und-budget');
|
cy.visit('/module/lohn-und-budget');
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,8 @@ describe('Project Page', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.setup();
|
cy.setup();
|
||||||
|
|
||||||
cy.task('getSchema').then(schema => {
|
cy.mockGraphqlOps({
|
||||||
cy.mockGraphqlOps({
|
operations,
|
||||||
operations,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ describe('Article page', () => {
|
||||||
slug,
|
slug,
|
||||||
id: 'room-entry-id',
|
id: 'room-entry-id',
|
||||||
title: 'Some Room Entry, yay!',
|
title: 'Some Room Entry, yay!',
|
||||||
comments: {
|
comments: [],
|
||||||
edges: [],
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const operations = {
|
const operations = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import {getMinimalMe} from '../../../support/helpers';
|
import {getMinimalMe} from '../../../support/helpers';
|
||||||
|
import {SELECTED_CLASS_ID_ENCODED} from '../../../fixtures/mocks';
|
||||||
|
|
||||||
describe('The Rooms Page', () => {
|
describe('The Rooms Page', () => {
|
||||||
const getOperations = (isTeacher) => ({
|
const getOperations = (isTeacher) => ({
|
||||||
|
|
@ -6,7 +7,7 @@ describe('The Rooms Page', () => {
|
||||||
RoomsQuery: {
|
RoomsQuery: {
|
||||||
rooms: [{
|
rooms: [{
|
||||||
schoolClass: {
|
schoolClass: {
|
||||||
id: btoa('SchoolClassNode:selectedClassId'),
|
id: SELECTED_CLASS_ID_ENCODED,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,6 @@
|
||||||
this._updateProperty(value, 'assignment');
|
this._updateProperty(value, 'assignment');
|
||||||
},
|
},
|
||||||
changeType({type, convertToList}, value) {
|
changeType({type, convertToList}, value) {
|
||||||
console.log(type, value, convertToList);
|
|
||||||
let el = {
|
let el = {
|
||||||
type: type,
|
type: type,
|
||||||
value: Object.assign({}, value),
|
value: Object.assign({}, value),
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,15 @@
|
||||||
update: (store, {data: {addProjectEntry: {projectEntry}}}) => {
|
update: (store, {data: {addProjectEntry: {projectEntry}}}) => {
|
||||||
const query = PROJECT_QUERY;
|
const query = PROJECT_QUERY;
|
||||||
const variables = {slug: this.slug};
|
const variables = {slug: this.slug};
|
||||||
const data = store.readQuery({query, variables});
|
const {project} = store.readQuery({query, variables});
|
||||||
if (data.project && data.project.entries) {
|
if (project) {
|
||||||
data.project.entries.push(projectEntry);
|
const entries = [...project.entries, projectEntry];
|
||||||
|
const data = {
|
||||||
|
project: {
|
||||||
|
...project,
|
||||||
|
entries
|
||||||
|
}
|
||||||
|
};
|
||||||
store.writeQuery({query, variables, data});
|
store.writeQuery({query, variables, data});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "@/styles/_variables.scss";
|
@import "~styles/helpers";
|
||||||
@import "@/styles/_mixins.scss";
|
|
||||||
|
|
||||||
.class-selection {
|
.class-selection {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,22 @@ const typePolicies = {
|
||||||
objective: {read: idToRefFactory('ObjectiveNode')},
|
objective: {read: idToRefFactory('ObjectiveNode')},
|
||||||
objectiveGroup: {read: idToRefFactory('ObjectiveGroupNode')},
|
objectiveGroup: {read: idToRefFactory('ObjectiveGroupNode')},
|
||||||
projectEntry: {read: idToRefFactory('ProjectEntryNode')},
|
projectEntry: {read: idToRefFactory('ProjectEntryNode')},
|
||||||
|
project: {
|
||||||
|
read(_, {args: {slug, id}, toReference}) {
|
||||||
|
console.log(`Trying to reference project with slug ${slug}, id ${id}`);
|
||||||
|
if (slug) {
|
||||||
|
return toReference({
|
||||||
|
__typename: 'ProjectNode',
|
||||||
|
slug
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return toReference({
|
||||||
|
__typename: 'ProjectNode',
|
||||||
|
id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// assignment: (_, args, {getCacheKey}) => getCacheKey({__typename: 'AssignmentNode', id: args.id}),
|
// assignment: (_, args, {getCacheKey}) => getCacheKey({__typename: 'AssignmentNode', id: args.id}),
|
||||||
// objective: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveNode', id: args.id}),
|
// objective: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveNode', id: args.id}),
|
||||||
// objectiveGroup: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveGroupNode', id: args.id}),
|
// objectiveGroup: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveGroupNode', id: args.id}),
|
||||||
|
|
@ -84,29 +100,16 @@ const cache = new InMemoryCache({
|
||||||
typePolicies,
|
typePolicies,
|
||||||
possibleTypes,
|
possibleTypes,
|
||||||
// todo: document what this does, or link the doc for it at least
|
// todo: document what this does, or link the doc for it at least
|
||||||
dataIdFromObject: obj => {
|
// dataIdFromObject: obj => {
|
||||||
switch (obj.__typename) {
|
// switch (obj.__typename) {
|
||||||
case 'InstrumentNode':
|
// case 'InstrumentNode':
|
||||||
case 'ModuleNode':
|
// case 'ModuleNode':
|
||||||
case 'RoomEntryNode':
|
// case 'RoomEntryNode':
|
||||||
return `${obj.__typename}:${obj.slug}`;
|
// return `${obj.__typename}:${obj.slug}`;
|
||||||
default:
|
// default:
|
||||||
return defaultDataIdFromObject(obj);
|
// return defaultDataIdFromObject(obj);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
// todo: document what this does, or link the doc for it at least
|
|
||||||
// todo: this is deprecated, it's now included in typePolicies
|
|
||||||
cacheRedirects: {
|
|
||||||
Query: {
|
|
||||||
project: (_, args, {getCacheKey}) => {
|
|
||||||
if (args.slug) {
|
|
||||||
return getCacheKey({__typename: 'ProjectNode', id: args.slug});
|
|
||||||
} else {
|
|
||||||
return getCacheKey({__typename: 'ProjectNode', id: args.id});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Monkey-patching in a fix for an open issue suggesting that
|
// TODO: Monkey-patching in a fix for an open issue suggesting that
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,8 @@ query OldClassesQuery {
|
||||||
me {
|
me {
|
||||||
id
|
id
|
||||||
oldClasses {
|
oldClasses {
|
||||||
edges {
|
id
|
||||||
node {
|
name
|
||||||
id
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,15 @@ import PROJECT_QUERY from '@/graphql/gql/queries/projectQuery.gql';
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
updateProjectShareState(id, shared) {
|
updateProjectShareState(id, shared) {
|
||||||
|
const input = {
|
||||||
|
id: id,
|
||||||
|
shared,
|
||||||
|
};
|
||||||
|
this.$log.debug('updateProjectShareState', input);
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: UPDATE_PROJECT_SHARED_STATE_MUTATION,
|
mutation: UPDATE_PROJECT_SHARED_STATE_MUTATION,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input,
|
||||||
id: id,
|
|
||||||
shared,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
update(store, {data: {updateProjectSharedState: {shared: final, errors}}}) {
|
update(store, {data: {updateProjectSharedState: {shared: final, errors}}}) {
|
||||||
if (!errors) {
|
if (!errors) {
|
||||||
|
|
@ -19,6 +21,7 @@ export default {
|
||||||
id: id,
|
id: id,
|
||||||
};
|
};
|
||||||
const {project} = store.readQuery({query, variables});
|
const {project} = store.readQuery({query, variables});
|
||||||
|
this.$log.debug(`updating project ${project.id} ${project.title}`);
|
||||||
|
|
||||||
if (project) {
|
if (project) {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
|
||||||
|
|
@ -75,13 +75,16 @@
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
createComment(text) {
|
createComment(text) {
|
||||||
|
this.$log.debug(`createComment ${text}`);
|
||||||
|
const input = {
|
||||||
|
roomEntry: this.roomEntry.id,
|
||||||
|
comment: text,
|
||||||
|
};
|
||||||
|
this.$log.debug(`input `, input);
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: ADD_COMMENT_MUTATION,
|
mutation: ADD_COMMENT_MUTATION,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input,
|
||||||
roomEntry: this.roomEntry.id,
|
|
||||||
comment: text,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
update: (store, {data: {addComment: {success, comment}}}) => {
|
update: (store, {data: {addComment: {success, comment}}}) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,6 @@
|
||||||
}
|
}
|
||||||
]},
|
]},
|
||||||
}),
|
}),
|
||||||
mounted() {
|
|
||||||
// this.addBlock(0);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
update(index, element, parent) {
|
update(index, element, parent) {
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ from users.schema import AllUsersQuery, UsersQuery
|
||||||
from users.mutations import ProfileMutations
|
from users.mutations import ProfileMutations
|
||||||
|
|
||||||
|
|
||||||
class CustomQuery(UsersQuery, AllUsersQuery, ModuleRoomsQuery, RoomsQuery, ObjectivesQuery, BookQuery, AssignmentsQuery,
|
class Query(UsersQuery, AllUsersQuery, ModuleRoomsQuery, RoomsQuery, ObjectivesQuery, BookQuery, AssignmentsQuery,
|
||||||
StudentSubmissionQuery, InstrumentQuery, PortfolioQuery, SurveysQuery, AllNewsTeasersQuery, graphene.ObjectType):
|
StudentSubmissionQuery, InstrumentQuery, PortfolioQuery, SurveysQuery, AllNewsTeasersQuery, graphene.ObjectType):
|
||||||
node = relay.Node.Field()
|
node = relay.Node.Field()
|
||||||
|
|
||||||
|
|
@ -34,11 +34,11 @@ class CustomQuery(UsersQuery, AllUsersQuery, ModuleRoomsQuery, RoomsQuery, Objec
|
||||||
debug = graphene.Field(DjangoDebug, name='_debug')
|
debug = graphene.Field(DjangoDebug, name='_debug')
|
||||||
|
|
||||||
|
|
||||||
class CustomMutation(BookMutations, RoomMutations, AssignmentMutations, ObjectiveMutations, OauthMutations,
|
class Mutation(BookMutations, RoomMutations, AssignmentMutations, ObjectiveMutations, OauthMutations,
|
||||||
PortfolioMutations, ProfileMutations, SurveyMutations, NoteMutations, SpellCheckMutations,
|
PortfolioMutations, ProfileMutations, SurveyMutations, NoteMutations, SpellCheckMutations,
|
||||||
graphene.ObjectType):
|
graphene.ObjectType):
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
debug = graphene.Field(DjangoDebug, name='_debug')
|
debug = graphene.Field(DjangoDebug, name='_debug')
|
||||||
|
|
||||||
|
|
||||||
schema = graphene.Schema(query=CustomQuery, mutation=CustomMutation)
|
schema = graphene.Schema(query=Query, mutation=Mutation)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
schema {
|
schema {
|
||||||
query: CustomQuery
|
query: Query
|
||||||
mutation: CustomMutation
|
mutation: Mutation
|
||||||
}
|
}
|
||||||
|
|
||||||
input AddCommentInput {
|
input AddCommentInput {
|
||||||
|
|
@ -381,99 +381,6 @@ type CreateTeamPayload {
|
||||||
clientMutationId: String
|
clientMutationId: String
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomMutation {
|
|
||||||
spellCheck(input: SpellCheckInput!): SpellCheckPayload
|
|
||||||
addNote(input: AddNoteInput!): AddNotePayload
|
|
||||||
updateNote(input: UpdateNoteInput!): UpdateNotePayload
|
|
||||||
updateContentBookmark(input: UpdateContentBookmarkInput!): UpdateContentBookmarkPayload
|
|
||||||
updateChapterBookmark(input: UpdateChapterBookmarkInput!): UpdateChapterBookmarkPayload
|
|
||||||
updateModuleBookmark(input: UpdateModuleBookmarkInput!): UpdateModuleBookmarkPayload
|
|
||||||
updateInstrumentBookmark(input: UpdateInstrumentBookmarkInput!): UpdateInstrumentBookmarkPayload
|
|
||||||
updateAnswer(input: UpdateAnswerInput!): UpdateAnswerPayload
|
|
||||||
updatePassword(input: UpdatePasswordInput!): UpdatePasswordPayload
|
|
||||||
updateAvatar(input: UpdateAvatarInput!): UpdateAvatarPayload
|
|
||||||
updateSetting(input: UpdateSettingInput!): UpdateSettingPayload
|
|
||||||
joinClass(input: JoinClassInput!): JoinClassPayload
|
|
||||||
addRemoveMember(input: AddRemoveMemberInput!): AddRemoveMemberPayload
|
|
||||||
updateSchoolClass(input: UpdateSchoolClassInput!): UpdateSchoolClassPayload
|
|
||||||
createSchoolClass(input: CreateSchoolClassInput!): CreateSchoolClassPayload
|
|
||||||
updateOnboardingProgress: UpdateOnboardingProgress
|
|
||||||
createTeam(input: CreateTeamInput!): CreateTeamPayload
|
|
||||||
joinTeam(input: JoinTeamInput!): JoinTeamPayload
|
|
||||||
updateTeam(input: UpdateTeamInput!): UpdateTeamPayload
|
|
||||||
leaveTeam: LeaveTeam
|
|
||||||
addProject(input: AddProjectInput!): AddProjectPayload
|
|
||||||
updateProject(input: UpdateProjectInput!): UpdateProjectPayload
|
|
||||||
deleteProject(input: DeleteProjectInput!): DeleteProjectPayload
|
|
||||||
addProjectEntry(input: AddProjectEntryInput!): AddProjectEntryPayload
|
|
||||||
updateProjectEntry(input: UpdateProjectEntryInput!): UpdateProjectEntryPayload
|
|
||||||
deleteProjectEntry(input: DeleteProjectEntryInput!): DeleteProjectEntryPayload
|
|
||||||
updateProjectSharedState(input: UpdateProjectSharedStateInput!): UpdateProjectSharedStatePayload
|
|
||||||
logout: Logout
|
|
||||||
coupon(input: CouponInput!): CouponPayload
|
|
||||||
updateObjectiveVisibility(input: UpdateObjectiveVisibilityInput!): UpdateObjectiveVisibilityPayload
|
|
||||||
updateObjectiveGroupVisibility(input: UpdateObjectiveGroupVisibilityInput!): UpdateObjectiveGroupVisibilityPayload
|
|
||||||
addObjective(input: AddObjectiveInput!): AddObjectivePayload
|
|
||||||
deleteObjective(input: DeleteObjectiveInput!): DeleteObjectivePayload
|
|
||||||
updateAssignment(input: UpdateAssignmentInput!): UpdateAssignmentPayload
|
|
||||||
updateSubmissionFeedback(input: UpdateSubmissionFeedbackInput!): UpdateSubmissionFeedbackPayload
|
|
||||||
updateRoom(input: UpdateRoomInput!): UpdateRoomPayload
|
|
||||||
addRoom(input: AddRoomInput!): AddRoomPayload
|
|
||||||
deleteRoom(input: DeleteRoomInput!): DeleteRoomPayload
|
|
||||||
addRoomEntry(input: AddRoomEntryInput!): AddRoomEntryPayload
|
|
||||||
deleteRoomEntry(input: DeleteRoomEntryInput!): DeleteRoomEntryPayload
|
|
||||||
updateRoomEntry(input: UpdateRoomEntryInput!): UpdateRoomEntryPayload
|
|
||||||
addComment(input: AddCommentInput!): AddCommentPayload
|
|
||||||
updateRoomVisibility(input: UpdateRoomVisibilityInput!): UpdateRoomVisibilityPayload
|
|
||||||
mutateContentBlock(input: MutateContentBlockInput!): MutateContentBlockPayload
|
|
||||||
addContentBlock(input: AddContentBlockInput!): AddContentBlockPayload
|
|
||||||
deleteContentBlock(input: DeleteContentBlockInput!): DeleteContentBlockPayload
|
|
||||||
updateSolutionVisibility(input: UpdateSolutionVisibilityInput!): UpdateSolutionVisibilityPayload
|
|
||||||
updateLastModule(input: UpdateLastModuleInput!): UpdateLastModulePayload
|
|
||||||
updateLastTopic(input: UpdateLastTopicInput!): UpdateLastTopicPayload
|
|
||||||
updateChapterVisibility(input: UpdateChapterVisibilityInput!): UpdateChapterVisibilityPayload
|
|
||||||
syncModuleVisibility(input: SyncModuleVisibilityInput!): SyncModuleVisibilityPayload
|
|
||||||
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload
|
|
||||||
applySnapshot(input: ApplySnapshotInput!): ApplySnapshotPayload
|
|
||||||
shareSnapshot(input: ShareSnapshotInput!): ShareSnapshotPayload
|
|
||||||
_debug: DjangoDebug
|
|
||||||
}
|
|
||||||
|
|
||||||
type CustomQuery {
|
|
||||||
newsTeasers(offset: Int, before: String, after: String, first: Int, last: Int, date: Date): NewsTeaserNodeConnection
|
|
||||||
survey(id: ID): SurveyNode
|
|
||||||
surveys(offset: Int, before: String, after: String, first: Int, last: Int): SurveyNodeConnection
|
|
||||||
project(id: ID, slug: String): ProjectNode
|
|
||||||
projects: [ProjectNode]
|
|
||||||
instrument(slug: String, id: ID): InstrumentNode
|
|
||||||
instruments: [InstrumentNode]
|
|
||||||
instrumentTypes: [InstrumentTypeNode]
|
|
||||||
studentSubmission(id: ID!): StudentSubmissionNode
|
|
||||||
assignment(id: ID!): AssignmentNode
|
|
||||||
assignments(offset: Int, before: String, after: String, first: Int, last: Int): AssignmentNodeConnection
|
|
||||||
node(id: ID!): Node
|
|
||||||
topic(slug: String): TopicNode
|
|
||||||
module(slug: String, id: ID): ModuleNode
|
|
||||||
chapter(id: ID!): ChapterNode
|
|
||||||
contentBlock(id: ID!): ContentBlockNode
|
|
||||||
snapshot(id: ID!): SnapshotNode
|
|
||||||
topics(before: String, after: String, first: Int, last: Int): TopicConnection
|
|
||||||
modules(before: String, after: String, first: Int, last: Int): ModuleConnection
|
|
||||||
chapters(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection
|
|
||||||
objectiveGroup(id: ID!): ObjectiveGroupNode
|
|
||||||
objectiveGroups(offset: Int, before: String, after: String, first: Int, last: Int, title: String, module_Slug: String): ObjectiveGroupNodeConnection
|
|
||||||
roomEntry(id: ID, slug: String): RoomEntryNode
|
|
||||||
room(slug: String, id: ID, appearance: String): RoomNode
|
|
||||||
rooms: [RoomNode]
|
|
||||||
allRoomEntries(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): RoomEntryNodeConnection
|
|
||||||
moduleRoom(slug: String, classId: ID): RoomNode
|
|
||||||
me: PrivateUserNode
|
|
||||||
allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection
|
|
||||||
myActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection
|
|
||||||
myInstrumentActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): InstrumentNodeConnection
|
|
||||||
_debug: DjangoDebug
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar Date
|
scalar Date
|
||||||
|
|
||||||
scalar DateTime
|
scalar DateTime
|
||||||
|
|
@ -724,6 +631,64 @@ type MutateContentBlockPayload {
|
||||||
clientMutationId: String
|
clientMutationId: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Mutation {
|
||||||
|
spellCheck(input: SpellCheckInput!): SpellCheckPayload
|
||||||
|
addNote(input: AddNoteInput!): AddNotePayload
|
||||||
|
updateNote(input: UpdateNoteInput!): UpdateNotePayload
|
||||||
|
updateContentBookmark(input: UpdateContentBookmarkInput!): UpdateContentBookmarkPayload
|
||||||
|
updateChapterBookmark(input: UpdateChapterBookmarkInput!): UpdateChapterBookmarkPayload
|
||||||
|
updateModuleBookmark(input: UpdateModuleBookmarkInput!): UpdateModuleBookmarkPayload
|
||||||
|
updateInstrumentBookmark(input: UpdateInstrumentBookmarkInput!): UpdateInstrumentBookmarkPayload
|
||||||
|
updateAnswer(input: UpdateAnswerInput!): UpdateAnswerPayload
|
||||||
|
updatePassword(input: UpdatePasswordInput!): UpdatePasswordPayload
|
||||||
|
updateAvatar(input: UpdateAvatarInput!): UpdateAvatarPayload
|
||||||
|
updateSetting(input: UpdateSettingInput!): UpdateSettingPayload
|
||||||
|
joinClass(input: JoinClassInput!): JoinClassPayload
|
||||||
|
addRemoveMember(input: AddRemoveMemberInput!): AddRemoveMemberPayload
|
||||||
|
updateSchoolClass(input: UpdateSchoolClassInput!): UpdateSchoolClassPayload
|
||||||
|
createSchoolClass(input: CreateSchoolClassInput!): CreateSchoolClassPayload
|
||||||
|
updateOnboardingProgress: UpdateOnboardingProgress
|
||||||
|
createTeam(input: CreateTeamInput!): CreateTeamPayload
|
||||||
|
joinTeam(input: JoinTeamInput!): JoinTeamPayload
|
||||||
|
updateTeam(input: UpdateTeamInput!): UpdateTeamPayload
|
||||||
|
leaveTeam: LeaveTeam
|
||||||
|
addProject(input: AddProjectInput!): AddProjectPayload
|
||||||
|
updateProject(input: UpdateProjectInput!): UpdateProjectPayload
|
||||||
|
deleteProject(input: DeleteProjectInput!): DeleteProjectPayload
|
||||||
|
addProjectEntry(input: AddProjectEntryInput!): AddProjectEntryPayload
|
||||||
|
updateProjectEntry(input: UpdateProjectEntryInput!): UpdateProjectEntryPayload
|
||||||
|
deleteProjectEntry(input: DeleteProjectEntryInput!): DeleteProjectEntryPayload
|
||||||
|
updateProjectSharedState(input: UpdateProjectSharedStateInput!): UpdateProjectSharedStatePayload
|
||||||
|
logout: Logout
|
||||||
|
coupon(input: CouponInput!): CouponPayload
|
||||||
|
updateObjectiveVisibility(input: UpdateObjectiveVisibilityInput!): UpdateObjectiveVisibilityPayload
|
||||||
|
updateObjectiveGroupVisibility(input: UpdateObjectiveGroupVisibilityInput!): UpdateObjectiveGroupVisibilityPayload
|
||||||
|
addObjective(input: AddObjectiveInput!): AddObjectivePayload
|
||||||
|
deleteObjective(input: DeleteObjectiveInput!): DeleteObjectivePayload
|
||||||
|
updateAssignment(input: UpdateAssignmentInput!): UpdateAssignmentPayload
|
||||||
|
updateSubmissionFeedback(input: UpdateSubmissionFeedbackInput!): UpdateSubmissionFeedbackPayload
|
||||||
|
updateRoom(input: UpdateRoomInput!): UpdateRoomPayload
|
||||||
|
addRoom(input: AddRoomInput!): AddRoomPayload
|
||||||
|
deleteRoom(input: DeleteRoomInput!): DeleteRoomPayload
|
||||||
|
addRoomEntry(input: AddRoomEntryInput!): AddRoomEntryPayload
|
||||||
|
deleteRoomEntry(input: DeleteRoomEntryInput!): DeleteRoomEntryPayload
|
||||||
|
updateRoomEntry(input: UpdateRoomEntryInput!): UpdateRoomEntryPayload
|
||||||
|
addComment(input: AddCommentInput!): AddCommentPayload
|
||||||
|
updateRoomVisibility(input: UpdateRoomVisibilityInput!): UpdateRoomVisibilityPayload
|
||||||
|
mutateContentBlock(input: MutateContentBlockInput!): MutateContentBlockPayload
|
||||||
|
addContentBlock(input: AddContentBlockInput!): AddContentBlockPayload
|
||||||
|
deleteContentBlock(input: DeleteContentBlockInput!): DeleteContentBlockPayload
|
||||||
|
updateSolutionVisibility(input: UpdateSolutionVisibilityInput!): UpdateSolutionVisibilityPayload
|
||||||
|
updateLastModule(input: UpdateLastModuleInput!): UpdateLastModulePayload
|
||||||
|
updateLastTopic(input: UpdateLastTopicInput!): UpdateLastTopicPayload
|
||||||
|
updateChapterVisibility(input: UpdateChapterVisibilityInput!): UpdateChapterVisibilityPayload
|
||||||
|
syncModuleVisibility(input: SyncModuleVisibilityInput!): SyncModuleVisibilityPayload
|
||||||
|
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload
|
||||||
|
applySnapshot(input: ApplySnapshotInput!): ApplySnapshotPayload
|
||||||
|
shareSnapshot(input: ShareSnapshotInput!): ShareSnapshotPayload
|
||||||
|
_debug: DjangoDebug
|
||||||
|
}
|
||||||
|
|
||||||
type NewsTeaserNode implements Node {
|
type NewsTeaserNode implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
imageUrl: String
|
imageUrl: String
|
||||||
|
|
@ -839,7 +804,7 @@ type PrivateUserNode implements Node {
|
||||||
selectedClass: SchoolClassNode
|
selectedClass: SchoolClassNode
|
||||||
expiryDate: String
|
expiryDate: String
|
||||||
isTeacher: Boolean
|
isTeacher: Boolean
|
||||||
oldClasses(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection
|
oldClasses: [SchoolClassNode]
|
||||||
recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection
|
recentModules(offset: Int, before: String, after: String, first: Int, last: Int, recentModules: [ID], orderBy: String): ModuleNodeConnection
|
||||||
readOnly: Boolean
|
readOnly: Boolean
|
||||||
}
|
}
|
||||||
|
|
@ -887,6 +852,41 @@ type PublicUserNode implements Node {
|
||||||
isMe: Boolean
|
isMe: Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Query {
|
||||||
|
newsTeasers(offset: Int, before: String, after: String, first: Int, last: Int, date: Date): NewsTeaserNodeConnection
|
||||||
|
survey(id: ID): SurveyNode
|
||||||
|
surveys(offset: Int, before: String, after: String, first: Int, last: Int): SurveyNodeConnection
|
||||||
|
project(id: ID, slug: String): ProjectNode
|
||||||
|
projects: [ProjectNode]
|
||||||
|
instrument(slug: String, id: ID): InstrumentNode
|
||||||
|
instruments: [InstrumentNode]
|
||||||
|
instrumentTypes: [InstrumentTypeNode]
|
||||||
|
studentSubmission(id: ID!): StudentSubmissionNode
|
||||||
|
assignment(id: ID!): AssignmentNode
|
||||||
|
assignments(offset: Int, before: String, after: String, first: Int, last: Int): AssignmentNodeConnection
|
||||||
|
node(id: ID!): Node
|
||||||
|
topic(slug: String): TopicNode
|
||||||
|
module(slug: String, id: ID): ModuleNode
|
||||||
|
chapter(id: ID!): ChapterNode
|
||||||
|
contentBlock(id: ID!): ContentBlockNode
|
||||||
|
snapshot(id: ID!): SnapshotNode
|
||||||
|
topics(before: String, after: String, first: Int, last: Int): TopicConnection
|
||||||
|
modules(before: String, after: String, first: Int, last: Int): ModuleConnection
|
||||||
|
chapters(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ChapterNodeConnection
|
||||||
|
objectiveGroup(id: ID!): ObjectiveGroupNode
|
||||||
|
objectiveGroups(offset: Int, before: String, after: String, first: Int, last: Int, title: String, module_Slug: String): ObjectiveGroupNodeConnection
|
||||||
|
roomEntry(id: ID, slug: String): RoomEntryNode
|
||||||
|
room(slug: String, id: ID, appearance: String): RoomNode
|
||||||
|
rooms: [RoomNode]
|
||||||
|
allRoomEntries(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): RoomEntryNodeConnection
|
||||||
|
moduleRoom(slug: String, classId: ID): RoomNode
|
||||||
|
me: PrivateUserNode
|
||||||
|
allUsers(offset: Int, before: String, after: String, first: Int, last: Int, username: String, email: String): PrivateUserNodeConnection
|
||||||
|
myActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, slug_Icontains: String, slug_In: [String], title: String, title_Icontains: String, title_In: [String]): ModuleNodeConnection
|
||||||
|
myInstrumentActivity(offset: Int, before: String, after: String, first: Int, last: Int, slug: String): InstrumentNodeConnection
|
||||||
|
_debug: DjangoDebug
|
||||||
|
}
|
||||||
|
|
||||||
type RoomEntryNode implements Node {
|
type RoomEntryNode implements Node {
|
||||||
title: String!
|
title: String!
|
||||||
description: String
|
description: String
|
||||||
|
|
@ -937,16 +937,6 @@ type SchoolClassNode implements Node {
|
||||||
readOnly: Boolean
|
readOnly: Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
type SchoolClassNodeConnection {
|
|
||||||
pageInfo: PageInfo!
|
|
||||||
edges: [SchoolClassNodeEdge]!
|
|
||||||
}
|
|
||||||
|
|
||||||
type SchoolClassNodeEdge {
|
|
||||||
node: SchoolClassNode
|
|
||||||
cursor: String!
|
|
||||||
}
|
|
||||||
|
|
||||||
input ShareSnapshotInput {
|
input ShareSnapshotInput {
|
||||||
snapshot: ID!
|
snapshot: ID!
|
||||||
shared: Boolean!
|
shared: Boolean!
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,8 @@ class PrivateUserNode(DjangoObjectType):
|
||||||
selected_class = graphene.Field(SchoolClassNode)
|
selected_class = graphene.Field(SchoolClassNode)
|
||||||
expiry_date = graphene.String()
|
expiry_date = graphene.String()
|
||||||
is_teacher = graphene.Boolean()
|
is_teacher = graphene.Boolean()
|
||||||
old_classes = DjangoFilterConnectionField(SchoolClassNode)
|
old_classes = graphene.List(SchoolClassNode)
|
||||||
school_classes =graphene.List(SchoolClassNode)
|
school_classes = graphene.List(SchoolClassNode)
|
||||||
recent_modules = DjangoFilterConnectionField(ModuleNode, filterset_class=RecentModuleFilter)
|
recent_modules = DjangoFilterConnectionField(ModuleNode, filterset_class=RecentModuleFilter)
|
||||||
team = graphene.Field(TeamNode)
|
team = graphene.Field(TeamNode)
|
||||||
read_only = graphene.Boolean()
|
read_only = graphene.Boolean()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue