Content Fragment Models, Persisted Queries and Content Packages content-fragment-models-persisted-queries-and-content-packages
Content Fragment Models and persisted GraphQL queries are content that you can create and update:
- Content Fragment Models:
/conf/<config>/settings/dam/cfm/models) - persisted GraphQL queries:
(/conf/<config>/settings/graphql/persistentQueries)
Many projects keep them in Git and ship them in a content package. The filter mode of such a package determines what happens (including models and queries created on author):
-
mode="replace"-
every node:
- covered by the filter
- but not contained within the package
- is deleted on author and publish whenever the package is installed during a Cloud Manager deployment
-
is the default mode when no mode is explicitly defined.
-
Persisted queries that depend on a model deleted in this way then fail with Schema provider failed.
FileVault applies the first filter entry when the root covers a path, so the order of filter entries matters. A broad entry such as /conf/<config> will take priority when placed before a more specific entry.
Recommended setups, depending on who owns the models and queries:
-
Maintained in Git:
- one filter root per model or persisted query the package owns, placed before broader
/confentries.
Then content created on author is not impacted. - If
confentries with a broader scope exist you can ensure those use a non-deleting mode, such asupdate_properties, or simply exclude specific author-owned content.
- one filter root per model or persisted query the package owns, placed before broader
-
Mixed ownership:
-
mode="update_properties": adds and updates but never deletes.The trade-off is that a model or field removed in Git stays in AEM.
-
-
Owned by authors:
-
Do not include them in the package, or only seed them once with
mode="merge_properties"Merge is not suitable for models maintained in Git, as existing nodes are left untouched and model changes are never deployed. FileVault also deprecated merge and update in favor of
merge_propertiesandupdate_properties.
-
Example for a project that maintains two models in Git and lets authors create others:
<filter root="/conf/wknd/settings/dam/cfm/models/article"/>
<filter root="/conf/wknd/settings/dam/cfm/models/author"/>
<filter root="/conf/wknd" mode="update_properties"/>
Further Resources further-resources
See also: