# Wrangling Wild CMS Data with TypeScript

DevFeed: [Wrangling Wild CMS Data with TypeScript](<https://devfeed.tech/articles/wrangling-wild-cms-data-with-typescript-19127.md>)

Original publisher: [Read original article](<https://medium.com/rbi-tech/wrangling-wild-cms-data-with-typescript-a4bf0ac93467?source=rss----904782439303---4>)

Author: Pedro De Ona

Published: 2020-06-17T19:13:47Z

Content type: tutorial

Language: en

Sources: [RBI Tech](<https://devfeed.tech/sources/rbi-tech.md>)

Topics: [Content Management System](<https://devfeed.tech/topics/cms.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [Developer experience](<https://devfeed.tech/topics/developer-experience.md>)

Tags: [cms](<https://devfeed.tech/tags/cms.md>), [code](<https://devfeed.tech/tags/code.md>), [developer-experience](<https://devfeed.tech/tags/developer-experience.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

## AI overview

This developer article explains how RBI handles unpredictable, human-edited CMS data in real time. It discusses using TypeScript and GraphQL to improve confidence in shipped features and introduces optional chaining and utility types to reduce unexpected type errors when working with CMS-derived data.

## Source excerpt

Attempting to get the CMS under control Here at RBI, we've prioritized building a software platform that enables us to rapidly deliver high value. Sometimes this means literally delivering valuable food to your waiting stomachs, but for software engineers, it also means delivering a highly customizable web platform to our internal marketing teams, which allows us to drive dynamic customer experiences with minimal engineering effort. To that end, one of the products that we incorporate in our tech stack is a CMS. Classic Three-letter Acronym A CMS, or content management system, can be used in a variety of ways. At RBI we primarily use it to allow our digital marketing and product teams to control the content we deliver on our websites in real-time. This can be both a boon and a curse. On the one hand, it enables us to curate and create new experiences without needing to wait for deployment, but on the other, it means our code needs to be prepared to deal with some pretty unpredictable data. Oftentimes, this data is simply used to control the display of content to the user, but we also use it to drive some pretty core functionality like our digital menu, and this is where things can become problematic. CMS data is edited by humans and published in real-time, which means null or missing values in data are an unfortunate reality, and if not dealt with proactively, can lead to production failures. To that end, we rely on TypeScript and GraphQL as two technologies that increase our confidence in the features we ship. These tools can work hand-in-hand to create an excellent developer experience and help ensure you are writing sound and correct code. They Can, But Do They? That being said, sometimes the harsh reality of typed code can be more of a thorn in one's side than a brilliant shining beacon, guiding you to feature completion. Take the following interface, derived automatically from a GraphQL operation, as an example: https://medium.com/media/a0635a0c94916a7504311adc