Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM graphQL syntax doesn't match graphql documentation?

Avatar

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile

Avatar
Ignite 10
Level 4
TB3dock
Level 4

Likes

34 likes

Total Posts

203 posts

Correct Reply

4 solutions
Top badges earned
Ignite 10
Boost 25
Give Back 25
Validate 10
Validate 1
View profile
TB3dock
Level 4

31-03-2021

According to pretty much all graphql documentation (read: first 3 pages of google search)

I should be able to use syntax like:

{
  hero {
      name
   }
}

and

{
   human(id: "1000") {
      name
     height
  }
}

 

The first page of https://graphql.org/ has examples like:

{
  project(name: "GraphQL") {
     tagline
  }
}

However, this syntax, and the majority of the grapql features, simply don't work with AEM for some unknown reason.

 

AEM wknd has an Content Fragment Model called Adventure with fields with the following property names:

  • adventureTitle
  • adventureType
  • etc. 

So I should be able to do this:

  Adventure {

      adventureTitle

  }

}

 

But this doesnt work. The only thing which works is something like:

 

{
  adventureList {
      items {
         adventureType
         adventureTitle
         adventurePrice
         adventureActivity
   }
}

Its using a syntax which doesnt seem to be mentioned in any grapql documentation outside of AEM.

 

named queries, string comparisons, static parameters, all the documented features and syntax of graphql doesnt seem to work with graphql on AEM.

 

Is it using its own dialect?

-

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 1
Employee
Christian_Meyer
Employee

Like

1 like

Total Posts

2 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
Boost 1
View profile

Avatar
Affirm 1
Employee
Christian_Meyer
Employee

Like

1 like

Total Posts

2 posts

Correct Reply

1 solution
Top badges earned
Affirm 1
Boost 1
View profile
Christian_Meyer
Employee

08-04-2021

I believe there's no standard syntax for what we call the "top level functions" - so we decided to go with "adventureList" & "adventureByPath" to be more explicit with the query names.

On the other side, the intermediate "item" and "items" nodes were created to allow the introduction of sibling properties that would be common to all models (like "_references", which contains the hydrated content & fragment references). 

Answers (2)

Answers (2)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,114 likes

Total Posts

3,148 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,114 likes

Total Posts

3,148 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

01-04-2021

The Adobe documentation mentions on https://experienceleague.adobe.com/docs/experience-manager-cloud-service/assets/admin/graphql-api-co... that the used library is the one from graphql.org, so I don't think that this is an Adobe dialect.