Skip to content

Commit

Permalink
SKY-4462 Fix Contentful example
Browse files Browse the repository at this point in the history
  • Loading branch information
hthr-lee committed Apr 11, 2024
1 parent 579c173 commit 34c4aa3
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 624 deletions.
2 changes: 1 addition & 1 deletion src/components/features/hero-banner/HeroBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const HeroBanner = ({
let resolvedVariant;
if (heroBanner && variant.value) {
const variation = heroBanner.meta[variant.value];
resolvedVariant = heroBanner.variationsCollection?.items.find(hero => {
resolvedVariant = heroBanner.variantsCollection?.items.find(hero => {
return hero?.__typename === 'Hero' && hero?.sys.id === variation;
});
setHero(resolvedVariant);
Expand Down
46 changes: 23 additions & 23 deletions src/lib/__generated/graphql.schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ To have an entry point for the app [See type definition](https://app.contentful.
"""
type PageLanding implements Entry {
contentfulMetadata: ContentfulMetadata!
heroBanner(locale: String, preview: Boolean, where: VariationContainerFilter): VariationContainer
heroBanner(locale: String, preview: Boolean, where: VariantContainerFilter): VariantContainer
internalName(locale: String): String
linkedFrom(allowedLocales: [String]): PageLandingLinkingCollections
productsCollection(limit: Int = 100, locale: String, order: [PageLandingProductsCollectionOrder], preview: Boolean, skip: Int = 0, where: PageProductFilter): PageLandingProductsCollection
Expand All @@ -550,7 +550,7 @@ input PageLandingFilter {
AND: [PageLandingFilter]
OR: [PageLandingFilter]
contentfulMetadata: ContentfulMetadataFilter
heroBanner: cfVariationContainerNestedFilter
heroBanner: cfVariantContainerNestedFilter
heroBanner_exists: Boolean
internalName: String
internalName_contains: String
Expand Down Expand Up @@ -785,8 +785,8 @@ type Query {
pageLandingCollection(limit: Int = 100, locale: String, order: [PageLandingOrder], preview: Boolean, skip: Int = 0, where: PageLandingFilter): PageLandingCollection
pageProduct(id: String!, locale: String, preview: Boolean): PageProduct
pageProductCollection(limit: Int = 100, locale: String, order: [PageProductOrder], preview: Boolean, skip: Int = 0, where: PageProductFilter): PageProductCollection
variationContainer(id: String!, locale: String, preview: Boolean): VariationContainer
variationContainerCollection(limit: Int = 100, locale: String, order: [VariationContainerOrder], preview: Boolean, skip: Int = 0, where: VariationContainerFilter): VariationContainerCollection
variantContainer(id: String!, locale: String, preview: Boolean): VariantContainer
variantContainerCollection(limit: Int = 100, locale: String, order: [VariantContainerOrder], preview: Boolean, skip: Int = 0, where: VariantContainerFilter): VariantContainerCollection
}

type Sys {
Expand Down Expand Up @@ -836,28 +836,28 @@ input SysFilter {
}

"""
[See type definition](https://app.contentful.com/spaces/4y4crvvoco9a/content_types/variationContainer)
[See type definition](https://app.contentful.com/spaces/4y4crvvoco9a/content_types/variantContainer)
"""
type VariationContainer implements Entry {
type VariantContainer implements Entry {
contentfulMetadata: ContentfulMetadata!
experiment(locale: String): JSON
experimentId(locale: String): String
linkedFrom(allowedLocales: [String]): VariationContainerLinkingCollections
linkedFrom(allowedLocales: [String]): VariantContainerLinkingCollections
meta(locale: String): JSON
sys: Sys!
variationsCollection(limit: Int = 100, locale: String, preview: Boolean, skip: Int = 0): VariationContainerVariationsCollection
variantsCollection(limit: Int = 100, locale: String, preview: Boolean, skip: Int = 0): VariantContainerVariantsCollection
}

type VariationContainerCollection {
items: [VariationContainer]!
type VariantContainerCollection {
items: [VariantContainer]!
limit: Int!
skip: Int!
total: Int!
}

input VariationContainerFilter {
AND: [VariationContainerFilter]
OR: [VariationContainerFilter]
input VariantContainerFilter {
AND: [VariantContainerFilter]
OR: [VariantContainerFilter]
contentfulMetadata: ContentfulMetadataFilter
experimentId: String
experimentId_contains: String
Expand All @@ -869,15 +869,15 @@ input VariationContainerFilter {
experiment_exists: Boolean
meta_exists: Boolean
sys: SysFilter
variationsCollection_exists: Boolean
variantsCollection_exists: Boolean
}

type VariationContainerLinkingCollections {
type VariantContainerLinkingCollections {
entryCollection(limit: Int = 100, locale: String, preview: Boolean, skip: Int = 0): EntryCollection
pageLandingCollection(limit: Int = 100, locale: String, order: [VariationContainerLinkingCollectionsPageLandingCollectionOrder], preview: Boolean, skip: Int = 0): PageLandingCollection
pageLandingCollection(limit: Int = 100, locale: String, order: [VariantContainerLinkingCollectionsPageLandingCollectionOrder], preview: Boolean, skip: Int = 0): PageLandingCollection
}

enum VariationContainerLinkingCollectionsPageLandingCollectionOrder {
enum VariantContainerLinkingCollectionsPageLandingCollectionOrder {
internalName_ASC
internalName_DESC
sys_firstPublishedAt_ASC
Expand All @@ -890,7 +890,7 @@ enum VariationContainerLinkingCollectionsPageLandingCollectionOrder {
sys_publishedVersion_DESC
}

enum VariationContainerOrder {
enum VariantContainerOrder {
experimentId_ASC
experimentId_DESC
sys_firstPublishedAt_ASC
Expand All @@ -903,7 +903,7 @@ enum VariationContainerOrder {
sys_publishedVersion_DESC
}

type VariationContainerVariationsCollection {
type VariantContainerVariantsCollection {
items: [Entry]!
limit: Int!
skip: Int!
Expand Down Expand Up @@ -1004,9 +1004,9 @@ input cfPageProductNestedFilter {
sys: SysFilter
}

input cfVariationContainerNestedFilter {
AND: [cfVariationContainerNestedFilter]
OR: [cfVariationContainerNestedFilter]
input cfVariantContainerNestedFilter {
AND: [cfVariantContainerNestedFilter]
OR: [cfVariantContainerNestedFilter]
contentfulMetadata: ContentfulMetadataFilter
experimentId: String
experimentId_contains: String
Expand All @@ -1018,5 +1018,5 @@ input cfVariationContainerNestedFilter {
experiment_exists: Boolean
meta_exists: Boolean
sys: SysFilter
variationsCollection_exists: Boolean
variantsCollection_exists: Boolean
}
60 changes: 30 additions & 30 deletions src/lib/__generated/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@
},
{
"kind": "OBJECT",
"name": "VariationContainer",
"name": "VariantContainer",
"ofType": null
}
]
Expand Down Expand Up @@ -4806,7 +4806,7 @@
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "VariationContainerFilter",
"name": "VariantContainerFilter",
"ofType": null
},
"defaultValue": null,
Expand All @@ -4816,7 +4816,7 @@
],
"type": {
"kind": "OBJECT",
"name": "VariationContainer",
"name": "VariantContainer",
"ofType": null
},
"isDeprecated": false,
Expand Down Expand Up @@ -5176,7 +5176,7 @@
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "cfVariationContainerNestedFilter",
"name": "cfVariantContainerNestedFilter",
"ofType": null
},
"defaultValue": null,
Expand Down Expand Up @@ -8387,7 +8387,7 @@
"deprecationReason": null
},
{
"name": "variationContainer",
"name": "variantContainer",
"description": null,
"args": [
{
Expand Down Expand Up @@ -8433,14 +8433,14 @@
],
"type": {
"kind": "OBJECT",
"name": "VariationContainer",
"name": "VariantContainer",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "variationContainerCollection",
"name": "variantContainerCollection",
"description": null,
"args": [
{
Expand Down Expand Up @@ -8475,7 +8475,7 @@
"name": null,
"ofType": {
"kind": "ENUM",
"name": "VariationContainerOrder",
"name": "VariantContainerOrder",
"ofType": null
}
},
Expand Down Expand Up @@ -8512,7 +8512,7 @@
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "VariationContainerFilter",
"name": "VariantContainerFilter",
"ofType": null
},
"defaultValue": null,
Expand All @@ -8522,7 +8522,7 @@
],
"type": {
"kind": "OBJECT",
"name": "VariationContainerCollection",
"name": "VariantContainerCollection",
"ofType": null
},
"isDeprecated": false,
Expand Down Expand Up @@ -9092,8 +9092,8 @@
},
{
"kind": "OBJECT",
"name": "VariationContainer",
"description": "[See type definition](https://app.contentful.com/spaces/4y4crvvoco9a/content_types/variationContainer)",
"name": "VariantContainer",
"description": "[See type definition](https://app.contentful.com/spaces/4y4crvvoco9a/content_types/variantContainer)",
"fields": [
{
"name": "contentfulMetadata",
Expand Down Expand Up @@ -9184,7 +9184,7 @@
],
"type": {
"kind": "OBJECT",
"name": "VariationContainerLinkingCollections",
"name": "VariantContainerLinkingCollections",
"ofType": null
},
"isDeprecated": false,
Expand Down Expand Up @@ -9232,7 +9232,7 @@
"deprecationReason": null
},
{
"name": "variationsCollection",
"name": "variantsCollection",
"description": null,
"args": [
{
Expand Down Expand Up @@ -9286,7 +9286,7 @@
],
"type": {
"kind": "OBJECT",
"name": "VariationContainerVariationsCollection",
"name": "VariantContainerVariantsCollection",
"ofType": null
},
"isDeprecated": false,
Expand All @@ -9306,7 +9306,7 @@
},
{
"kind": "OBJECT",
"name": "VariationContainerCollection",
"name": "VariantContainerCollection",
"description": null,
"fields": [
{
Expand All @@ -9321,7 +9321,7 @@
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "VariationContainer",
"name": "VariantContainer",
"ofType": null
}
}
Expand Down Expand Up @@ -9385,7 +9385,7 @@
},
{
"kind": "INPUT_OBJECT",
"name": "VariationContainerFilter",
"name": "VariantContainerFilter",
"description": null,
"fields": null,
"inputFields": [
Expand All @@ -9397,7 +9397,7 @@
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "VariationContainerFilter",
"name": "VariantContainerFilter",
"ofType": null
}
},
Expand All @@ -9413,7 +9413,7 @@
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "VariationContainerFilter",
"name": "VariantContainerFilter",
"ofType": null
}
},
Expand Down Expand Up @@ -9562,7 +9562,7 @@
"deprecationReason": null
},
{
"name": "variationsCollection_exists",
"name": "variantsCollection_exists",
"description": null,
"type": {
"kind": "SCALAR",
Expand All @@ -9580,7 +9580,7 @@
},
{
"kind": "OBJECT",
"name": "VariationContainerLinkingCollections",
"name": "VariantContainerLinkingCollections",
"description": null,
"fields": [
{
Expand Down Expand Up @@ -9680,7 +9680,7 @@
"name": null,
"ofType": {
"kind": "ENUM",
"name": "VariationContainerLinkingCollectionsPageLandingCollectionOrder",
"name": "VariantContainerLinkingCollectionsPageLandingCollectionOrder",
"ofType": null
}
},
Expand Down Expand Up @@ -9729,7 +9729,7 @@
},
{
"kind": "ENUM",
"name": "VariationContainerLinkingCollectionsPageLandingCollectionOrder",
"name": "VariantContainerLinkingCollectionsPageLandingCollectionOrder",
"description": null,
"fields": null,
"inputFields": null,
Expand Down Expand Up @@ -9800,7 +9800,7 @@
},
{
"kind": "ENUM",
"name": "VariationContainerOrder",
"name": "VariantContainerOrder",
"description": null,
"fields": null,
"inputFields": null,
Expand Down Expand Up @@ -9871,7 +9871,7 @@
},
{
"kind": "OBJECT",
"name": "VariationContainerVariationsCollection",
"name": "VariantContainerVariantsCollection",
"description": null,
"fields": [
{
Expand Down Expand Up @@ -12002,7 +12002,7 @@
},
{
"kind": "INPUT_OBJECT",
"name": "cfVariationContainerNestedFilter",
"name": "cfVariantContainerNestedFilter",
"description": null,
"fields": null,
"inputFields": [
Expand All @@ -12014,7 +12014,7 @@
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "cfVariationContainerNestedFilter",
"name": "cfVariantContainerNestedFilter",
"ofType": null
}
},
Expand All @@ -12030,7 +12030,7 @@
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "cfVariationContainerNestedFilter",
"name": "cfVariantContainerNestedFilter",
"ofType": null
}
},
Expand Down Expand Up @@ -12179,7 +12179,7 @@
"deprecationReason": null
},
{
"name": "variationsCollection_exists",
"name": "variantsCollection_exists",
"description": null,
"type": {
"kind": "SCALAR",
Expand Down
Loading

0 comments on commit 34c4aa3

Please sign in to comment.