Skip to content

Instantly share code, notes, and snippets.

@ashmore11
Created January 5, 2021 13:45
Show Gist options
  • Save ashmore11/04af5c547e250b09d8475d523a17f81b to your computer and use it in GitHub Desktop.
Save ashmore11/04af5c547e250b09d8475d523a17f81b to your computer and use it in GitHub Desktop.
Next Strapi Cloud Run (next.js getStaticProps)
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