brX GraphQL Service FAQ - Bloomreach Experience - Open Source CMS

brX GraphQL Service FAQ

This Bloomreach Experience Manager feature requires a standard or premium license. Please contact Bloomreach for more information.

Is the brX GraphQL Service required to run Bloomreach Commerce Accelerator?

In the Bloomreach Commerce Accelerator v14.x the brX GraphQL Service is an optional feature. Without it you can still run the Bloomreach Commerce Accelerator which is basically comprised of HstComponents, templates, webfiles, configurations, and content.

However, if you want to implement a new GraphQL client application such as an GraphQL based SPA, or if you want to enable the Open UI based Pickers interacting with the brX GraphQL Service, then you will need to install and configure the brX GraphQL Service additionally to your environment.

What kind of Commerce Connectors are supported?

The brX GraphQL Service reads the 'connector' request header from the clients to invoke the specific Commerce Connector implementation modules by the specified Connector ID. See Configure the brX GraphQL Service for all available Connector IDs.

How does the authentication/authorization work?

Every request to the brX GraphQL Service should provide an access token, and the brX GraphQL Service handles and validates the authentication and authorization through its internal Access Manager components. See Access Management for further detail.

How can I pass the faceting and filtering parameters to brSM API calls?

The API of Bloomreach Search & Merchandising supports the faceting and filtering parameter, fp. See the Faceting and filtering page for detail.

In order to pass the faceting and filtering parameter when making a GraphQL query request, you need to specify QueryHintInput.facetFieldFilters input argument.

For example, the following input will make a brSM API call with a URL like ...&fq=color: "red" OR "purple"&fq=size: "10".

query {
  findItemsByKeyword(text: "", limit: 200,
    queryHint:{
      facetFieldFilters: [
        { id: "color", values: ["red","purple"] },
        { id: "size", values: ["10"] }
      ]
    }
  ) {
    //...
    items {
      //...
    }
  }
}

How can I append or override request parameters for brSM API calls?

By default, GraphQL queries on the brX GraphQL Service against Bloomreach Search & Merchandising generates the backend API call URLs automatically to fulfill the requests. However, it also supports appending or overrriding any request parameters through QueryHintInput.params GraphQL query input argument.

For example, if you want to add the segement parameter and override the ref_url parameter when invoking brSM API URLs, then you can specify the QueryHintInput.params like the following example:

query {
  findItemsByKeyword(text: "", limit: 200,
    queryHint:{
      params: [
        { name: "segment", values: ["customer_tier:Premium"] },
        { name: "ref_url", values: ["http://www.example.com"] }
      ]
    }
  ) {
    //...
    items {
      //...
    }
  }
}

How can I include extra custom fields from the brSM API response?

By default, GraphQL queries on the brX GraphQL Service against Bloomreach Search & Merchandising extracts the fields defined in the GraphQL Schema automatically.

However, it also supports the optional configurations to include any extra custom fields by the BRSM_CUSTOM_ATTR_FIELDS and BRSM_CUSTOM_VARIANT_ATTR_FIELDS environment variables. See the Bloomreach Search & Merchandising Connector Configuration page for detail.

Furthermore, you can override the optional configurations by specifying QueryHintInput.customAttrFields and QueryHintInput.customVariantAttrFields when making GraphQL queries. For example, the following GraphQL query will make the response include the custom fields in the product item level, "brand" and "score", and the custom fields in the product variant level, "color_code":

query {
  findItemsByKeyword(text: "", limit: 200,
    queryHint: {
      customAttrFields: ["brand","score"],
      customVariantAttrFields: ["color_code"],
    }
  ) {
    //...
    items {
      //...
    }
  }
}

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?