import { gql } from 'graphql-request'

export const PAGE_FRAGMENT = gql`
  fragment PageFields on Page {
    id
    title(format: RENDERED)
    content(format: RENDERED)
    databaseId
    uri
    seo {
      fullHead
    }
    featuredImage {
      node {
        imageUrl: sourceUrl
        alt: altText
        placeholder: sourceUrl(size: THUMBNAIL)
      }
    }
    customCtaSection {
      ctaText
      ctaLink {
        title
        url
      }
      enableCta
    }
    customResourcesSection {
      resourcesSection {
        sectionTitle
        sectionDescription
        resources {
          resourceLink {
            title
            url
          }
        }
      }
    }
    template {
      __typename
      ... on Template_ThankYou {
        thankYouPageContent {
          bodySection {
            ... on Template_ThankYou_Thankyoupagecontent_BodySection_AsymmetricalPhotoLayout {
              fieldGroupName
              largeImagePlacement
              photoGrid {
                fieldGroupName
                image {
                  alt: altText
                  imageUrl: sourceUrl
                  placeholder: sourceUrl(size: THUMBNAIL)
                }
              }
            }
            ... on Template_ThankYou_Thankyoupagecontent_BodySection_FullWidthPhotoLayout {
              fieldGroupName
              image {
                alt: altText
                imageUrl: sourceUrl
                placeholder: sourceUrl(size: THUMBNAIL)
              }
            }
          }
        }
      }
    }
  }
`
