Skip to content

Commit

Permalink
Merge branch 'master' into add-same-site-option-to-sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson authored May 23, 2021
2 parents 8a75c0d + d048db0 commit 7611881
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/pages/tutorials/embedded-mode-with-sqlite-nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Now that we have the Next.js starter with static files, let‘s embed Keystone i
Add the following Keystone dependencies to your project:

```bash
yarn add @keystone-next/keystone @keystone-next/admin-ui @keystone-next/fields
yarn add @keystone-next/keystone @keystone-next/fields
```

### Update .gitignore
Expand Down Expand Up @@ -165,7 +165,7 @@ Go ahead and add two post entries using your Admin UI, ensuring you only use `hy

## Query Keystone from Next.js

In order to query Keystone content we need to use the [`getStaticProps`](https://Next.js.org/docs/basic-features/data-fetching#getstaticprops-static-generation) and [`getStaticPaths`](https://Next.js.org/docs/basic-features/data-fetching#getstaticpaths-static-generation) functions in Next.js. Let’s overwrite the contents of `index.tsx` with the following to query posts from Keystone:
In order to query Keystone content we need to use the [`getStaticProps`](https://Next.js.org/docs/basic-features/data-fetching#getstaticprops-static-generation) and [`getStaticPaths`](https://Next.js.org/docs/basic-features/data-fetching#getstaticpaths-static-generation) functions in Next.js. Let’s overwrite the contents of `pages/index.tsx` with the following to query posts from Keystone:

```tsx
// pages/index.tsx
Expand Down Expand Up @@ -264,7 +264,7 @@ Run `yarn dev` again.

## Bonus: add the GraphQL API to the frontend

To get a read-only GraphQL API and playground in production, add `/pages/api/graphl.tsx`with the following:
To get a read-only GraphQL API and playground in production, add `/pages/api/graphql.tsx`with the following:

```tsx
// pages/api/graphql.tsx
Expand Down

0 comments on commit 7611881

Please sign in to comment.