{"version":3,"file":"component---src-pages-api-preview-js-b9422d07f87057b625ca.js","mappings":"oKAKA,MA2DMA,EAAqBC,EAAAA,EAAG;;;;;;;EAUxBC,EAAqBD,EAAAA,EAAG;;;;;;;EAQ9B,WAAeE,EAAAA,EAAAA,GAAY,CAAEC,QAASJ,EAAoBK,YAAaH,GAAvE,EA7EsBI,IAKpB,MAAMC,EAAWD,EAAMF,QACrBE,EAAMF,QAAQI,OAAOC,UAAUC,MAAM,GACrCJ,EAAMK,KAAKC,UAAUC,MACjB,MACJC,EAAK,QACLC,GACER,EACJ,OACES,EAAAA,cAAAA,EAAAA,SAAA,KACIA,EAAAA,cAAA,UAAKF,GACLE,EAAAA,cAAA,OAAKC,UAAU,eAAeC,wBAAyB,CAAEC,OAAQJ,KAClE,G","sources":["webpack://thecoalitionweb/./src/pages/api/preview.js"],"sourcesContent":["import React from \"react\";\nimport { graphql } from \"gatsby\";\nimport gql from 'graphql-tag';\nimport withPreview from '../../components/common/withPreview';\n\nconst PostTemplate = (props) => {\n /**\n * Determine if we're looking at a preview or live page.\n */\n\n const postData = props.preview ?\n props.preview.postBy.revisions.nodes[0] : // grab the first revision\n props.data.wpgraphql.post\n const {\n title,\n content,\n } = postData;\n return (\n <>\n

{title}

\n
\n \n )\n}\n\nexport const pageQuery = graphql`\n query($id: String) {\n page: wpSitePage(id: { eq: $id }) {\n title\n content\n # excerpt # No longer supported in WP v6\n formattedDate: date(formatString: \"MMM D, YYYY\")\n featuredImage {\n node {\n altText\n localFile {\n childImageSharp {\n gatsbyImageData(height: 260, placeholder: NONE, layout: FIXED)\n }\n }\n }\n }\n # toc { hasTableOfContents }\n # translated {\n # title\n # # excerpt # No longer supported in WP v6\n # formattedDate: date(formatString: \"MMM D, YYYY\")\n # locale {\n # locale\n # }\n # toc { hasTableOfContents }\n # }\n }\n site {\n siteMetadata {\n socialAlt\n siteUrl\n title\n }\n }\n }\n`\n\n//executes on page query\nconst PAGE_PREVIEW_QUERY = gql`\n query getPreview($id: ID!) {\n page(id: $id, idType: DATABASE_ID) {\n title\n content\n }\n }\n`;\n\n//executes on post query\nconst POST_PREVIEW_QUERY = gql`\n query getPreview($id: ID!) {\n post(id: $id, idType: DATABASE_ID) {\n title\n content\n }\n }\n`;\nexport default withPreview({ preview: PAGE_PREVIEW_QUERY, postPreview: POST_PREVIEW_QUERY })(PostTemplate);"],"names":["PAGE_PREVIEW_QUERY","gql","POST_PREVIEW_QUERY","withPreview","preview","postPreview","props","postData","postBy","revisions","nodes","data","wpgraphql","post","title","content","React","className","dangerouslySetInnerHTML","__html"],"sourceRoot":""}