Split content block fragment into multiple parts

This commit is contained in:
Ramon Wenger 2021-05-05 00:14:04 +02:00
parent 09566f1193
commit ca549e93e5
11 changed files with 35 additions and 25 deletions

View File

@ -1,4 +1,3 @@
#import "./contentBlockParts.gql"
fragment ChapterParts on ChapterNode {
id
title

View File

@ -0,0 +1,7 @@
fragment ContentBlockInterfaceParts on ContentBlockInterface {
id
title
type
contents
__typename
}

View File

@ -1,9 +1,5 @@
fragment ContentBlockParts on ContentBlockNode {
id
slug
title
type
contents
userCreated
mine
bookmarks {
@ -14,19 +10,12 @@ fragment ContentBlockParts on ContentBlockNode {
}
}
hiddenFor {
edges {
node {
id
name
}
}
id
name
}
visibleFor {
edges {
node {
id
name
}
}
id
name
}
}

View File

@ -1,9 +1,11 @@
#import "../fragments/contentBlockInterfaceParts.gql"
#import "../fragments/contentBlockParts.gql"
mutation AddContentBlock($input: AddContentBlockInput!) {
addContentBlock(input: $input) {
newContentBlock {
...ContentBlockParts
...ContentBlockInterfaceParts
}
errors
clientMutationId

View File

@ -1,9 +1,12 @@
#import "../fragments/contentBlockInterfaceParts.gql"
#import "../fragments/contentBlockParts.gql"
mutation MutateContentBlock($input: MutateContentBlockInput!) {
mutateContentBlock(input: $input) {
contentBlock {
...ContentBlockParts
...ContentBlockInterfaceParts
}
}
}

View File

@ -1,11 +1,14 @@
#import "../fragments/chapterParts.gql"
#import "../fragments/contentBlockInterfaceParts.gql"
#import "../fragments/contentBlockParts.gql"
mutation UpdateChapterVisibility($input: UpdateChapterVisibilityInput!) {
updateChapterVisibility(input: $input) {
chapter {
...ChapterParts
contentBlocks {
...ContentBlockParts
...ContentBlockInterfaceParts
}
}
}

View File

@ -1,7 +0,0 @@
# to be read from cache only
#import "../fragments/contentBlockParts.gql"
query ContentBlockQuery {
contentBlocks {
...ContentBlockParts
}
}

View File

@ -1,10 +1,13 @@
#import "../fragments/chapterParts.gql"
#import "../fragments/contentBlockInterfaceParts.gql"
#import "../fragments/contentBlockParts.gql"
query ChapterQuery($id: ID!) {
chapter(id: $id) {
...ChapterParts
contentBlocks {
...ContentBlockParts
...ContentBlockInterfaceParts
}
}
}

View File

@ -1,6 +1,8 @@
#import "../fragments/contentBlockInterfaceParts.gql"
#import "../fragments/contentBlockParts.gql"
query ContentBlockQuery($id: ID!) {
contentBlock(id: $id) {
...ContentBlockParts
...ContentBlockInterfaceParts
}
}

View File

@ -3,6 +3,7 @@
#import "../../fragments/objectiveGroupParts.gql"
#import "../../fragments/objectiveParts.gql"
#import "../../fragments/moduleParts.gql"
#import "../../fragments/contentBlockInterfaceParts.gql"
#import "../../fragments/contentBlockParts.gql"
query ModuleDetailsQuery($slug: String!) {
module(slug: $slug) {
@ -33,6 +34,7 @@ query ModuleDetailsQuery($slug: String!) {
node {
...ChapterParts
contentBlocks {
...ContentBlockInterfaceParts
...ContentBlockParts
}
}

View File

@ -1,6 +1,12 @@
#import "../../fragments/contentBlockInterfaceParts.gql"
query SnapshotDetail($id: ID!) {
snapshot(id: $id) {
id
title
metaTitle
heroImage
chapters {
id
description
@ -8,7 +14,8 @@ query SnapshotDetail($id: ID!) {
titleHidden
descriptionHidden
contentBlocks {
id
...ContentBlockInterfaceParts
hidden
}
}
}