---
title: "Using GraphQL in JSS Next.js apps"
slug: "using-graphql-in-jss-next-js-apps"
abstract: "Overview of using GraphQL in JSS Next.js apps, including how to choose GraphQL for layout and dictionary data fetching."
---
# Using GraphQL in JSS Next.js apps

JSS Next.jss apps enable a variety of data fetching options with GraphQL.

You can configure a new or existing JSS Next.js application to query the SitecoreAI GraphQL endpoints, instead of using the equivalent REST APIs.

- To create a Next.js application that uses the JSS GraphQL API for fetching layout and dictionary data, choose *GraphQL* when prompted during the app creation process.
- If you created your Next.js JSS app with REST as the data fetching method, you can reconfigure the sample JSS Next.js app to [use GraphQL instead](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/switch-between-rest-and-graphql-in-next-js-jss-apps.html "Switch between REST and GraphQL in Next.js JSS apps").

> [!note]
> In addition to fetching dictionary and layout data using the JSS GraphQL API, you can use GraphQL to [run queries at the component level](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/use-graphql-to-fetch-component-level-data-in-jss-next-js-apps.html "Use GraphQL to fetch component-level data in JSS Next.js apps").

To write type-protected code with rich IDE assists using GraphQL types and TypeScript static data typing, you can [introspect the GraphQL schema](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/introspecting-the-graphql-schema-in-jss-next-js-apps.html "Introspecting the GraphQL schema in JSS Next.js apps").