ImagingTools Core SDK
imtlicgql Namespace Reference

GraphQL API interface layer for the licensing domain model. More...

Detailed Description

GraphQL API interface layer for the licensing domain model.

Overview

The imtlicgql module provides a GraphQL-based web API layer over the imtlic licensing domain model. It exposes licensing functionality (Products, Features, Licenses, Accounts) through standardized GraphQL operations, enabling modern web applications, mobile apps, and other clients to query and manipulate licensing data.

Architecture

The module follows a three-tier adapter architecture:

Tier 1: Collection Controllers** (Bulk operations)

Design Patterns Used

Adapter Pattern

The module adapts the imtlic domain model to GraphQL:

Component Pattern (ACF)

All controllers are ACF components:

Delegate Pattern

Metadata delegates handle serialization:

Provider Pattern

Data providers abstract query handling:

Key Components

Collection Controllers

CFeatureCollectionControllerComp**

Object Controllers

CLicenseControllerComp**

Data Providers

CProductInfoProviderComp**

Metadata Delegates

CProductMetaInfoDelegateComp**

Specialized Components

CProductInfoFileGeneratorComp**

GraphQL Operations

Queries

Collection Queries:**

query {
products(filter: {...}, limit: 10, offset: 0) {
items { productId, name, description, features { ... } }
totalCount
}
licenses(productId: "...", filter: {...}) {
items { licenseId, name, features { ... } }
totalCount
}
features(productId: "...", optional: true) {
items { featureId, name, dependencies { ... } }
totalCount
}
}

Single Object Queries:**

query {
product(id: "product-123") {
productId, name, description
features { featureId, name }
licenses { licenseId, name }
}
feature(id: "feature-456") {
featureId, name, optional, permission
dependencies { featureId, name }
}
license(id: "license-789") {
licenseId, name
features { featureId, name }
product { productId, name }
}
}

Dependency Queries:**

query {
featureDependencies(featureId: "feature-456") {
directDependencies { featureId, name }
transitiveDependencies { featureId, name }
dependentFeatures { featureId, name }
}
}

Permission Queries:**

query {
permissions(productId: "product-123") {
featureId
isPermission
isEnabled
}
}

Mutations

Create Operations:**

mutation {
createProduct(input: {
name: "New Product"
description: "Product description"
features: [...]
}) {
productId
name
}
createLicense(input: {
productId: "product-123"
name: "Professional License"
features: ["feature-1", "feature-2"]
}) {
licenseId
name
}
createFeature(input: {
name: "Advanced Analytics"
optional: true
permission: false
}) {
featureId
name
}
}

Update Operations:**

mutation {
updateProduct(id: "product-123", input: {
name: "Updated Name"
features: [...]
}) {
productId
name
}
updateLicense(id: "license-789", input: {
name: "Updated License"
features: ["feature-1", "feature-3"]
}) {
licenseId
name
}
}

Delete Operations:**

mutation {
deleteProduct(id: "product-123") {
success
message
}
deleteLicense(id: "license-789") {
success
message
}
}

Import/Export Operations:**

mutation {
importProduct(file: $productFile) {
productId
name
}
exportProduct(id: "product-123") {
fileContent
mimeType
}
}

Subscriptions

If supported by the imtservergql framework:

subscription {
productUpdated(productId: "product-123") {
productId
name
updatedAt
}
licenseActivated(productInstanceId: "instance-456") {
licenseInstanceId
expirationDate
}
}

Data Flow Examples

Creating a Product via GraphQL

1. GraphQL Request (POST /graphql)
└─> imtservergql: Request parsing
└─> imtlicgql: CProductCollectionControllerComp
├─> Parse GraphQL input (product name, features, etc.)
├─> Create IProductInfo object via factory
├─> Create IFeatureInfo objects via factory
├─> Validate product structure
└─> imtlic: CProductControllerComp
└─> imtlicdb: CProductsDatabaseDelegateComp
└─> PostgreSQL: INSERT product JSON document
<── Product ID
<── IProductInfo object
<── GraphQL response data
<── JSON response
<── HTTP 200 OK with product data
Core licensing domain model providing feature-based product licensing and instance management.
Database persistence layer for licensing domain model using PostgreSQL with JSON documents.
GraphQL API interface layer for the licensing domain model.

Querying Features via GraphQL

1. GraphQL Query (POST /graphql)
└─> imtservergql: Query parsing
└─> imtlicgql: CFeatureCollectionControllerComp
├─> Parse query parameters (filters, pagination)
└─> imtlic: CFeatureInfoProviderComp
└─> imtlicdb: CFeatureDatabaseDelegateComp
└─> PostgreSQL: SELECT features WHERE ...
<── Feature JSON documents
<── IFeatureInfo objects
├─> Convert to GraphQL representation
└─> Apply pagination and filtering
<── GraphQL response data
<── JSON response
<── HTTP 200 OK with feature list

Permission Check via GraphQL

1. GraphQL Query (POST /graphql)
└─> imtservergql: Query parsing
└─> imtlicgql: CPermissionsProviderComp
└─> imtlic: CLicenseBasedRightsProviderComp
├─> Query active licenses
├─> Collect unlocked features
├─> Check feature dependencies
└─> Return permission status
<── Permission data
<── GraphQL permission response
<── JSON response
<── HTTP 200 OK with permissions

Integration Points

Integration with imtlic (Licensing Core)

Consumes imtlic Types:**

Integration with imtservergql (GraphQL Framework)

Extends Base Classes:**

Integration with imtlicdb (Database Layer)

Indirect Integration:**

Integration with Client Applications

Web Applications:**

Best Practices

Error Handling

Performance Optimization

Security Best Practices

Version Control

Additional Documentation

See also
imtlic For core licensing domain model
imtlicdb For database persistence layer
imtservergql For GraphQL framework infrastructure