> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://contentful.com/developers/docs/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/_mcp/server. # Getting started with GraphQL > This guide explains how to get started with the GraphQL Content API that allows developers to shape API call responses tailored to their needs. ## GraphQL Content API [GraphQL](https://graphql.org/) is a flexible data query language that allows you to define API call responses to match your use case and technical needs (and much more). If you are new to the technology, here are some great educational resources to get you up to speed: * [Introduction to GraphQL (↗)](https://graphql.org/learn/) * [How to GraphQL (↗)](https://www.howtographql.com/) * [Guides and Best Practices (↗)](https://www.graphql.com/guides/) The GraphQL Content API supports both our Content Delivery API (CDA) and our Content Preview API (CPA). It offers a fully functional equivalent to the REST implementation of the two APIs. Every Contentful space comes with a GraphQL schema based on its content types. GraphQL endpoint filtering capabilities, schema generation process, and error codes are explained in the [Reference guide](/references/content-delivery-api/overview). > **Info** > > GraphQL Content API is available on all spaces for customers on [current pricing plans](https://www.contentful.com/pricing/). If you are on a legacy plan, contact [Customer Support](https://www.contentful.com/support/) to upgrade. ## Log Request ID When submitting support tickets, include the request ID along with other logs. Providing the request ID ensures faster and more effective responses to your inquiries. You can find it in the response header under `x-contentful-request-id`. ### Get request ID from Apollo Client Use the following code snippet to access response headers (request ID) from Apollo Client. ```javascript import { ApolloLink } from 'apollo-link'; import { createHttpLink } from 'apollo-link-http'; const httpLink = createHttpLink({ uri: 'http://localhost:3001/graphql' }); const afterwareLink = new ApolloLink((operation, forward) => { return forward(operation).map(response => { const context = operation.getContext(); const { response: { headers } } = context; if (headers) { const requestId = headers.get("X-Contentful-Request-Id"); if (requestId) { console.log("requestId", requestId); } } return response; }); }); // use with apollo-client const link = afterwareLink.concat(httpLink); ``` ## Demo content To help you explore the capabilities of the GraphQL API, a demo space populated with a sample content model and a complementary example application is set up: * [Github repo](https://github.com/contentful/the-example-app.nodejs#readme) * [Example app](https://the-example-app-nodejs.contentful.com/) You can query the demo space and examine its schema interactively, using the GraphiQL client embedded below (or working with it in [a new tab](https://graphql.contentful.com/content/v1/spaces/f8bqpb154z8p/explore?access_token=9d5de88248563ebc0d2ad688d0473f56fcd31c600e419d6c8962f6aed0150599\&query=%7B%0A%20%20lessonCollection\(where%3A%20%7B%20%0A%09%09OR%3A%20%5B%0A%09%09%09%7B%20title_contains%3A%20%22content%22%20%7D%2C%0A%09%09%09%7B%20title_contains%3A%20%22SDK%22%20%7D%0A%09%09%5D%0A%20%20%7D\)%20%7B%0A%20%20%20%20items%20%7B%0A%20%20%20%20%20%20title%0A%20%20%20%20%20%20slug%0A%20%20%20%20%20%20modulesCollection\(limit%3A%202%2C%20skip%3A%201\)%20%7B%0A%20%20%20%20%20%20%20%20total%0A%09%09%09%09limit%0A%09%09%09%09skip%0A%20%20%20%20%20%20%20%20items%20%7B%0A%20%20%20%20%20%20%20%20%20%20...imageUrl%0A%09%09%09%09%09...%20on%20LessonCodeSnippets%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20...%20on%20LessonCopy%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20sys%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%0Afragment%20imageUrl%20on%20LessonImage%20%7B%0A%20%20title%0A%20%20image%20%7B%0A%20%20%20%20url%0A%20%20%7D%0A%7D)). ## Next steps Now that you have covered the basics, learn how to implement GraphQL queries into your application by following language-specific starter guides: * [JavaScript tutorial (requires Apollo client)](/sdks/javascript/tutorials/using-contentful-graphql-with-javascript) * [iOS tutorial (requires Apollo iOS SDK)](/sdks/ios/tutorials/using-contentful-graphql-with-ios) * [Android tutorial (requires Apollo Android SDK)](/sdks/android/tutorials/using-contentful-graphql-with-android) For GraphQL API documentation and troubleshooting, please consult the reference guide: * [GraphQL Content API](/references/content-delivery-api/overview) > This guide explains how to get started with the GraphQL Content API that allows developers to shape API call responses tailored to their needs.