• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GraphQL for Camunda Platform 7

Community Extension Badge Camunda Platform 7 Lifecycle: Incubating

Camunda Platform GraphQL

Camunda Platform GraphQL is a Community Extension for Camunda Platform 7 that allows you to use GraphQL to query and mutate Process Engine data in a simple way.

Overview

Release 0.4.0

  • updated the resolvers to support the GraphQL Kickstart
  • GraphiQL endpoint default set to /graphiql
  • GraphQL endpoint default set to /graphql
  • Added historic queries
  • Added relationship between historic types
  • refactored the test setup and move test from webapp to extension
  • changed the app to execute on Spring Boot
  • Updated example
  • updated documentation

Spring Boot Camunda GraphQL Server Embbedded

Spring Boot (only supported on version 0.4.0 or higher)

In your Camunda Spring Boot project add the following dependencies

Gradle

Camunda Extension GraphQL

    implementation group: 'org.camunda.platform7.extension.graphql', name: 'camunda-platform-7-graphql', version: '0.5.0'

Spring Boot GraphQL Kickstart (the version 11.1.0 or higher)

    implementation group: 'com.graphql-java-kickstart', name: 'graphql-spring-boot-starter', version: '11.1.0'
    implementation group: 'com.graphql-java-kickstart', name: 'graphiql-spring-boot-starter', version: '11.1.0'
    implementation group: 'com.graphql-java-kickstart', name: 'graphql-java-tools', version: '11.0.1'

Maven

Camunda Extension GraphQL

    <dependency>
        <groupId>org.camunda.platform7.extension.graphql</groupId>
        <artifactId>camunda-platform-7-graphql</artifactId>
        <version>0.5.0</version>
    </dependency>

Spring Boot GraphQL Kickstart (the version 11.1.0 or higher)

    <dependency>
        <groupId>com.graphql-java-kickstart</groupId>
        <artifactId>graphql-spring-boot-starter</artifactId>
        <version>11.1.0</version>
    </dependency>

    <dependency>
        <groupId>com.graphql-java-kickstart</groupId>
        <artifactId>graphiql-spring-boot-starter</artifactId>
        <version>11.1.0</version>
    </dependency>

    <dependency>
        <groupId>com.graphql-java-kickstart</groupId>
        <artifactId>graphql-java-tools</artifactId>
        <version>11.0.1</version>
    </dependency>

Use the example if necessary.

By default the GraphQL and GraphiQL are available at the uri /graphql and /graphiql respectively, this configuration and others can be change by properties. The available settings can be consulted directly in the project of Spring Boot GraphQL Kick Start

Install the Camunda GraphQL Server on Tomcat or Wildfly

Build the GraphQL server

  1. Checkout or Clone this repository using Git
  2. Adapt extension/src/main/resources/application.properties:
  3. Build the project
    for Apache Tomcat: mvn clean package
    for JBoss WildFly use the profile wildfly: mvn clean package -Pwildfly

Tomcat installation

  • Get the latest Release (.war file) from the Camunda Repo
  • deploy it to your Tomcat server e.g. copy it to the Tomcat /webapps` folder

Wildfly installation

For WildFly you have to clone the project and build the .war file.
See chapter Build the GraphQL server.

Test the Installation

Access the GraphQL endpoint with a browser

Access the GraphQL endpoint with GraphiQL an in-browser IDE for exploring GraphQL

Other GraphQL clients

Beside the build-in GraphiQL you can use other GraphQL clients.
Basically...

  • ...point your GraphQL client to the GraphQL server endpoint:
    http://<server-name>:<PORT>/camunda-graphql/graphql
  • depending on the GraphQL server authentication settings you need to add Authentication Header to your requests

Examples of other GraphQL clients:


GraphQL Queries and Mutations

Query Tasks:

query tasks

Query Tasks using a Filter:

query tasks with filter

Query Process Instances:

query proceses

Query Process Instance Variables:

query proceses with vars

Query Task Variables:

query tasks with vars

Mutation
Assign a user to a task

setAssignee mutation

Mutation
Start a Process Instance with start variables
startProcessInstance

GraphQL Schemas and Types

A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.

Docs Schema

Docs Root Types

Currently defined queries:

Docs Queries

Currently defined mutations:

Docs Mutations

Defining / Extending the Camunda GraphQL Schema

We decided to use the Schema Definition Language (a GraphQL DSL) to define the Camunda GraphQL schema instead of coding it in Java.
The Schema Definition Language is very easy to understand.
For example this is the Type Definition of the Camunda Task:


graphqls TaskEntity

To get an understanding of Schemas please visit:

The Camunda GraphQL Schema is comprised of several schema files located at src/main/resource/*.graphqls.
This is an attempt to group GraphQL Type Definitions by topics

schema files overview

The so called Root Types serve as entry points for Queries and Mutations (in the future: Subscriptions etc.)

The Root Types schema file is src/main/resources/camunda.graphqls

Introspection

For interactive GraphQL code completion, build-time validation, GraphQL Schema stiching or other fancy things
any GraphQL client can use GraphQLs Introspection to retrieve the whole or parts of the Servers GraphQL Schema.

This is a possible and probably quite complete Introspection Query (from GraphQL Voyager):

query IntrospectionQuery {
    __schema {
      queryType { name }
      mutationType { name }
      subscriptionType { name }
      types {
        ...FullType
      }
      directives {
        name
        description
        locations
        args {
          ...InputValue
        }
      }
    }
  }

  fragment FullType on __Type {
    kind
    name
    description
    fields(includeDeprecated: true) {
      name
      description
      args {
        ...InputValue
      }
      type {
        ...TypeRef
      }
      isDeprecated
      deprecationReason
    }
    inputFields {
      ...InputValue
    }
    interfaces {
      ...TypeRef
    }
    enumValues(includeDeprecated: true) {
      name
      description
      isDeprecated
      deprecationReason
    }
    possibleTypes {
      ...TypeRef
    }
  }

  fragment InputValue on __InputValue {
    name
    description
    type { ...TypeRef }
    defaultValue
  }

  fragment TypeRef on __Type {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                }
              }
            }
          }
        }
      }
    }
  }



The response of the above Introspection Query can be pasted into tools like GraphQL Voyager as a Custom Schema and within seconds you get a graphical representation of your Schema, like so:

graphical GraphQL Schema

Awesome!

Authentication

The Camunda GraphQL server supports three Authentication methods:

Properties which manage authentication are:

  • auth.Filter
  • JWT.secret
  • JWT.issuer

These properties can be set as

  • JNDI attributes from java:comp/env
  • Java System properties
  • OS environment variables
  • properties in application.properties

E.g. if you are using Tomcat you can add them to catalina.properties.

If authentication is switched on (Basic or JWT) the Camunda GraphQL Server expects an Authorization-Header in the client request.
GraphQL clients let you define these request headers, e.g. the graphiql-app has a link _Edit HTTP headers

http headers 01

http headers 02

Basic Authentication

To switch to Basic Authentication use:
auth.Filter=BASIC

For example if you have a Camunda user demo with the password demo your Authorization-Header must be:
Key=Authorization
Value=Basic ZGVtbzpkZW1v (why?)


JWT (JSON Web Token) Authentication

To switch to JWT you must set three properties:
auth.Filter=JWT
JWT.secret=Whatever_Random_Secret_String_You_Prefer
JWT.issuer=Usualy_The_Name_Of_Your_Company

A JWT Authorization-Header could look like this:
Key=Authorization
Value=Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjYW11bmRhIiwiZXhwIjoxNDk3NzA4NjY3LCJpYXQiOjE0OTc2MjIyNjcsInVzZXJuYW1lIjoiZGVtbyJ9.Z-7NTGsHYqsEoc98yOgeT5LD9oGnei6jDPs-FQQhqDw

Important!
The GraphQL Server can validate existing JSON Web Token presented in the Authorization-Header based on
JWT.secret
JWT.issuer
(future releases will support private/public key)
but cannot provide or issue them. There is no login functionality "out of the box"
There is no JWT provider build into Camunda GraphQL server, because that does not belong to GraphQL at all.

Workaround (in case you do not have a JWT provider)
To create valid JWTs you need a JWT provider.
A JWT provider for Camunda can be found here: https://github.com/Loydl/camunda-jwt-provider

The JWT.secret and JWT.issuer settings of the

  • JWT provider
  • and the Camunda GraphQL server

must be the same, otherwise the JWT cannot be validated and user do not get authenticated.
(BTW, this is also a good option to basically implement Single Sign On).

Further information about JWT: https://jwt.io

No Authentication

To switch off authentication you simply set:
auth.Filter=NO
or delete this property, e.g. in catalina.properties put it in a comment:
#auth.Filter=xyz
(If the value of auth.Filter is equal JWT or BASIC than authentication is switched on, otherwise it is switched off.)

Goals

  • expose the complete Camunda Java API in GraphQL
  • build modern web and mobile clients for Camunda Platform (freedom to choose your GUI library)
  • build GraphQL-based, customizable versions of Tasklist, Cockpit, Admin
  • Camunda BPM as part of a micro-services architecture. Service accessible through a GraphQL endpoint
    (using GraphQL Schema Stiching to combine many GraphQL endpoints to one GraphQL API gateway)
  • Realtime GUIs (add GraphQL subscriptions to Camunda GraphQL)

Camunda Forum Thread (initial)

https://forum.camunda.org/t/developing-the-camunda-graphql-extension

More Repositories

1

spring-zeebe

Easily use the Zeebe Java Client in your Spring or Spring Boot projects
Java
204
star
2

zeebe-simple-monitor

A monitoring application to show insides of Zeebe for developers
HTML
168
star
3

zeebe-client-node-js

Node.js client library for Zeebe Microservices Orchestration Engine
TypeScript
152
star
4

awesome-camunda-platform-8

Awesome Camunda Platform 8 Projects
128
star
5

camunda-platform-7-keycloak

Camunda Keycloak Identity Provider Plugin
Java
126
star
6

zeebe-docker-compose

Zeebe with Operate Docker Compose configuration
99
star
7

kafka-connect-zeebe

Kafka Connect for Zeebe.io
Java
96
star
8

camunda-platform-7-mail

Mail connectors for Camunda Platform 7
Java
85
star
9

pyzeebe

Python client for Zeebe workflow engine
Python
83
star
10

camunda-platform-7-camel

Community Extension to add Apache Camel support for Camunda Platform 7
Java
82
star
11

camunda-platform-7-reactor

Event Driven process applications
Java
78
star
12

zeebe-client-csharp

Contains an Zeebe C# client implementation.
C#
76
star
13

camunda-process-test-coverage

Community Extension Helper library to visualize which parts of a BPMN process have been covered by a process test.
Kotlin
75
star
14

micronaut-camunda-platform-7

Integration between Micronaut and Camunda (Workflow Engine). We configure Camunda with sensible defaults, so that you can get started with minimum configuration: simply add a dependency in your Micronaut project to embed the workflow engine!
Java
75
star
15

camunda-platform-7-rest-client-spring-boot

Camunda REST client for Java Spring Boot Projects, implemented using Feign
Kotlin
73
star
16

camunda-external-task-client-python3

Camunda 7 External Task Client in Python
Python
73
star
17

camunda-platform-scenario

Easily execute Camunda process scenarios and verify your expectations with Given/Then/When style tests.
Java
64
star
18

zeeqs

GraphQL API for Zeebe data
Kotlin
62
star
19

zeebe-play

Play and explore BPMN processes on Zeebe
JavaScript
61
star
20

camunda-platform-7-rest-client-java

Community extension to generate a Java client from the provided Camunda 7 OpenAPI descitpion and also warp it into Spring Boot
Java
57
star
21

camunda-bpm-php-sdk

PHP SDK for camunda BPM
PHP
53
star
22

camunda-dmn-xlsx

Convert XLSX to DMN 1.1 decision tables or deploy them to the BPM platform right away
Java
47
star
23

zeebe-simple-tasklist

Zeebe worker to manage manual/user tasks
Java
46
star
24

zeebe-hazelcast-exporter

Export events from Zeebe to Hazelcast
Java
44
star
25

camunda-8-examples

Java
41
star
26

camunda-7-community-helm

Camunda public Kubernetes Helm repo and charts
YAML
39
star
27

camunda-8-connectors

A curated list of awesome Camunda Platform 8 projects, driven by the community, partners, and Camundi.
39
star
28

zeebe-http-worker

Zeebe worker for HTTP calls
Java
38
star
29

camunda-platform-7-mockito

Provides mock helpers to register delegate/listener mocks while testing processes
Java
38
star
30

Camunda-7-Spring-Boot-Tutorial-Lafayette

This project is used as part of a video tutorial in order to show how you can use various features of Camunda in a spring boot application
Java
36
star
31

zeebe-kafka-exporter

Export events from Zeebe to Kafka
Java
36
star
32

awesome-camunda-7-external-clients

Awesome Camunda External Clients
35
star
33

camunda-bpm-elasticsearch

ElasticSearch plugin for camunda bpm @
Java
30
star
34

zeebe-spec

A tool to run tests for BPMN processes on Zeebe
Kotlin
29
star
35

bpmn-driven-testing

Visually select paths through a BPMN process as test cases. Generate and enrich those test cases for easier unit testing of your process implementations.
Java
29
star
36

camunda-platform-7-custom-batch

using the camunda batch execution for custom batch runs
Java
29
star
37

camunda-7-to-8-migration

A collection of tools to support migration from Camunda Platform 7 to Camunda Platform 8
Java
29
star
38

Make-Rest-Calls-From-Camunda-7-Example

This is an example application which demonstrates the main ways in which a rest call can ben made by from a Camunda BPMN process.
Java
29
star
39

micronaut-zeebe-client

This open source project allows you to easily implement Zeebe Worker with Micronaut: simply add a dependency in your Micronaut project
Java
26
star
40

camunda-tasklist-client-java

Java client for the Tasklist API of Camunda Platform 8
Java
25
star
41

eze

Embedded Zeebe Engine
Kotlin
24
star
42

node-red-contrib-zeebe

Zeebe nodes for Node-RED
JavaScript
24
star
43

camunda-8-lowcode-ui-template

A Camunda 8 client with a custom tasklist integrated with a custom version of form-js
TypeScript
24
star
44

camunda-7-cockpit-plugin-statistics

camunda BPM community extension providing a statistics plugin for camunda Cockpit
JavaScript
24
star
45

zeebe-test-container

Zeebe Test Container
Java
22
star
46

camunda-platform-7-osgi

OSGi integration for Camunda Platform 7
Java
22
star
47

community

Welcome to the Camunda Community Hub! This is the starting point for those interested in joining and contributing to the Camunda Community Hub.
21
star
48

script-connector

Zeebe worker for script evaluation
Java
21
star
49

slack-archivist

A Slackbot that archives threads to Discourse and suggests previous threads that may answer a user question
TypeScript
21
star
50

camunda-dmn-tester

Project to test (Camunda)-DMN Tables.
Scala
21
star
51

zeebest

A zeebe rust client
Rust
20
star
52

camunda-8-benchmark

Helper to create benchmarks for Camunda Platform 8 and Zeebe
Java
20
star
53

micronaut-camunda-external-client

This open source project allows you to easily integrate Camunda's External Task Clients into Micronaut projects: simply add a dependency in your Micronaut project
Java
19
star
54

camunda-8-helm-profiles

A collection of Helm values files for the Camunda Platform 8 Helm Chart
Makefile
19
star
55

camunda-7-migration

Fluent Java API for Camunda Platform 7 process instance migration
Java
19
star
56

camunda-8-code-studio

This repository contains all assets for the Camunda Platform 8 related Code Studio events
C#
18
star
57

email-incident-notification-plugin

Java
18
star
58

camunda-8-api-postman-collection

Collect all public API for Camunda Platform 8 into a single Postman collection to be easily used by folks
17
star
59

camunda-platform-7-grpc-external-task

gRPC API for Camunda BPM Runtime ExternalTasks
Java
17
star
60

camunda-bpm-junit5

This project was moved to https://github.com/camunda/camunda-bpm-platform/tree/master/test-utils/junit5-extension
Java
16
star
61

zeebe-cluster-helm

Base Zeebe Cluster HELM Chart
Mustache
16
star
62

camunda-modeler-plugin-rename-technical-ids

JavaScript
15
star
63

camunda-engine-cassandra

Cassandra Persistence for Camunda (Community Extension)
Java
15
star
64

CamundaCodeStudioOne

This is the code need to follow along with the Camunda Code Studo event
Java
14
star
65

zeebe-redis-exporter

Export events from Zeebe to Redis
Java
13
star
66

awesome-Camunda-and-Robotframework-projects

A collection of projects around the combination of Robotframework and Camunda
13
star
67

zeebe-cloudevents-router

Zeebe CloudEvents Router
Java
13
star
68

zeebe-dmn-worker

Zeebe worker for DMN decision evaluation
Java
13
star
69

zeebe-helm

Public Zeebe K8s HELM Charts
Shell
13
star
70

zeebe-cherry-runtime

The Cherry project is a framework to administrate workers and connectors
Java
12
star
71

Camunda-7-Run-Tutorial-Lafayette

This is tutorial which helps people understand how to build and deploy processes to the Camunda Platform Run distrobution.
JavaScript
12
star
72

camunda-acm-plugin

Community Extension providing a Cockpit Plugin for Adaptive Case Management (ACM)
JavaScript
11
star
73

zeebe-clickhouse-exporter

Export events from Zeebe to ClickHouse
Java
11
star
74

camunda-platform-8-github-action

A GitHub action for Zeebe and Camunda Platform 8 to create workflow instances and publish messages
TypeScript
11
star
75

terraform-provider-camunda

A Terraform provider to configure Camunda SaaS
Go
10
star
76

camunda-bpm-jbehave

camunda BPM community extension providing support for JBehave testing framework
Java
10
star
77

zeebe-worker-java-testutils

Utilities to test Zeebe workers implemented in Java
Java
10
star
78

camunda-operate-client-java

Java client for the Operate API of Camunda Platform 8
Java
10
star
79

camunda-7-webapp-translations

The extension provides translations in 16 different languages (e.g., Japanese, Danish, Nepali, etc.) for Camunda 7 Tasklist, Cockpit Basic/Full, and Admin.
10
star
80

camunda-jenkins-shared-library

Camunda community Jenkins Shared Library
Groovy
10
star
81

element-template-svg-converter

A library of converted SVGs for use in Element Templates along with converters to create your own custom icons
Java
9
star
82

zbctl-via-npm

Zeebe CLI via NPM
JavaScript
9
star
83

kotlin-coworker

Zeebe Worker with Kotlin coroutines
Kotlin
9
star
84

connector-sdk-nodejs

Camunda 8 Connector SDK for Node.js
TypeScript
9
star
85

CsvToDmnConverter

Java
8
star
86

DelphiZeeBeClient

Delphi client for ZeeBe gRPC interface
Pascal
8
star
87

camunda-modeler-plugin-color-picker

JavaScript
8
star
88

camunda-modeler-plugin-usertask-generatedform-preview

JavaScript
8
star
89

zeebe-lambda-connector

POC for a worker connecting to AWS Lambda for serverless function orchestration
Java
8
star
90

openapi-connector-template-generator

Mustache
8
star
91

camunda-cloud-go-client

Camunda Platform 8 Console CLI and Go Library
Go
8
star
92

camunda-cloud-docker-compose

A docker compose file to stand up a complete Camunda Cloud environment locally comprising of Zeebe, Elasticsearch, Operate, Tasklist, Identity, and Optimize.
8
star
93

zeebe-exporter-protobuf

Protobuf schema definition for Zeebe exporters to exchange/transmit records
Java
8
star
94

zeebe-client-csharp-bootstrap

Zeebe Job handlers are automaticly recognized and boostrapped via a .Net HostedService.
C#
8
star
95

camunda-space-traders

Camunda SpaceTraders SDK
Kotlin
7
star
96

zeebe-client-csharp-accelerator

C# Zeebe Job Workers made easy - boostrapped via a .NET HostedService and added to DI
C#
7
star
97

vanillabp-camunda8-adapter

This is an adapter which implements the binding of the VanillaBP SPI in order to run business processes using Camunda 8.
Java
7
star
98

zeebe-full-helm

Zeebe Cluster + Operate Parent HELM Chart
7
star
99

zeebe-keycloak-interceptor

Keycloak integration to secure Zeebe Gateways
Java
7
star
100

zeebe-operator

Zeebe Kubernetes Operator
Go
7
star