From 8a66da7f6ce63d28d2c8bb846eb53cc243be5bab Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Fri, 10 May 2024 19:39:59 +0200 Subject: [PATCH] add support for generic pages --- dnscms/dnscms/settings/base.py | 9 +- dnscms/generic/__init__.py | 0 dnscms/generic/apps.py | 6 + dnscms/generic/migrations/0001_initial.py | 30 +++++ dnscms/generic/migrations/__init__.py | 0 dnscms/generic/models.py | 26 ++++ web/src/app/[...url]/page.tsx | 83 +++++++++++++ web/src/gql/gql.ts | 15 +++ web/src/gql/graphql.ts | 145 ++++++++++++++++++++-- 9 files changed, 305 insertions(+), 9 deletions(-) create mode 100644 dnscms/generic/__init__.py create mode 100644 dnscms/generic/apps.py create mode 100644 dnscms/generic/migrations/0001_initial.py create mode 100644 dnscms/generic/migrations/__init__.py create mode 100644 dnscms/generic/models.py create mode 100644 web/src/app/[...url]/page.tsx diff --git a/dnscms/dnscms/settings/base.py b/dnscms/dnscms/settings/base.py index 4a1ff41..2be8cf7 100644 --- a/dnscms/dnscms/settings/base.py +++ b/dnscms/dnscms/settings/base.py @@ -25,6 +25,7 @@ BASE_DIR = os.path.dirname(PROJECT_DIR) INSTALLED_APPS = [ "home", + "generic", "associations", "events", "venues", @@ -175,6 +176,12 @@ BASE_URL = "http://example.com" # GraphQL GRAPHENE = {"SCHEMA": "grapple.schema.schema"} GRAPPLE = { - "APPS": ["home", "associations", "events", "venues"], + "APPS": [ + "home", + "generic", + "associations", + "events", + "venues", + ], "EXPOSE_GRAPHIQL": True, } diff --git a/dnscms/generic/__init__.py b/dnscms/generic/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dnscms/generic/apps.py b/dnscms/generic/apps.py new file mode 100644 index 0000000..39e866c --- /dev/null +++ b/dnscms/generic/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class GenericConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'generic' diff --git a/dnscms/generic/migrations/0001_initial.py b/dnscms/generic/migrations/0001_initial.py new file mode 100644 index 0000000..cb85042 --- /dev/null +++ b/dnscms/generic/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# Generated by Django 5.0.6 on 2024-05-10 16:33 + +import django.db.models.deletion +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('wagtailcore', '0093_uploadedfile'), + ] + + operations = [ + migrations.CreateModel( + name='GenericPage', + fields=[ + ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), + ('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), + ], + options={ + 'abstract': False, + }, + bases=('wagtailcore.page',), + ), + ] diff --git a/dnscms/generic/migrations/__init__.py b/dnscms/generic/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dnscms/generic/models.py b/dnscms/generic/models.py new file mode 100644 index 0000000..1235883 --- /dev/null +++ b/dnscms/generic/models.py @@ -0,0 +1,26 @@ +from grapple.models import GraphQLStreamfield +from wagtail import blocks +from wagtail.admin.panels import FieldPanel +from wagtail.fields import StreamField +from wagtail.images.blocks import ImageChooserBlock +from wagtail.models import Page + + +class GenericPage(Page): + subpage_types = ["generic.GenericPage"] + show_in_menus = True + + body = StreamField( + [ + ("paragraph", blocks.RichTextBlock()), + ("image", ImageChooserBlock()), + ] + ) + + content_panels = Page.content_panels + [ + FieldPanel("body"), + ] + + graphql_fields = [ + GraphQLStreamfield("body"), + ] diff --git a/web/src/app/[...url]/page.tsx b/web/src/app/[...url]/page.tsx new file mode 100644 index 0000000..c5b8a4c --- /dev/null +++ b/web/src/app/[...url]/page.tsx @@ -0,0 +1,83 @@ +import { graphql } from "@/gql"; +import { GenericFragment } from "@/gql/graphql"; +import { getClient } from "@/app/client"; +import { Blocks } from "@/components/blocks/Blocks"; +import { notFound } from 'next/navigation' + +export const dynamicParams = false + +const GenericFragmentDefinition = graphql(` + fragment Generic on GenericPage { + __typename + id + title + body { + id + blockType + field + ... on RichTextBlock { + rawValue + value + } + } + } +`); + +export async function generateStaticParams() { + const allGenericSlugsQuery = graphql(` + query allGenericSlugs { + pages(contentType: "generic.GenericPage") { + id + urlPath + } + } + `); + const { data } = await getClient().query(allGenericSlugsQuery, {}); + + return data?.pages.map((page: any) => { + // wagtail-grapple prepends the home page slug to the full path on multisite setups + // we also strip the trailing slash + const urlPath = page.urlPath.replace(/\/home/, "").replace(/\/$/, ""); + console.log("adding", urlPath); + return { + url: [urlPath], + }; + }); +} + +export default async function Page({ params }: { params: { url: string } }) { + const { url } = params; + // for the page /foo/bar we need to look for `/home/foo/bar/` + const urlPath = `/home/${url}/`; + console.log("real urlPath for", url, "is", urlPath); + + const genericPageByUrlPathQuery = graphql(` + query genericPageByUrl($urlPath: String!) { + page: page(contentType: "generic.GenericPage", urlPath: $urlPath) { + ... on GenericPage { + ...Generic + } + } + } + `); + + const { data, error } = await getClient().query(genericPageByUrlPathQuery, { + urlPath: urlPath, + }); + + + const page = (data?.page ?? []) as GenericFragment[]; + + if (!page) { + return notFound() + } + + return ( +
+
+

{page.title}

+
+ +
+ ); +} diff --git a/web/src/gql/gql.ts b/web/src/gql/gql.ts index 12adb51..d95a8af 100644 --- a/web/src/gql/gql.ts +++ b/web/src/gql/gql.ts @@ -13,6 +13,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { + "\n fragment Generic on GenericPage {\n __typename\n id\n title\n body {\n id\n blockType\n field\n ... on RichTextBlock {\n rawValue\n value\n }\n }\n }\n": types.GenericFragmentDoc, + "\n query allGenericSlugs {\n pages(contentType: \"generic.GenericPage\") {\n id\n urlPath\n }\n }\n ": types.AllGenericSlugsDocument, + "\n query genericPageByUrl($urlPath: String!) {\n page: page(contentType: \"generic.GenericPage\", urlPath: $urlPath) {\n ... on GenericPage {\n ...Generic\n }\n }\n }\n ": types.GenericPageByUrlDocument, "\n query allEventSlugs {\n pages(contentType: \"events.EventPage\") {\n id\n slug\n }\n }\n ": types.AllEventSlugsDocument, "\n query eventBySlug($slug: String!) {\n event: page(contentType: \"events.EventPage\", slug: $slug) {\n ... on EventPage {\n ...Event\n }\n }\n }\n ": types.EventBySlugDocument, "\n fragment Event on EventPage {\n __typename\n id\n slug\n title\n body {\n id\n blockType\n field\n ... on RichTextBlock {\n rawValue\n value\n }\n }\n featuredImage {\n url\n width\n height\n }\n facebookUrl\n ticketUrl\n priceRegular\n priceMember\n priceStudent\n }\n": types.EventFragmentDoc, @@ -38,6 +41,18 @@ const documents = { */ export function graphql(source: string): unknown; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment Generic on GenericPage {\n __typename\n id\n title\n body {\n id\n blockType\n field\n ... on RichTextBlock {\n rawValue\n value\n }\n }\n }\n"): (typeof documents)["\n fragment Generic on GenericPage {\n __typename\n id\n title\n body {\n id\n blockType\n field\n ... on RichTextBlock {\n rawValue\n value\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query allGenericSlugs {\n pages(contentType: \"generic.GenericPage\") {\n id\n urlPath\n }\n }\n "): (typeof documents)["\n query allGenericSlugs {\n pages(contentType: \"generic.GenericPage\") {\n id\n urlPath\n }\n }\n "]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query genericPageByUrl($urlPath: String!) {\n page: page(contentType: \"generic.GenericPage\", urlPath: $urlPath) {\n ... on GenericPage {\n ...Generic\n }\n }\n }\n "): (typeof documents)["\n query genericPageByUrl($urlPath: String!) {\n page: page(contentType: \"generic.GenericPage\", urlPath: $urlPath) {\n ... on GenericPage {\n ...Generic\n }\n }\n }\n "]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/web/src/gql/graphql.ts b/web/src/gql/graphql.ts index 7089a47..a07fe46 100644 --- a/web/src/gql/graphql.ts +++ b/web/src/gql/graphql.ts @@ -52,6 +52,7 @@ export type Association = PageInterface & { expireAt?: Maybe; expired: Scalars['Boolean']['output']; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -291,6 +292,7 @@ export type EventIndex = PageInterface & { expireAt?: Maybe; expired: Scalars['Boolean']['output']; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -399,6 +401,7 @@ export type EventPage = PageInterface & { facebookUrl?: Maybe; featuredImage?: Maybe; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -496,6 +499,108 @@ export type FloatBlock = StreamFieldInterface & { value: Scalars['Float']['output']; }; +export type GenericPage = PageInterface & { + __typename?: 'GenericPage'; + aliasOf?: Maybe; + aliases: Array; + ancestors: Array; + association?: Maybe; + body?: Maybe>>; + children: Array; + contentType: Scalars['String']['output']; + depth?: Maybe; + descendants: Array; + draftTitle: Scalars['String']['output']; + eventindex?: Maybe; + eventpage?: Maybe; + expireAt?: Maybe; + expired: Scalars['Boolean']['output']; + firstPublishedAt?: Maybe; + genericpage?: Maybe; + goLiveAt?: Maybe; + hasUnpublishedChanges: Scalars['Boolean']['output']; + homepage?: Maybe; + id?: Maybe; + lastPublishedAt?: Maybe; + latestRevisionCreatedAt?: Maybe; + live: Scalars['Boolean']['output']; + locked?: Maybe; + lockedAt?: Maybe; + nextSiblings: Array; + numchild: Scalars['Int']['output']; + pageType?: Maybe; + parent?: Maybe; + path: Scalars['String']['output']; + previousSiblings: Array; + searchDescription?: Maybe; + searchScore?: Maybe; + seoTitle: Scalars['String']['output']; + showInMenus: Scalars['Boolean']['output']; + siblings: Array; + sitesRootedHere: Array; + slug: Scalars['String']['output']; + title: Scalars['String']['output']; + translationKey: Scalars['UUID']['output']; + url?: Maybe; + urlPath: Scalars['String']['output']; + venueindex?: Maybe; + venuepage?: Maybe; +}; + + +export type GenericPageAncestorsArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + + +export type GenericPageChildrenArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + + +export type GenericPageDescendantsArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + + +export type GenericPageNextSiblingsArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + + +export type GenericPagePreviousSiblingsArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + + +export type GenericPageSiblingsArgs = { + id?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + order?: InputMaybe; + searchQuery?: InputMaybe; +}; + export type HomePage = PageInterface & { __typename?: 'HomePage'; aliasOf?: Maybe; @@ -512,6 +617,7 @@ export type HomePage = PageInterface & { expireAt?: Maybe; expired: Scalars['Boolean']['output']; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -706,6 +812,7 @@ export type Page = PageInterface & { expireAt?: Maybe; expired: Scalars['Boolean']['output']; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -1055,7 +1162,7 @@ export type RichTextBlock = StreamFieldInterface & { value: Scalars['String']['output']; }; -export type Search = Association | EventIndex | EventOccurrence | EventPage | HomePage | Page | VenueIndex | VenuePage; +export type Search = Association | EventIndex | EventOccurrence | EventPage | GenericPage | HomePage | Page | VenueIndex | VenuePage; export type SiteObjectType = { __typename?: 'SiteObjectType'; @@ -1188,6 +1295,7 @@ export type VenueIndex = PageInterface & { expireAt?: Maybe; expired: Scalars['Boolean']['output']; firstPublishedAt?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -1298,6 +1406,7 @@ export type VenuePage = PageInterface & { featuredImage?: Maybe; firstPublishedAt?: Maybe; floor?: Maybe; + genericpage?: Maybe; goLiveAt?: Maybe; hasUnpublishedChanges: Scalars['Boolean']['output']; homepage?: Maybe; @@ -1384,10 +1493,27 @@ export type VenuePageSiblingsArgs = { searchQuery?: InputMaybe; }; +export type GenericFragment = { __typename: 'GenericPage', id?: string | null, title: string, body?: Array<{ __typename?: 'BlockQuoteBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'BooleanBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'CharBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ChoiceBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DateBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DateTimeBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DecimalBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DocumentChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'EmailBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'EmbedBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'FloatBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ImageChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'IntegerBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ListBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'PageChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RawHTMLBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RegexBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RichTextBlock', rawValue: string, value: string, id?: string | null, blockType: string, field: string } | { __typename?: 'StaticBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StreamBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StreamFieldBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StructBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'TextBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'TimeBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'URLBlock', id?: string | null, blockType: string, field: string } | null> | null } & { ' $fragmentName'?: 'GenericFragment' }; + +export type AllGenericSlugsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type AllGenericSlugsQuery = { __typename?: 'Query', pages: Array<{ __typename?: 'Association', id?: string | null, urlPath: string } | { __typename?: 'EventIndex', id?: string | null, urlPath: string } | { __typename?: 'EventPage', id?: string | null, urlPath: string } | { __typename?: 'GenericPage', id?: string | null, urlPath: string } | { __typename?: 'HomePage', id?: string | null, urlPath: string } | { __typename?: 'Page', id?: string | null, urlPath: string } | { __typename?: 'VenueIndex', id?: string | null, urlPath: string } | { __typename?: 'VenuePage', id?: string | null, urlPath: string }> }; + +export type GenericPageByUrlQueryVariables = Exact<{ + urlPath: Scalars['String']['input']; +}>; + + +export type GenericPageByUrlQuery = { __typename?: 'Query', page?: { __typename?: 'Association' } | { __typename?: 'EventIndex' } | { __typename?: 'EventPage' } | ( + { __typename?: 'GenericPage' } + & { ' $fragmentRefs'?: { 'GenericFragment': GenericFragment } } + ) | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' } | null }; + export type AllEventSlugsQueryVariables = Exact<{ [key: string]: never; }>; -export type AllEventSlugsQuery = { __typename?: 'Query', pages: Array<{ __typename?: 'Association', id?: string | null, slug: string } | { __typename?: 'EventIndex', id?: string | null, slug: string } | { __typename?: 'EventPage', id?: string | null, slug: string } | { __typename?: 'HomePage', id?: string | null, slug: string } | { __typename?: 'Page', id?: string | null, slug: string } | { __typename?: 'VenueIndex', id?: string | null, slug: string } | { __typename?: 'VenuePage', id?: string | null, slug: string }> }; +export type AllEventSlugsQuery = { __typename?: 'Query', pages: Array<{ __typename?: 'Association', id?: string | null, slug: string } | { __typename?: 'EventIndex', id?: string | null, slug: string } | { __typename?: 'EventPage', id?: string | null, slug: string } | { __typename?: 'GenericPage', id?: string | null, slug: string } | { __typename?: 'HomePage', id?: string | null, slug: string } | { __typename?: 'Page', id?: string | null, slug: string } | { __typename?: 'VenueIndex', id?: string | null, slug: string } | { __typename?: 'VenuePage', id?: string | null, slug: string }> }; export type EventBySlugQueryVariables = Exact<{ slug: Scalars['String']['input']; @@ -1397,7 +1523,7 @@ export type EventBySlugQueryVariables = Exact<{ export type EventBySlugQuery = { __typename?: 'Query', event?: { __typename?: 'Association' } | { __typename?: 'EventIndex' } | ( { __typename?: 'EventPage' } & { ' $fragmentRefs'?: { 'EventFragment': EventFragment } } - ) | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' } | null }; + ) | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' } | null }; export type EventFragment = { __typename: 'EventPage', id?: string | null, slug: string, title: string, facebookUrl?: string | null, ticketUrl?: string | null, priceRegular?: number | null, priceMember?: number | null, priceStudent?: number | null, body?: Array<{ __typename?: 'BlockQuoteBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'BooleanBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'CharBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ChoiceBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DateBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DateTimeBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DecimalBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'DocumentChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'EmailBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'EmbedBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'FloatBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ImageChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'IntegerBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'ListBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'PageChooserBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RawHTMLBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RegexBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'RichTextBlock', rawValue: string, value: string, id?: string | null, blockType: string, field: string } | { __typename?: 'StaticBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StreamBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StreamFieldBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'StructBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'TextBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'TimeBlock', id?: string | null, blockType: string, field: string } | { __typename?: 'URLBlock', id?: string | null, blockType: string, field: string } | null> | null, featuredImage?: { __typename?: 'ImageObjectType', url: string, width: number, height: number } | null } & { ' $fragmentName'?: 'EventFragment' }; @@ -1407,19 +1533,19 @@ export type AllEventsQueryVariables = Exact<{ [key: string]: never; }>; export type AllEventsQuery = { __typename?: 'Query', events: Array<{ __typename?: 'Association' } | { __typename?: 'EventIndex' } | ( { __typename?: 'EventPage' } & { ' $fragmentRefs'?: { 'EventFragment': EventFragment } } - ) | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }> }; + ) | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }> }; export type AllVenueSlugsQueryVariables = Exact<{ [key: string]: never; }>; -export type AllVenueSlugsQuery = { __typename?: 'Query', pages: Array<{ __typename?: 'Association', id?: string | null, slug: string } | { __typename?: 'EventIndex', id?: string | null, slug: string } | { __typename?: 'EventPage', id?: string | null, slug: string } | { __typename?: 'HomePage', id?: string | null, slug: string } | { __typename?: 'Page', id?: string | null, slug: string } | { __typename?: 'VenueIndex', id?: string | null, slug: string } | { __typename?: 'VenuePage', id?: string | null, slug: string }> }; +export type AllVenueSlugsQuery = { __typename?: 'Query', pages: Array<{ __typename?: 'Association', id?: string | null, slug: string } | { __typename?: 'EventIndex', id?: string | null, slug: string } | { __typename?: 'EventPage', id?: string | null, slug: string } | { __typename?: 'GenericPage', id?: string | null, slug: string } | { __typename?: 'HomePage', id?: string | null, slug: string } | { __typename?: 'Page', id?: string | null, slug: string } | { __typename?: 'VenueIndex', id?: string | null, slug: string } | { __typename?: 'VenuePage', id?: string | null, slug: string }> }; export type VenueBySlugQueryVariables = Exact<{ slug: Scalars['String']['input']; }>; -export type VenueBySlugQuery = { __typename?: 'Query', venue?: { __typename?: 'Association' } | { __typename?: 'EventIndex' } | { __typename?: 'EventPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | ( +export type VenueBySlugQuery = { __typename?: 'Query', venue?: { __typename?: 'Association' } | { __typename?: 'EventIndex' } | { __typename?: 'EventPage' } | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | ( { __typename?: 'VenuePage' } & { ' $fragmentRefs'?: { 'VenueFragment': VenueFragment } } ) | null }; @@ -1429,7 +1555,7 @@ export type VenueFragment = { __typename: 'VenuePage', id?: string | null, slug: export type AllVenuesQueryVariables = Exact<{ [key: string]: never; }>; -export type AllVenuesQuery = { __typename?: 'Query', venues: Array<{ __typename?: 'Association' } | { __typename?: 'EventIndex' } | { __typename?: 'EventPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | ( +export type AllVenuesQuery = { __typename?: 'Query', venues: Array<{ __typename?: 'Association' } | { __typename?: 'EventIndex' } | { __typename?: 'EventPage' } | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | ( { __typename?: 'VenuePage' } & { ' $fragmentRefs'?: { 'VenueFragment': VenueFragment } } )> }; @@ -1440,10 +1566,13 @@ export type HomeQueryVariables = Exact<{ [key: string]: never; }>; export type HomeQuery = { __typename?: 'Query', events: Array<{ __typename?: 'Association' } | { __typename?: 'EventIndex' } | ( { __typename?: 'EventPage' } & { ' $fragmentRefs'?: { 'EventFragment': EventFragment } } - ) | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }> }; + ) | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }> }; +export const GenericFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Generic"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GenericPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]} as unknown as DocumentNode; export const EventFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Event"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"featuredImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}}]}},{"kind":"Field","name":{"kind":"Name","value":"facebookUrl"}},{"kind":"Field","name":{"kind":"Name","value":"ticketUrl"}},{"kind":"Field","name":{"kind":"Name","value":"priceRegular"}},{"kind":"Field","name":{"kind":"Name","value":"priceMember"}},{"kind":"Field","name":{"kind":"Name","value":"priceStudent"}}]}}]} as unknown as DocumentNode; export const VenueFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Venue"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"VenuePage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"featuredImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}}]}},{"kind":"Field","name":{"kind":"Name","value":"showAsBookable"}},{"kind":"Field","name":{"kind":"Name","value":"floor"}},{"kind":"Field","name":{"kind":"Name","value":"preposition"}},{"kind":"Field","name":{"kind":"Name","value":"capabilityAudio"}},{"kind":"Field","name":{"kind":"Name","value":"capabilityAudioVideo"}},{"kind":"Field","name":{"kind":"Name","value":"capabilityBar"}},{"kind":"Field","name":{"kind":"Name","value":"capabilityLighting"}},{"kind":"Field","name":{"kind":"Name","value":"capacityLegal"}},{"kind":"Field","name":{"kind":"Name","value":"capacityStanding"}},{"kind":"Field","name":{"kind":"Name","value":"capacitySitting"}}]}}]} as unknown as DocumentNode; +export const AllGenericSlugsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"allGenericSlugs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contentType"},"value":{"kind":"StringValue","value":"generic.GenericPage","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"urlPath"}}]}}]}}]} as unknown as DocumentNode; +export const GenericPageByUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"genericPageByUrl"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"urlPath"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"page"},"name":{"kind":"Name","value":"page"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contentType"},"value":{"kind":"StringValue","value":"generic.GenericPage","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"urlPath"},"value":{"kind":"Variable","name":{"kind":"Name","value":"urlPath"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GenericPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Generic"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Generic"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GenericPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]} as unknown as DocumentNode; export const AllEventSlugsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"allEventSlugs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contentType"},"value":{"kind":"StringValue","value":"events.EventPage","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]} as unknown as DocumentNode; export const EventBySlugDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"eventBySlug"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"event"},"name":{"kind":"Name","value":"page"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contentType"},"value":{"kind":"StringValue","value":"events.EventPage","block":false}},{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Event"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Event"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"featuredImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}}]}},{"kind":"Field","name":{"kind":"Name","value":"facebookUrl"}},{"kind":"Field","name":{"kind":"Name","value":"ticketUrl"}},{"kind":"Field","name":{"kind":"Name","value":"priceRegular"}},{"kind":"Field","name":{"kind":"Name","value":"priceMember"}},{"kind":"Field","name":{"kind":"Name","value":"priceStudent"}}]}}]} as unknown as DocumentNode; export const AllEventsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"allEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"events"},"name":{"kind":"Name","value":"pages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contentType"},"value":{"kind":"StringValue","value":"events.EventPage","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"Event"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"Event"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventPage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"blockType"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RichTextBlock"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"rawValue"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"featuredImage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}}]}},{"kind":"Field","name":{"kind":"Name","value":"facebookUrl"}},{"kind":"Field","name":{"kind":"Name","value":"ticketUrl"}},{"kind":"Field","name":{"kind":"Name","value":"priceRegular"}},{"kind":"Field","name":{"kind":"Name","value":"priceMember"}},{"kind":"Field","name":{"kind":"Name","value":"priceStudent"}}]}}]} as unknown as DocumentNode;