Enable Modules

Enable Next.js and Next.js GraphQL modules


  1. Visit /admin/modules.
  2. Enable the following modules: Next.js, Next.js GraphQL, GraphQL Compose: Edges, GraphQL Compose: Routes, GraphQL Compose: Users.

Configure GraphQL Compose

  1. Visit /admin/config/graphql_compose.
  2. Under the Content tab, enable "GraphQL", "Single Query", "Edge Query", & "Loading by Route" for the Article content type.
  3. Enable all of the fields for the Article content type.
  4. Do the same for the Basic page content type.
  5. Under the Users tab, do the same for the user entity.

Try GraphQL

If you visit /admin/config/graphql/servers/manage/graphql_compose_server/explorer on your site, you should see an example server created for you.

You can start testing GraphQL queries. Let's make our first request to fetch the first 5 articles.

Copy and paste the following in the query text input and click the Execute Query (▶) button.

query Articles {
nodeArticles(first: 5) {
nodes {
title
}
}
}

You should see the first 5 articles returned on the right.