diff --git a/client/src/__generated__/graphql.ts b/client/src/__generated__/graphql.ts index 769faff7..86eca2d6 100644 --- a/client/src/__generated__/graphql.ts +++ b/client/src/__generated__/graphql.ts @@ -524,6 +524,8 @@ export type ContentElementValueInput = { description?: InputMaybe; /** To be used for assignment type */ id?: InputMaybe; + /** To be used for assignment type */ + solution?: InputMaybe; /** To be used for link_block, text_block types */ text?: InputMaybe; /** To be used for image_block, assignment type */ @@ -783,6 +785,7 @@ export enum InputTypes { ImageUrlBlock = 'image_url_block', LinkBlock = 'link_block', Readonly = 'readonly', + Solution = 'solution', Subtitle = 'subtitle', TextBlock = 'text_block', VideoBlock = 'video_block' @@ -947,7 +950,7 @@ export type ModuleEdge = { }; export type ModuleInterface = { - heroImage: WagtailImageNode; + heroImage?: Maybe; /** The ID of the object */ id: Scalars['ID']['output']; pk?: Maybe; @@ -986,7 +989,7 @@ export type ModuleNode = ModuleInterface & { bookmark?: Maybe; category?: Maybe; chapters?: Maybe>>; - heroImage: WagtailImageNode; + heroImage?: Maybe; /** e.g. 'Reuters', 'Wikipedia' */ heroSource: Scalars['String']['output']; highlights?: Maybe>>; @@ -2850,10 +2853,10 @@ export type TeamPartsFragment = { __typename?: 'TeamNode', name: string, code?: export type WagtailImagePartsFragment = { __typename?: 'WagtailImageNode', id: string, src?: string | null, alt?: string | null, width: number, height: number, title: string, srcset?: string | null } & { ' $fragmentName'?: 'WagtailImagePartsFragment' }; -export type ModulePartsFragment = { __typename?: 'ModuleNode', id: string, title: string, metaTitle: string, teaser: string, intro: string, slug: string, heroSource: string, solutionsEnabled?: boolean | null, language?: string | null, inEditMode: boolean, heroImage: ( +export type ModulePartsFragment = { __typename?: 'ModuleNode', id: string, title: string, metaTitle: string, teaser: string, intro: string, slug: string, heroSource: string, solutionsEnabled?: boolean | null, language?: string | null, inEditMode: boolean, heroImage?: ( { __typename?: 'WagtailImageNode' } & { ' $fragmentRefs'?: { 'WagtailImagePartsFragment': WagtailImagePartsFragment } } - ), highlights?: Array<( + ) | null, highlights?: Array<( { __typename?: 'HighlightNode' } & { ' $fragmentRefs'?: { 'HighlightPartsFragment': HighlightPartsFragment } } ) | null> | null, level?: { __typename?: 'ModuleLevelNode', id: string, name: string } | null, category?: { __typename?: 'ModuleCategoryNode', id: string, name: string } | null, topic?: { __typename?: 'TopicNode', slug: string, title: string } | null, bookmark?: { __typename?: 'ModuleBookmarkNode', note?: { __typename?: 'NoteNode', id: string, text: string } | null } | null } & { ' $fragmentName'?: 'ModulePartsFragment' }; diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 144b80dc..d4602e0a 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -35,6 +35,7 @@ :original-width="module.heroImage.width" :original-height="module.heroImage.height" :alt="module.heroImage.alt" + v-if="module.heroImage" > diff --git a/client/src/components/modules/ModuleTeaser.vue b/client/src/components/modules/ModuleTeaser.vue index 4c936d7d..7be1cbe4 100644 --- a/client/src/components/modules/ModuleTeaser.vue +++ b/client/src/components/modules/ModuleTeaser.vue @@ -9,6 +9,7 @@ :srcset="heroImage.srcset" :original-height="heroImage.height" :original-width="heroImage.width" + v-if="heroImage" >
diff --git a/server/books/schema/interfaces/module.py b/server/books/schema/interfaces/module.py index 24bd5a30..6c6a3b31 100644 --- a/server/books/schema/interfaces/module.py +++ b/server/books/schema/interfaces/module.py @@ -4,7 +4,7 @@ from graphene import relay class ModuleInterface(relay.Node): pk = graphene.Int() - hero_image = graphene.Field('books.schema.nodes.WagtailImageNode', required=True) + hero_image = graphene.Field('books.schema.nodes.WagtailImageNode') topic = graphene.Field('books.schema.nodes.TopicNode') @staticmethod diff --git a/server/schema.graphql b/server/schema.graphql index 1c62cf80..365989ff 100644 --- a/server/schema.graphql +++ b/server/schema.graphql @@ -108,7 +108,7 @@ type ModuleNode implements ModuleInterface { metaTitle: String! level: ModuleLevelNode category: ModuleCategoryNode - heroImage: WagtailImageNode! + heroImage: WagtailImageNode """e.g. 'Reuters', 'Wikipedia'""" heroSource: String! @@ -140,7 +140,7 @@ interface ModuleInterface { """The ID of the object""" id: ID! pk: Int - heroImage: WagtailImageNode! + heroImage: WagtailImageNode topic: TopicNode } @@ -1762,6 +1762,7 @@ enum InputTypes { document_block content_list_item subtitle + solution readonly } @@ -1783,6 +1784,9 @@ input ContentElementValueInput { """To be used for assignment type""" id: String + + """To be used for assignment type""" + solution: String } type AddModuleRoomEntryPayload {