From c8dc452fee27b7fdb5ea2d060611d9aab6d89840 Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Tue, 14 May 2024 22:01:57 +0200 Subject: [PATCH] wrap EventContainer in Suspense --- web/src/app/arrangementer/page.tsx | 5 ++++- web/src/gql/gql.ts | 6 +++--- web/src/gql/graphql.ts | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/web/src/app/arrangementer/page.tsx b/web/src/app/arrangementer/page.tsx index 08453c2..9276859 100644 --- a/web/src/app/arrangementer/page.tsx +++ b/web/src/app/arrangementer/page.tsx @@ -7,6 +7,7 @@ import { EventOccurrence, } from "@/lib/event"; import { PageHeader } from "@/components/general/PageHeader"; +import { Suspense } from "react"; export default async function Page() { const { data, error } = await getClient().query(allEventsQuery, {}); @@ -16,7 +17,9 @@ export default async function Page() { return (
- + + +
); } diff --git a/web/src/gql/gql.ts b/web/src/gql/gql.ts index a4f00eb..2b403f4 100644 --- a/web/src/gql/gql.ts +++ b/web/src/gql/gql.ts @@ -23,8 +23,8 @@ const documents = { "\n fragment Venue on VenuePage {\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 showAsBookable\n floor\n preposition\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n": types.VenueFragmentDoc, "\n query allVenues {\n venues: pages(contentType: \"venues.VenuePage\") {\n ... on VenuePage {\n ...Venue\n }\n }\n }\n ": types.AllVenuesDocument, "\n query home {\n events: pages(contentType: \"events.EventPage\") {\n ...Event\n }\n }\n ": types.HomeDocument, - "\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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n": types.EventFragmentDoc, "\n query allEvents {\n events: pages(contentType: \"events.EventPage\") {\n ... on EventPage {\n ...Event\n }\n }\n eventCategories: eventCategories {\n ... on EventCategory {\n name\n slug\n showInFilters\n }\n }\n }\n": types.AllEventsDocument, + "\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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n": types.EventFragmentDoc, }; /** @@ -84,11 +84,11 @@ export function graphql(source: "\n query home {\n events: pages(content /** * 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 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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n"): (typeof documents)["\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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n"]; +export function graphql(source: "\n query allEvents {\n events: pages(contentType: \"events.EventPage\") {\n ... on EventPage {\n ...Event\n }\n }\n eventCategories: eventCategories {\n ... on EventCategory {\n name\n slug\n showInFilters\n }\n }\n }\n"): (typeof documents)["\n query allEvents {\n events: pages(contentType: \"events.EventPage\") {\n ... on EventPage {\n ...Event\n }\n }\n eventCategories: eventCategories {\n ... on EventCategory {\n name\n slug\n showInFilters\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 allEvents {\n events: pages(contentType: \"events.EventPage\") {\n ... on EventPage {\n ...Event\n }\n }\n eventCategories: eventCategories {\n ... on EventCategory {\n name\n slug\n showInFilters\n }\n }\n }\n"): (typeof documents)["\n query allEvents {\n events: pages(contentType: \"events.EventPage\") {\n ... on EventPage {\n ...Event\n }\n }\n eventCategories: eventCategories {\n ... on EventCategory {\n name\n slug\n showInFilters\n }\n }\n }\n"]; +export function graphql(source: "\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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n"): (typeof documents)["\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 categories {\n ... on EventCategory {\n name\n slug\n }\n }\n occurrences {\n ... on EventOccurrence {\n __typename\n id\n start\n end\n venue {\n __typename\n id\n slug\n title\n }\n }\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/web/src/gql/graphql.ts b/web/src/gql/graphql.ts index 9597293..9f240ce 100644 --- a/web/src/gql/graphql.ts +++ b/web/src/gql/graphql.ts @@ -1605,8 +1605,6 @@ export type HomeQuery = { __typename?: 'Query', events: Array<{ __typename?: 'As & { ' $fragmentRefs'?: { 'EventFragment': EventFragment } } ) | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }> }; -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, categories: Array<{ __typename?: 'EventCategory', name: string, slug: string }>, occurrences: Array<{ __typename: 'EventOccurrence', id?: string | null, start: string, end?: string | null, venue?: { __typename: 'VenuePage', id?: string | null, slug: string, title: string } | null }> } & { ' $fragmentName'?: 'EventFragment' }; - export type AllEventsQueryVariables = Exact<{ [key: string]: never; }>; @@ -1615,6 +1613,8 @@ export type AllEventsQuery = { __typename?: 'Query', events: Array<{ __typename? & { ' $fragmentRefs'?: { 'EventFragment': EventFragment } } ) | { __typename?: 'GenericPage' } | { __typename?: 'HomePage' } | { __typename?: 'Page' } | { __typename?: 'VenueIndex' } | { __typename?: 'VenuePage' }>, eventCategories?: Array<{ __typename?: 'EventCategory', name: string, slug: string, showInFilters: boolean } | null> | 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, categories: Array<{ __typename?: 'EventCategory', name: string, slug: string }>, occurrences: Array<{ __typename: 'EventOccurrence', id?: string | null, start: string, end?: string | null, venue?: { __typename: 'VenuePage', id?: string | null, slug: string, title: string } | null }> } & { ' $fragmentName'?: 'EventFragment' }; + 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":"urlPath"}},{"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 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 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"}},{"kind":"Field","name":{"kind":"Name","value":"categories"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventCategory"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"occurrences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"EventOccurrence"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"start"}},{"kind":"Field","name":{"kind":"Name","value":"end"}},{"kind":"Field","name":{"kind":"Name","value":"venue"},"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"}}]}}]}}]}}]}}]} as unknown as DocumentNode;