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 = {
|
||||
id: btoa('SchoolClassNode:selectedClassId'),
|
||||
id: SELECTED_CLASS_ID_ENCODED,
|
||||
name: 'Moordale',
|
||||
readOnly: false,
|
||||
code: 'XXXX',
|
||||
|
|
@ -100,7 +102,7 @@ export default {
|
|||
appearance: 'blue',
|
||||
description: 'A Room description',
|
||||
schoolClass: {
|
||||
id: 'selectedClassId',
|
||||
id: SELECTED_CLASS_ID_ENCODED,
|
||||
},
|
||||
}),
|
||||
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.visit('/module/lohn-und-budget');
|
||||
|
|
|
|||
|
|
@ -95,10 +95,8 @@ describe('Project Page', () => {
|
|||
beforeEach(() => {
|
||||
cy.setup();
|
||||
|
||||
cy.task('getSchema').then(schema => {
|
||||
cy.mockGraphqlOps({
|
||||
operations,
|
||||
});
|
||||
cy.mockGraphqlOps({
|
||||
operations,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ describe('Article page', () => {
|
|||
slug,
|
||||
id: 'room-entry-id',
|
||||
title: 'Some Room Entry, yay!',
|
||||
comments: {
|
||||
edges: [],
|
||||
},
|
||||
comments: [],
|
||||
};
|
||||
|
||||
const operations = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import {getMinimalMe} from '../../../support/helpers';
|
||||
import {SELECTED_CLASS_ID_ENCODED} from '../../../fixtures/mocks';
|
||||
|
||||
describe('The Rooms Page', () => {
|
||||
const getOperations = (isTeacher) => ({
|
||||
|
|
@ -6,7 +7,7 @@ describe('The Rooms Page', () => {
|
|||
RoomsQuery: {
|
||||
rooms: [{
|
||||
schoolClass: {
|
||||
id: btoa('SchoolClassNode:selectedClassId'),
|
||||
id: SELECTED_CLASS_ID_ENCODED,
|
||||
},
|
||||
}],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -163,7 +163,6 @@
|
|||
this._updateProperty(value, 'assignment');
|
||||
},
|
||||
changeType({type, convertToList}, value) {
|
||||
console.log(type, value, convertToList);
|
||||
let el = {
|
||||
type: type,
|
||||
value: Object.assign({}, value),
|
||||
|
|
|
|||
|
|
@ -49,9 +49,15 @@
|
|||
update: (store, {data: {addProjectEntry: {projectEntry}}}) => {
|
||||
const query = PROJECT_QUERY;
|
||||
const variables = {slug: this.slug};
|
||||
const data = store.readQuery({query, variables});
|
||||
if (data.project && data.project.entries) {
|
||||
data.project.entries.push(projectEntry);
|
||||
const {project} = store.readQuery({query, variables});
|
||||
if (project) {
|
||||
const entries = [...project.entries, projectEntry];
|
||||
const data = {
|
||||
project: {
|
||||
...project,
|
||||
entries
|
||||
}
|
||||
};
|
||||
store.writeQuery({query, variables, data});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,7 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "@/styles/_variables.scss";
|
||||
@import "@/styles/_mixins.scss";
|
||||
@import "~styles/helpers";
|
||||
|
||||
.class-selection {
|
||||
position: relative;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,22 @@ const typePolicies = {
|
|||
objective: {read: idToRefFactory('ObjectiveNode')},
|
||||
objectiveGroup: {read: idToRefFactory('ObjectiveGroupNode')},
|
||||
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}),
|
||||
// objective: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveNode', id: args.id}),
|
||||
// objectiveGroup: (_, args, {getCacheKey}) => getCacheKey({__typename: 'ObjectiveGroupNode', id: args.id}),
|
||||
|
|
@ -84,29 +100,16 @@ const cache = new InMemoryCache({
|
|||
typePolicies,
|
||||
possibleTypes,
|
||||
// todo: document what this does, or link the doc for it at least
|
||||
dataIdFromObject: obj => {
|
||||
switch (obj.__typename) {
|
||||
case 'InstrumentNode':
|
||||
case 'ModuleNode':
|
||||
case 'RoomEntryNode':
|
||||
return `${obj.__typename}:${obj.slug}`;
|
||||
default:
|
||||
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});
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
// dataIdFromObject: obj => {
|
||||
// switch (obj.__typename) {
|
||||
// case 'InstrumentNode':
|
||||
// case 'ModuleNode':
|
||||
// case 'RoomEntryNode':
|
||||
// return `${obj.__typename}:${obj.slug}`;
|
||||
// default:
|
||||
// return defaultDataIdFromObject(obj);
|
||||
// }
|
||||
// },
|
||||
});
|
||||
|
||||
// TODO: Monkey-patching in a fix for an open issue suggesting that
|
||||
|
|
|
|||
|
|
@ -2,12 +2,8 @@ query OldClassesQuery {
|
|||
me {
|
||||
id
|
||||
oldClasses {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ import PROJECT_QUERY from '@/graphql/gql/queries/projectQuery.gql';
|
|||
export default {
|
||||
methods: {
|
||||
updateProjectShareState(id, shared) {
|
||||
const input = {
|
||||
id: id,
|
||||
shared,
|
||||
};
|
||||
this.$log.debug('updateProjectShareState', input);
|
||||
this.$apollo.mutate({
|
||||
mutation: UPDATE_PROJECT_SHARED_STATE_MUTATION,
|
||||
variables: {
|
||||
input: {
|
||||
id: id,
|
||||
shared,
|
||||
},
|
||||
input,
|
||||
},
|
||||
update(store, {data: {updateProjectSharedState: {shared: final, errors}}}) {
|
||||
if (!errors) {
|
||||
|
|
@ -19,6 +21,7 @@ export default {
|
|||
id: id,
|
||||
};
|
||||
const {project} = store.readQuery({query, variables});
|
||||
this.$log.debug(`updating project ${project.id} ${project.title}`);
|
||||
|
||||
if (project) {
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -75,13 +75,16 @@
|
|||
|
||||
methods: {
|
||||
createComment(text) {
|
||||
this.$log.debug(`createComment ${text}`);
|
||||
const input = {
|
||||
roomEntry: this.roomEntry.id,
|
||||
comment: text,
|
||||
};
|
||||
this.$log.debug(`input `, input);
|
||||
this.$apollo.mutate({
|
||||
mutation: ADD_COMMENT_MUTATION,
|
||||
variables: {
|
||||
input: {
|
||||
roomEntry: this.roomEntry.id,
|
||||
comment: text,
|
||||
},
|
||||
input,
|
||||
},
|
||||
update: (store, {data: {addComment: {success, comment}}}) => {
|
||||
if (success) {
|
||||
|
|
|
|||
|
|
@ -129,9 +129,6 @@
|
|||
}
|
||||
]},
|
||||
}),
|
||||
mounted() {
|
||||
// this.addBlock(0);
|
||||
},
|
||||
|
||||
methods: {
|
||||
update(index, element, parent) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from users.schema import AllUsersQuery, UsersQuery
|
|||
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):
|
||||
node = relay.Node.Field()
|
||||
|
||||
|
|
@ -34,11 +34,11 @@ class CustomQuery(UsersQuery, AllUsersQuery, ModuleRoomsQuery, RoomsQuery, Objec
|
|||
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,
|
||||
graphene.ObjectType):
|
||||
if settings.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 {
|
||||
query: CustomQuery
|
||||
mutation: CustomMutation
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
}
|
||||
|
||||
input AddCommentInput {
|
||||
|
|
@ -381,99 +381,6 @@ type CreateTeamPayload {
|
|||
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 DateTime
|
||||
|
|
@ -724,6 +631,64 @@ type MutateContentBlockPayload {
|
|||
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 {
|
||||
id: ID!
|
||||
imageUrl: String
|
||||
|
|
@ -839,7 +804,7 @@ type PrivateUserNode implements Node {
|
|||
selectedClass: SchoolClassNode
|
||||
expiryDate: String
|
||||
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
|
||||
readOnly: Boolean
|
||||
}
|
||||
|
|
@ -887,6 +852,41 @@ type PublicUserNode implements Node {
|
|||
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 {
|
||||
title: String!
|
||||
description: String
|
||||
|
|
@ -937,16 +937,6 @@ type SchoolClassNode implements Node {
|
|||
readOnly: Boolean
|
||||
}
|
||||
|
||||
type SchoolClassNodeConnection {
|
||||
pageInfo: PageInfo!
|
||||
edges: [SchoolClassNodeEdge]!
|
||||
}
|
||||
|
||||
type SchoolClassNodeEdge {
|
||||
node: SchoolClassNode
|
||||
cursor: String!
|
||||
}
|
||||
|
||||
input ShareSnapshotInput {
|
||||
snapshot: ID!
|
||||
shared: Boolean!
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ class PrivateUserNode(DjangoObjectType):
|
|||
selected_class = graphene.Field(SchoolClassNode)
|
||||
expiry_date = graphene.String()
|
||||
is_teacher = graphene.Boolean()
|
||||
old_classes = DjangoFilterConnectionField(SchoolClassNode)
|
||||
school_classes =graphene.List(SchoolClassNode)
|
||||
old_classes = graphene.List(SchoolClassNode)
|
||||
school_classes = graphene.List(SchoolClassNode)
|
||||
recent_modules = DjangoFilterConnectionField(ModuleNode, filterset_class=RecentModuleFilter)
|
||||
team = graphene.Field(TeamNode)
|
||||
read_only = graphene.Boolean()
|
||||
|
|
|
|||
Loading…
Reference in New Issue