Skip to content

Instantly share code, notes, and snippets.

@AlaBenAicha
Created October 2, 2022 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlaBenAicha/8f991fa7da738de3ae4dcd3e36c4bd52 to your computer and use it in GitHub Desktop.
Save AlaBenAicha/8f991fa7da738de3ae4dcd3e36c4bd52 to your computer and use it in GitHub Desktop.
// pages/index.js
export async function getServerSideProps() {
const { data } = await client.query({
query: gql`
query Countries {
countries {
code
name
emoji
}
}
`,
});
return {
props: {
countries: data.countries.slice(0, 4),
},
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment