feat: improve structure and error handling
This commit is contained in:
@@ -8,222 +8,218 @@
|
||||
#import "../Fragments/Refs/LoyaltyPage.graphql"
|
||||
#import "../Fragments/Refs/System.graphql"
|
||||
|
||||
query GetLoyaltyPage($locale: String!, $url: String!) {
|
||||
all_loyalty_page(where: { url: $url }, locale: $locale) {
|
||||
items {
|
||||
blocks {
|
||||
__typename
|
||||
... on LoyaltyPageBlocksShortcuts {
|
||||
shortcuts {
|
||||
title
|
||||
preamble
|
||||
shortcuts {
|
||||
text
|
||||
open_in_new_tab
|
||||
linkConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageLink
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksDynamicContent {
|
||||
dynamic_content {
|
||||
title
|
||||
subtitle
|
||||
component
|
||||
link {
|
||||
text
|
||||
pageConnection {
|
||||
edges {
|
||||
node {
|
||||
...ContentPageLink
|
||||
...LoyaltyPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksCardGrid {
|
||||
card_grid {
|
||||
title
|
||||
subtitle
|
||||
cards {
|
||||
referenceConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
...AccountPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
title
|
||||
subtitle
|
||||
open_in_new_tab
|
||||
cta_text
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksContent {
|
||||
content {
|
||||
content {
|
||||
json
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
title
|
||||
heading
|
||||
sidebar {
|
||||
__typename
|
||||
... on LoyaltyPageSidebarJoinLoyaltyContact {
|
||||
join_loyalty_contact {
|
||||
title
|
||||
preamble
|
||||
contact {
|
||||
... on LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact {
|
||||
__typename
|
||||
contact {
|
||||
display_text
|
||||
contact_field
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageSidebarContent {
|
||||
content {
|
||||
content {
|
||||
json
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
web {
|
||||
breadcrumbs {
|
||||
query GetLoyaltyPage($locale: String!, $uid: String!) {
|
||||
loyalty_page(uid: $uid, locale: $locale) {
|
||||
blocks {
|
||||
__typename
|
||||
... on LoyaltyPageBlocksShortcuts {
|
||||
shortcuts {
|
||||
title
|
||||
parents {
|
||||
href
|
||||
title
|
||||
preamble
|
||||
shortcuts {
|
||||
text
|
||||
open_in_new_tab
|
||||
linkConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageLink
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
system {
|
||||
uid
|
||||
created_at
|
||||
updated_at
|
||||
... on LoyaltyPageBlocksDynamicContent {
|
||||
dynamic_content {
|
||||
title
|
||||
subtitle
|
||||
component
|
||||
link {
|
||||
text
|
||||
pageConnection {
|
||||
edges {
|
||||
node {
|
||||
...ContentPageLink
|
||||
...LoyaltyPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksCardGrid {
|
||||
card_grid {
|
||||
title
|
||||
subtitle
|
||||
cards {
|
||||
referenceConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
...AccountPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
title
|
||||
subtitle
|
||||
open_in_new_tab
|
||||
cta_text
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksContent {
|
||||
content {
|
||||
content {
|
||||
json
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
title
|
||||
heading
|
||||
sidebar {
|
||||
__typename
|
||||
... on LoyaltyPageSidebarJoinLoyaltyContact {
|
||||
join_loyalty_contact {
|
||||
title
|
||||
preamble
|
||||
contact {
|
||||
... on LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact {
|
||||
__typename
|
||||
contact {
|
||||
display_text
|
||||
contact_field
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageSidebarContent {
|
||||
content {
|
||||
content {
|
||||
json
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...Image
|
||||
...LoyaltyPageLink
|
||||
...ContentPageLink
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
web {
|
||||
breadcrumbs {
|
||||
title
|
||||
parents {
|
||||
href
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
system {
|
||||
uid
|
||||
created_at
|
||||
updated_at
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetLoyaltyPageRefs($locale: String!, $url: String!) {
|
||||
all_loyalty_page(where: { url: $url }, locale: $locale) {
|
||||
items {
|
||||
blocks {
|
||||
... on LoyaltyPageBlocksShortcuts {
|
||||
__typename
|
||||
query GetLoyaltyPageRefs($locale: String!, $uid: String!) {
|
||||
loyalty_page(locale: $locale, uid: $uid) {
|
||||
blocks {
|
||||
... on LoyaltyPageBlocksShortcuts {
|
||||
__typename
|
||||
shortcuts {
|
||||
shortcuts {
|
||||
shortcuts {
|
||||
linkConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageRef
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
linkConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageRef
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksDynamicContent {
|
||||
__typename
|
||||
dynamic_content {
|
||||
link {
|
||||
pageConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksDynamicContent {
|
||||
__typename
|
||||
dynamic_content {
|
||||
link {
|
||||
pageConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksCardGrid {
|
||||
__typename
|
||||
card_grid {
|
||||
cards {
|
||||
referenceConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageRef
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksCardGrid {
|
||||
__typename
|
||||
card_grid {
|
||||
cards {
|
||||
referenceConnection {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
...AccountPageRef
|
||||
...ContentPageRef
|
||||
...LoyaltyPageRef
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
... on LoyaltyPageBlocksContent {
|
||||
__typename
|
||||
}
|
||||
... on LoyaltyPageBlocksContent {
|
||||
__typename
|
||||
content {
|
||||
content {
|
||||
content {
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
# No fragments used since we want to include __typename for each type to avoid fetching SystemAsset
|
||||
... on ContentPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
# No fragments used since we want to include __typename for each type to avoid fetching SystemAsset
|
||||
... on ContentPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
... on LoyaltyPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
... on LoyaltyPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,26 +228,26 @@ query GetLoyaltyPageRefs($locale: String!, $url: String!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
sidebar {
|
||||
... on LoyaltyPageSidebarContent {
|
||||
__typename
|
||||
}
|
||||
sidebar {
|
||||
... on LoyaltyPageSidebarContent {
|
||||
__typename
|
||||
content {
|
||||
content {
|
||||
content {
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
# No fragments used since we want to include __typename for each type to avoid fetching SystemAsset
|
||||
... on ContentPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
embedded_itemsConnection {
|
||||
edges {
|
||||
node {
|
||||
# No fragments used since we want to include __typename for each type to avoid fetching SystemAsset
|
||||
... on ContentPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
... on LoyaltyPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
... on LoyaltyPage {
|
||||
__typename
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,9 +256,9 @@ query GetLoyaltyPageRefs($locale: String!, $url: String!) {
|
||||
}
|
||||
}
|
||||
}
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user