---
title: "Use integrated GraphQL in a JSS app"
slug: "use-integrated-graphql-in-a-jss-app"
abstract: "Use integrated GraphQL queries to customize layout data"
---
# Use integrated GraphQL in a JSS app

When the Sitecore Layout Service renders a page, it returns a JSON representation of the layout of the page and the data for each component. Normally, the component data is a set of fields from the Sitecore datasource item. Integrated GraphQL lets you re-shape this into a GraphQL query result.

To use Integrated GraphQL:

1. Define a [Sitecore GraphQL API endpoint](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/sitecore-graphql-api.html "Sitecore GraphQL API") that has the schema you want to query. Get this working first, and play with the schema using GraphiQL (`$endpointUrl/ui`) to ensure it works. Generally, the endpoint is defined using the JSS app's config patch file (stored under `/sitecore/config` in the JSS app, but can also be stored with Sitecore).
2. Attach your JSS app to the GraphQL endpoint. On the JSS `<app>` definition, add a `graphQLEndpoint` property pointing to the URL of the endpoint. For example, `<app name="MyJssApp" graphQLEndpoint="/sitecore/api/jssbasicapp" />`.

You can use Integrated GraphQL in Sitecore-first apps and [in code-first apps](https://doc.sitecore.com/xp/en/developers/hd/22/sitecore-headless-development/customize-layout-data-with-integrated-graphql-queries-in-code-first-jss-apps.html "Customize layout data with Integrated GraphQL queries in code-first JSS apps").