Created
January 5, 2021 13:45
-
-
Save ashmore11/04af5c547e250b09d8475d523a17f81b to your computer and use it in GitHub Desktop.
Next Strapi Cloud Run (next.js getStaticProps)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { request, gql } from 'graphql-request' | |
export const getStaticProps = async () => { | |
const query = gql` | |
{ | |
test { | |
title | |
} | |
} | |
`; | |
const data = await request(process.env.CMS_GRAPHQL_URL, query); | |
return { | |
props: data.test, | |
revalidate: 10, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment