Using GraphQL in JSS Next.js apps

Current version: 22.0

If you want to use GraphQL in your JSS Next.js app, you can initialize your application with all the infrastructure prepared for querying XM Cloud GraphQL endpoints.

To create a Next.js application that uses the JSS GraphQL API for fetching data, you choose GraphQL during the app creation process when prompted.

If you created your Next.js JSS app with REST as the data fetching method, you can use the sample JSS Next.js app to switch between REST and GraphQL.

To write type-protected code with rich IDE assists using GraphQL types and TypeScript static data typing, you can introspect the GraphQL schema.

In addition to getting page and layout data using the JSS GraphQL API, you can also use GraphQL to run GraphQL queries at the component level.

Do you have some feedback for us?

If you have suggestions for improving this article,