From 046b7414582fa09992d65868e9d0784321282303 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 6 May 2021 11:20:27 +0200 Subject: [PATCH] Update schema --- client/cypress/plugins/index.js | 2 +- server/schema.graphql | 41 ++++++++------------------------- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/client/cypress/plugins/index.js b/client/cypress/plugins/index.js index 4117cf88..00a3e8ae 100644 --- a/client/cypress/plugins/index.js +++ b/client/cypress/plugins/index.js @@ -20,7 +20,7 @@ module.exports = (on, config) => { on('task', { getSchema() { return readFileSync( - resolve(__dirname, '../../../schema.graphql'), + resolve(__dirname, '../../../server/schema.graphql'), 'utf8' ); } diff --git a/server/schema.graphql b/server/schema.graphql index bb7a11de..f5652759 100644 --- a/server/schema.graphql +++ b/server/schema.graphql @@ -218,38 +218,17 @@ type ChapterBookmarkNodeEdge { cursor: String! } -type ChapterInSnapshotNode implements ChapterInterface { - id: ID! - chapter: ChapterNode! - snapshot: SnapshotNode! - titleHidden: Boolean - descriptionHidden: Boolean - description: String - title: String -} - -type ChapterInSnapshotNodeConnection { - pageInfo: PageInfo! - edges: [ChapterInSnapshotNodeEdge]! -} - -type ChapterInSnapshotNodeEdge { - node: ChapterInSnapshotNode - cursor: String! -} - interface ChapterInterface { - id: ID! description: String title: String } -type ChapterNode implements ChapterInterface { +type ChapterNode implements Node & ChapterInterface { title: String slug: String! description: String - titleHiddenFor(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! - descriptionHiddenFor(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! + titleHiddenFor: [SchoolClassNode] + descriptionHiddenFor: [SchoolClassNode] id: ID! bookmark: ChapterBookmarkNode contentBlocks: [ContentBlockNode] @@ -300,13 +279,12 @@ input ContentBlockInput { } interface ContentBlockInterface { - id: ID! title: String contents: GenericStreamFieldType type: String } -type ContentBlockNode implements ContentBlockInterface { +type ContentBlockNode implements Node & ContentBlockInterface { title: String slug: String! hiddenFor: [SchoolClassNode] @@ -724,7 +702,7 @@ type ObjectiveGroupNode implements Node { id: ID! title: ObjectiveGroupTitle module: ModuleNode! - hiddenFor(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! + hiddenFor: [SchoolClassNode] objectives(offset: Int, before: String, after: String, first: Int, last: Int, text: String): ObjectiveNodeConnection! pk: Int displayTitle: String @@ -751,8 +729,8 @@ type ObjectiveNode implements Node { text: String! group: ObjectiveGroupNode! owner: UserNode - hiddenFor(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! - visibleFor(offset: Int, before: String, after: String, first: Int, last: Int, name: String): SchoolClassNodeConnection! + hiddenFor: [SchoolClassNode] + visibleFor: [SchoolClassNode] order: Int pk: Int userCreated: Boolean @@ -903,7 +881,7 @@ type SchoolClassNodeEdge { cursor: String! } -type SnapshotChapterNode implements ChapterInterface { +type SnapshotChapterNode implements Node & ChapterInterface { id: ID! description: String title: String @@ -912,7 +890,7 @@ type SnapshotChapterNode implements ChapterInterface { titleHidden: Boolean } -type SnapshotContentBlockNode implements ContentBlockInterface { +type SnapshotContentBlockNode implements Node & ContentBlockInterface { id: ID! title: String contents: GenericStreamFieldType @@ -927,7 +905,6 @@ type SnapshotNode implements Node { hiddenContentBlocks(offset: Int, before: String, after: String, first: Int, last: Int, slug: String, title: String): ContentBlockNodeConnection! created: DateTime! creator: UserNode - chapterSnapshots(offset: Int, before: String, after: String, first: Int, last: Int, id: ID): ChapterInSnapshotNodeConnection! title: String metaTitle: String heroImage: String