In AEM We are not getting value "@type" from Content Fragment to Graphiql
We have a Jsontype Field in content Fragement where I am passing SEO Script
but apart from "@type" I am getting all values from CF to Graphiql
Solved! Go to Solution.
Views
Replies
Total Likes
@TyPe is a JSON-LD reserved key, and many Java/GraphQL pipelines (including AEM’s GraphQL JSON scalar/Jackson stack) treat keys starting with @ as unsafe (they’re used in polymorphic deserialization exploits). So AEM’s GraphQL layer drops or ignores @TyPe while passing the rest (name, url, image, etc.). That’s why you see everything except @TyPe in GraphiQL.
@TyPe is a JSON-LD reserved key, and many Java/GraphQL pipelines (including AEM’s GraphQL JSON scalar/Jackson stack) treat keys starting with @ as unsafe (they’re used in polymorphic deserialization exploits). So AEM’s GraphQL layer drops or ignores @TyPe while passing the rest (name, url, image, etc.). That’s why you see everything except @TyPe in GraphiQL.
Hi @RiyaSh10 ,
Rename the field in your Content Fragment model to something like type
(without @
). Then, in your frontend, map it back to @type
when rendering the JSON-LD for SEO.
seoData["@type"] = seoData["type"];
This avoids GraphQL limitations while still delivering valid structured data.
Thanks!
When you're not getting the @TyPe property from an AEM Content Fragment (CF) in GraphiQL, but you're getting other properties, the issue is most likely due to the fact that @ is a reserved character in GraphQL and/or JSON serialization contexts. AEM and GraphQL might be stripping or ignoring the property name starting with @.