Taxonomy

Taxonomy concepts IDs associated with entries and assets can be resolved under the contentfulMetadata field:

1query {
2 articleCollection {
3 items {
4 contentfulMetadata {
5 concepts {
6 id
7 }
8 }
9 }
10 }
11}

You can also filter entry queries by concept IDs that have been referenced directly. To filter the entries, you need to know the concept ID. It can be found inside the URL path in the web app.

To find the concept ID:

  1. Open the Organization settings & subscriptions.
  2. Navigate to the Taxonomy manager tab.
  3. Click on a concept. The ID is the final URL segment.
1query {
2 articleCollection(
3 where: {
4 contentfulMetadata: {
5 concepts_exists: true
6 concepts: {
7 id_contains_some: ["conceptId_3", "conceptId_4"]
8 id_contains_none: ["conceptId_1", "conceptId_2"]
9 id_contains_all: ["conceptId_0", "conceptId_00"]
10 }
11 }
12 }
13 ) {
14 items {
15 title
16 }
17 }
18}

Additionally, you can use the descendants filter to return any entries which have Taxonomy concepts that reference the supplied concept IDs or their children.

1query {
2 articleCollection(
3 where: {
4 contentfulMetadata: {
5 concepts: {
6 descendants: {
7 id_contains_some: ["conceptId_3", "conceptId_4"]
8 id_contains_none: ["conceptId_1", "conceptId_2"]
9 id_contains_all: ["conceptId_0", "conceptId_00"]
10 }
11 }
12 }
13 }
14 ) {
15 items {
16 title
17 }
18 }
19}