close

Filter

loading table of contents...

Personalization Hub Manual / Version 2301

Table Of Contents

4.3.3 Extend GraphQL Queries by P13N Fragments

  1. Create a fragment file P13NExperience.fragment.graphql under packages/graphql-layer/src/queries/fragments

    fragment P13NExperience on P13NExperience {
      baseline {
        ...CMTeasable
      }
      variants {
        id
        target {
          ...CMTeasable
        }
      }
    }
  2. To enable the fragment preview, modify the file packages/graphql-layer/src/queries/FragmentPreview.query.graphql, to include the p13n experience fragment:

    query FragmentPreview($contentId: String!) {
      content {
        content(id: $contentId) {
          // other fragments here
          ...P13NExperience
        }
      }
    }
    
  3. Modify in the same way other fragments where the p13n experience can appear. For example, modify PageGridPlacement.fragment.graphql so that a p13n experience on a page grid is personalized.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.