tree: c64be15af31b681d372d21dea581761fe6834b16 [path history] [tgz]
  1. README.md
  2. cxs-impl/
  3. graphql-playground/
  4. karaf-feature/
  5. pom.xml
graphql/README.md

Apache Unomi GraphQL API

Install

Installing GraphQL feature:

feature:repo-add mvn:org.apache.unomi/cdp-graphql-feature/1.5.0-SNAPSHOT/xml/features
feature:install cdp-graphql-feature

GraphQL Endpoint

You can then access the GraphQL endpoint at the following URL:

http://localhost:8181/graphql

Query example

operation::

query findEvents($filter: CDP_EventFilterInput) {
  cdp {
    findEvents(filter: $filter) {
      pageInfo {
        hasNextPage
        hasPreviousPage
      }
      edges {
        cursor
        node {
          id
          cdp_profileID {
            client {
              id
              title
            }
            id
            uri
          }
          __typename
        }
      }
    }
  }
}

variables::

{
  "filter": {
    "cdp_profileID_equals": ""
  }
}

Segment query operation:

query findSegments($segmentFilter: CDP_SegmentFilterInput) {
  cdp {
    findSegments(filter: $segmentFilter) {
      edges {
        node {
          id
          name
          view {
            name
          }
          profiles {
            profileIDs
          }
        }
      }
    }
  }
}

Manually validating against specification schema

Steps:

  1. Build aggregation schema using graphql-FIND_NAME_OF_TOOL
  2. Validate aggregated schema using https://github.com/kamilkisiela/graphql-inspector against running instance of Apache Unomi