Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composition/programmes becomes very unstable when using the preview API #473

Open
MortenHofft opened this issue Feb 2, 2024 · 0 comments
Labels
gbif-org related to gbif.org repo Prose Contentful driven pages

Comments

@MortenHofft
Copy link
Member

There is a lot of error 500's when using the preview API. At best you get a result every 10 times you try. Might be as simple as we are spamming the service.

E.g. on https://graphql.gbif-dev.org/graphql

  query Programme($key: String!) {
    programme(id: $key, preview: true) {
      title
      excerpt
      blocks {
        ...BlockItemDetails
      }
    }
  }

  fragment BlockItemDetails on BlockItem {
    __typename
    ... on HeaderBlock {
      id
      ...HeaderBlockDetails
    }
    ... on FeatureBlock {
      id
      ...FeatureBlockDetails
    }
    ... on FeaturedTextBlock {
      id
      ...FeaturedTextBlockDetails
    }
    ... on CarouselBlock {
      id
      ...CarouselBlockDetails
    }
    ... on MediaBlock {
      id
      ...MediaBlockDetails
    }
    ... on MediaCountBlock {
      id
      ...MediaCountBlockDetails
    }
    ... on CustomComponentBlock {
      id
      ...CustomComponentBlockDetails
    }
    ... on TextBlock {
      id
      ...TextBlockDetails
    }
  }

  fragment HeaderBlockDetails on HeaderBlock {
    __typename
    title
    type
    summary
    primaryImage {
      ...ArticleBanner
    }
  }

  fragment ArticleBanner on AssetImage {
    description
    title
    file {
      url
      details {
        image {
          width
          height
        }
      }
      normal: thumbor(width: 1200, height: 500)
      mobile: thumbor(width: 800, height: 400)
    }
  }

  fragment FeatureBlockDetails on FeatureBlock {
    __typename
    maxPerRow
    title
    body
    backgroundColour
    features {
      __typename
      ... on Feature {
        id
        title
        url
        primaryImage {
          ...ProseCardImg
        }
      }
      ... on News {
        id
        title
        excerpt
        optionalImg: primaryImage {
          ...ProseCardImg
        }
      }
      ... on DataUse {
        id
        title
        excerpt
        optionalImg: primaryImage {
          ...ProseCardImg
        }
      }
      ... on Event {
        id
        title
        excerpt
        start
        end
        optionalImg: primaryImage {
          ...ProseCardImg
        }
      }
    }
  }

  fragment ProseCardImg on AssetImage {
    file {
      mobile: thumbor(width: 500, height: 400)
    }
    title
    description
  }

  fragment FeaturedTextBlockDetails on FeaturedTextBlock {
    __typename
    id
    title
    body
    backgroundColour
  }

  fragment CarouselBlockDetails on CarouselBlock {
    __typename
    id
    title
    body
    backgroundColour
    features {
      __typename
      ... on MediaBlock {
        ...MediaBlockDetails
      }
      ... on MediaCountBlock {
        ...MediaCountBlockDetails
      }
    }
  }

  fragment MediaBlockDetails on MediaBlock {
    __typename
    id
    mediaTitle: title
    body
    optionalImg: primaryImage {
      file {
        mobile: thumbor(width: 500, height: 400)
      }
      title
      description
    }
    reverse
    subtitle
    backgroundColour
    roundImage
    callToAction {
      label
      url
    }
  }

  fragment MediaCountBlockDetails on MediaCountBlock {
    __typename
    id
    mediaTitle: title
    body
    optionalImg: primaryImage {
      file {
        mobile: thumbor(width: 500, height: 400)
      }
      title
      description
    }
    reverse
    subtitle
    titleCountPart
    backgroundColour
    roundImage
    callToAction {
      label
      url
    }
  }

  fragment CustomComponentBlockDetails on CustomComponentBlock {
    id
    componentType
    title
    width
    backgroundColour
    settings
  }

  fragment TextBlockDetails on TextBlock {
    title
    body
    hideTitle
    id
    backgroundColour
  }

variable

{
  "key": "82243"
}
@MortenHofft MortenHofft added gbif-org related to gbif.org repo Prose Contentful driven pages labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gbif-org related to gbif.org repo Prose Contentful driven pages
Projects
None yet
Development

No branches or pull requests

1 participant