You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/19 18:36:21 UTC

[camel] 01/03: CAMEL-12854: Provide a GraphQL component

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 542e3de47b6495aba1d504572aafda2ef37b2ebc
Author: Alexandre Kieling <al...@gmail.com>
AuthorDate: Sun Oct 6 19:57:46 2019 -0300

    CAMEL-12854: Provide a GraphQL component
---
 apache-camel/pom.xml                               |  10 +
 apache-camel/src/main/descriptors/common-bin.xml   |   2 +
 bom/camel-bom/pom.xml                              |  10 +
 components/camel-graphql/pom.xml                   |  63 ++++++
 .../src/main/docs/graphql-component.adoc           | 188 +++++++++++++++++
 .../camel/component/graphql/GraphqlComponent.java  |  37 ++++
 .../camel/component/graphql/GraphqlEndpoint.java   | 225 +++++++++++++++++++++
 .../camel/component/graphql/GraphqlProducer.java   |  76 +++++++
 .../component/graphql/GraphqlComponentTest.java    | 145 +++++++++++++
 .../component/graphql/GraphqlProducerTest.java     |  42 ++++
 .../camel/component/graphql/server/Author.java     |  35 ++++
 .../camel/component/graphql/server/Book.java       |  53 +++++
 .../camel/component/graphql/server/BookInput.java  |  55 +++++
 .../graphql/server/GraphqlDataFetchers.java        |  66 ++++++
 .../component/graphql/server/GraphqlFactory.java   |  59 ++++++
 .../component/graphql/server/GraphqlServer.java    | 100 +++++++++
 .../src/test/resources/addBookMutation.graphql     |   9 +
 .../src/test/resources/addBookMutationResult.json  |  11 +
 .../src/test/resources/bookByIdQueryResult.json    |  11 +
 .../src/test/resources/booksQuery.graphql          |   6 +
 .../src/test/resources/booksQueryResult.json       |  18 ++
 .../src/test/resources/multipleQueries.graphql     |  16 ++
 .../src/test/resources/schema.graphqls             |  29 +++
 components/pom.xml                                 |   1 +
 .../dsl/GraphqlEndpointBuilderFactory.java         | 224 ++++++++++++++++++++
 docs/components/modules/ROOT/nav.adoc              |   1 +
 .../modules/ROOT/pages/graphql-component.adoc      | 189 +++++++++++++++++
 parent/pom.xml                                     |  21 +-
 .../camel-graphql-starter/pom.xml                  |  61 ++++++
 .../GraphqlComponentAutoConfiguration.java         | 128 ++++++++++++
 .../springboot/GraphqlComponentConfiguration.java  |  52 +++++
 .../src/main/resources/META-INF/LICENSE.txt        | 203 +++++++++++++++++++
 .../src/main/resources/META-INF/NOTICE.txt         |  11 +
 .../src/main/resources/META-INF/spring.factories   |  19 ++
 .../src/main/resources/META-INF/spring.provides    |  17 ++
 platforms/spring-boot/components-starter/pom.xml   |   1 +
 .../camel-spring-boot-dependencies/pom.xml         |  10 +
 37 files changed, 2199 insertions(+), 5 deletions(-)

diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml
index 3b0d071..b43d980 100644
--- a/apache-camel/pom.xml
+++ b/apache-camel/pom.xml
@@ -663,6 +663,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-graphql</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-grok</artifactId>
       <version>${project.version}</version>
     </dependency>
@@ -2207,6 +2212,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-graphql-starter</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-grok-starter</artifactId>
       <version>${project.version}</version>
     </dependency>
diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml
index 1696ff7..45a6c0a 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -153,6 +153,7 @@
         <include>org.apache.camel:camel-google-sheets</include>
         <include>org.apache.camel:camel-gora</include>
         <include>org.apache.camel:camel-grape</include>
+        <include>org.apache.camel:camel-graphql</include>
         <include>org.apache.camel:camel-grok</include>
         <include>org.apache.camel:camel-groovy</include>
         <include>org.apache.camel:camel-grpc</include>
@@ -501,6 +502,7 @@
         <include>org.apache.camel:camel-google-sheets-starter</include>
         <include>org.apache.camel:camel-gora-starter</include>
         <include>org.apache.camel:camel-grape-starter</include>
+        <include>org.apache.camel:camel-graphql-starter</include>
         <include>org.apache.camel:camel-grok-starter</include>
         <include>org.apache.camel:camel-groovy-starter</include>
         <include>org.apache.camel:camel-grpc-starter</include>
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index c085676..5024615 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1214,6 +1214,16 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql-starter</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-grok</artifactId>
         <version>${project.version}</version>
       </dependency>
diff --git a/components/camel-graphql/pom.xml b/components/camel-graphql/pom.xml
new file mode 100644
index 0000000..ab5cb9a
--- /dev/null
+++ b/components/camel-graphql/pom.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-graphql</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Camel :: GraphQL</name>
+    <description>A Camel GraphQL Component</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-support</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+
+        <!-- for testing -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.graphql-java</groupId>
+            <artifactId>graphql-java</artifactId>
+            <version>${graphql-java-version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/components/camel-graphql/src/main/docs/graphql-component.adoc b/components/camel-graphql/src/main/docs/graphql-component.adoc
new file mode 100644
index 0000000..206e40b
--- /dev/null
+++ b/components/camel-graphql/src/main/docs/graphql-component.adoc
@@ -0,0 +1,188 @@
+[[graphql-component]]
+= GraphQL Component
+
+*Available as of Camel version 3.0*
+
+The GraphQL component is a GraphQL client that communicates over HTTP and supports queries and mutations, but not subscriptions. It uses the https://hc.apache.org/httpcomponents-client-4.5.x/index.html[Apache HttpClient] library.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-graphql</artifactId>
+    <version>x.x.x</version>
+  <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+== GraphQL Endpoint URI
+
+// endpoint options: START
+The GraphQL endpoint is configured using URI syntax:
+
+----
+graphql:httpUri?options
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *httpUri* | *Required* The GraphQL server URI. |  | URI
+|===
+
+
+=== Query Parameters (11 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *accessToken* (producer) | The access token sent in the Authorization header. |  | String
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *operationName* (producer) | The query or mutation name. |  | String
+| *password* (producer) | The password for Basic authentication. |  | String
+| *proxyHost* (producer) | The proxy host in the format hostname:port. |  | String
+| *query* (producer) | The query text. |  | String
+| *queryFile* (producer) | The query file name located in the classpath. |  | String
+| *username* (producer) | The username for Basic authentication. |  | String
+| *variables* (producer) | The JsonObject instance containing the operation variables. |  | JsonObject
+| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+|===
+// endpoint options: END
+
+== GraphQL Component Options
+
+// component options: START
+The GraphQL component supports 1 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+|===
+// component options: END
+
+// spring-boot-auto-configure options: START
+== Spring Boot Auto-Configuration
+
+When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:
+
+[source,xml]
+----
+<dependency>
+  <groupId>org.apache.camel</groupId>
+  <artifactId>camel-graphql-starter</artifactId>
+  <version>x.x.x</version>
+  <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+
+The component supports 2 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *camel.component.graphql.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
+| *camel.component.graphql.enabled* | Whether to enable auto configuration of the graphql component. This is enabled by default. |  | Boolean
+|===
+// spring-boot-auto-configure options: END
+
+== Message Body
+
+Camel will store the GraphQL response from the external server on the OUT message body. All headers from the IN message will be copied to the OUT message, so headers are preserved during routing. Additionally Camel will add the HTTP response headers as well to the OUT message headers.
+
+== Examples
+
+=== Queries
+
+Simple queries can be defined directly in the URI:
+
+[source,java]
+----
+from("direct:start")
+    .to("graphql://http://example.com/graphql?query={books{id name}}")
+----
+
+More complex queries can be stored in a file and referenced in the URI:
+
+[source,java]
+----
+# booksQuery.graphql
+query Books {
+  books {
+    id
+    name
+  }
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=booksQuery.graphql")
+----
+
+When the query file defines multiple operations, it's required to specify which one should be executed:
+
+[source,java]
+----
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=multipleQueries.graphql&operationName=Books")
+----
+
+Queries with variables need to reference a JsonObject instance from the registry:
+
+[source,java]
+----
+@BindToRegistry("bookByIdQueryVariables")
+public JsonObject bookByIdQueryVariables() {
+    JsonObject variables = new JsonObject();
+    variables.put("id", "book-1");
+    return variables;
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=bookByIdQuery.graphql&variables=#bookByIdQueryVariables")
+----
+
+=== Mutations
+
+Mutations are like queries with variables. They specify a query and a reference to a variables bean:
+
+[source,java]
+----
+# addBookMutation.graphql
+mutation AddBook($bookInput: BookInput) {
+  addBook(bookInput: $bookInput) {
+    id
+    name
+    author {
+      name
+    }
+  }
+}
+
+@BindToRegistry("addBookMutationVariables")
+public JsonObject addBookMutationVariables() {
+    JsonObject bookInput = new JsonObject();
+    bookInput.put("name", "Typee");
+    bookInput.put("authorId", "author-2");
+    JsonObject variables = new JsonObject();
+    variables.put("bookInput", bookInput);
+    return variables;
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?graphql?queryFile=addBookMutation.graphql&variables=#addBookMutationVariables")
+----
diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java
new file mode 100644
index 0000000..4d346cd
--- /dev/null
+++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+
+@Component("graphql")
+public class GraphqlComponent extends DefaultComponent {
+
+    @Override
+    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+        GraphqlEndpoint endpoint = new GraphqlEndpoint(uri, this);
+        endpoint.setHttpUri(new URI(remaining));
+        setProperties(endpoint, parameters);
+        return endpoint;
+    }
+
+}
diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java
new file mode 100644
index 0000000..adb5e97
--- /dev/null
+++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java
@@ -0,0 +1,225 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.json.JsonObject;
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.utils.HttpClientUtils;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicHeader;
+
+@UriEndpoint(firstVersion = "3.0.0", scheme = "graphql", title = "GraphQL", syntax = "graphql:httpUri?options", label = "graphql", producerOnly = true)
+public class GraphqlEndpoint extends DefaultEndpoint {
+
+    @UriPath
+    @Metadata(required = true)
+    private URI httpUri;
+    @UriParam
+    private String proxyHost;
+    @UriParam
+    private String accessToken;
+    @UriParam
+    private String username;
+    @UriParam
+    private String password;
+    @UriParam
+    private String query;
+    @UriParam
+    private String queryFile;
+    @UriParam
+    private String operationName;
+    @UriParam
+    private JsonObject variables;
+
+    private CloseableHttpClient httpClient;
+
+    public GraphqlEndpoint(String uri, Component component) {
+        super(uri, component);
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        HttpClientUtils.closeQuietly(this.httpClient);
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new GraphqlProducer(this);
+    }
+
+    @Override
+    public Consumer createConsumer(Processor processor) throws Exception {
+        throw new UnsupportedOperationException("You cannot receive messages at this endpoint: " + getEndpointUri());
+    }
+
+    public CloseableHttpClient getHttpclient() {
+        if (httpClient == null) {
+            this.httpClient = createHttpClient();
+        }
+        return httpClient;
+    }
+
+    private CloseableHttpClient createHttpClient() {
+        HttpClientBuilder httpClientBuilder = HttpClients.custom();
+        if (proxyHost != null) {
+            String[] parts = proxyHost.split(":");
+            String hostname = parts[0];
+            int port = Integer.parseInt(parts[1]);
+            httpClientBuilder.setProxy(new HttpHost(hostname, port));
+        }
+        if (accessToken != null) {
+            httpClientBuilder.setDefaultHeaders(
+                    Arrays.asList(new BasicHeader(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)));
+        }
+        if (username != null && password != null) {
+            CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+            credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
+            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+        }
+        return httpClientBuilder.build();
+    }
+
+    public URI getHttpUri() {
+        return httpUri;
+    }
+
+    /**
+     * The GraphQL server URI.
+     */
+    public void setHttpUri(URI httpUri) {
+        this.httpUri = httpUri;
+    }
+
+    public String getProxyHostname() {
+        return proxyHost;
+    }
+
+    /**
+     * The proxy host in the format "hostname:port".
+     */
+    public void setProxyHost(String proxyHost) {
+        this.proxyHost = proxyHost;
+    }
+
+    public String getAccessToken() {
+        return accessToken;
+    }
+
+    /**
+     * The access token sent in the Authorization header.
+     */
+    public void setAccessToken(String accessToken) {
+        this.accessToken = accessToken;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    /**
+     * The username for Basic authentication.
+     */
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * The password for Basic authentication.
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getQuery() {
+        if (query == null && queryFile != null) {
+            try {
+                query = IOHelper.loadText(ObjectHelper.loadResourceAsStream(queryFile));
+            } catch (IOException e) {
+                throw new RuntimeCamelException("Failed to read query file: " + queryFile, e);
+            }
+        }
+        return query;
+    }
+
+    /**
+     * The query text.
+     */
+    public void setQuery(String query) {
+        this.query = query;
+    }
+
+    public String getQueryFile() {
+        return queryFile;
+    }
+
+    /**
+     * The query file name located in the classpath.
+     */
+    public void setQueryFile(String queryFile) {
+        this.queryFile = queryFile;
+    }
+
+    public String getOperationName() {
+        return operationName;
+    }
+
+    /**
+     * The query or mutation name.
+     */
+    public void setOperationName(String operationName) {
+        this.operationName = operationName;
+    }
+
+    public JsonObject getVariables() {
+        return variables;
+    }
+
+    /**
+     * The JsonObject instance containing the operation variables.
+     */
+    public void setVariables(JsonObject variables) {
+        this.variables = variables;
+    }
+
+}
diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlProducer.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlProducer.java
new file mode 100644
index 0000000..2fe86c1
--- /dev/null
+++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlProducer.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql;
+
+import java.net.URI;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.util.json.JsonObject;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHeaders;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.util.EntityUtils;
+
+class GraphqlProducer extends DefaultProducer {
+
+    public GraphqlProducer(GraphqlEndpoint endpoint) {
+        super(endpoint);
+    }
+
+    @Override
+    public GraphqlEndpoint getEndpoint() {
+        return (GraphqlEndpoint) super.getEndpoint();
+    }
+
+    @Override
+    public void process(Exchange exchange) {
+        try {
+            CloseableHttpClient httpClient = getEndpoint().getHttpclient();
+            URI httpUri = getEndpoint().getHttpUri();
+            String requestBody = buildRequestBody(getEndpoint().getQuery(), getEndpoint().getOperationName(),
+                    getEndpoint().getVariables());
+            HttpEntity requestEntity = new StringEntity(requestBody, ContentType.create("application/json", "UTF-8"));
+
+            HttpPost httpPost = new HttpPost(httpUri);
+            httpPost.setHeader(HttpHeaders.ACCEPT, "application/json");
+            httpPost.setHeader(HttpHeaders.ACCEPT_ENCODING, "gzip");
+            httpPost.setEntity(requestEntity);
+
+            String responseContent = httpClient.execute(httpPost, response -> {
+                return EntityUtils.toString(response.getEntity());
+            });
+
+            exchange.getMessage().setBody(responseContent);
+
+        } catch (Exception e) {
+            exchange.setException(e);
+        }
+    }
+
+    protected static String buildRequestBody(String query, String operationName, JsonObject variables) {
+        JsonObject jsonObject = new JsonObject();
+        jsonObject.put("query", query);
+        jsonObject.put("operationName", operationName);
+        jsonObject.put("variables", variables != null ? variables : new JsonObject());
+        return jsonObject.toJson();
+    }
+
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java
new file mode 100644
index 0000000..40b9ec7
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.graphql.server.GraphqlServer;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.json.JsonObject;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class GraphqlComponentTest extends CamelTestSupport {
+
+    private static String booksQueryResult;
+    private static String bookByIdQueryResult;
+    private static String addBookMutationResult;
+    private static GraphqlServer server;
+
+    @EndpointInject("mock:result")
+    private MockEndpoint result;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        booksQueryResult = readJsonFile("booksQueryResult.json");
+        bookByIdQueryResult = readJsonFile("bookByIdQueryResult.json");
+        addBookMutationResult = readJsonFile("addBookMutationResult.json");
+
+        server = new GraphqlServer();
+        server.start();
+    }
+
+    private static String readJsonFile(String name) throws IOException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        return objectMapper.writeValueAsString(objectMapper.readValue(
+            IOHelper.loadText(ObjectHelper.loadResourceAsStream(name)), Object.class));
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+        server.shutdown();
+    }
+
+    @BindToRegistry("bookByIdQueryVariables")
+    public JsonObject bookByIdQueryVariables() {
+        JsonObject variables = new JsonObject();
+        variables.put("id", "book-1");
+        return variables;
+    }
+
+    @BindToRegistry("addBookMutationVariables")
+    public JsonObject addBookMutationVariables() {
+        JsonObject bookInput = new JsonObject();
+        bookInput.put("name", "Typee");
+        bookInput.put("authorId", "author-2");
+        JsonObject variables = new JsonObject();
+        variables.put("bookInput", bookInput);
+        return variables;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("direct:start1")
+                    .to("graphql://http://localhost:" + server.getPort() + "/graphql?query={books{id name}}")
+                    .to("mock:result");
+                from("direct:start2")
+                    .to("graphql://http://localhost:" + server.getPort() + "/graphql?queryFile=booksQuery.graphql")
+                    .to("mock:result");
+                from("direct:start3")
+                    .to("graphql://http://localhost:" + server.getPort() + "/graphql?queryFile=multipleQueries.graphql&operationName=BookById&variables=#bookByIdQueryVariables")
+                    .to("mock:result");
+                from("direct:start4")
+                    .to("graphql://http://localhost:" + server.getPort() + "/graphql?queryFile=addBookMutation.graphql&variables=#addBookMutationVariables")
+                    .to("mock:result");
+            }
+        };
+    }
+
+    @Test
+    public void booksQueryWithStaticQuery() throws Exception {
+        result.expectedMessageCount(1);
+        result.expectedBodiesReceived(booksQueryResult);
+
+        template.sendBody("direct:start1", "");
+
+        result.assertIsSatisfied();
+    }
+
+    @Test
+    public void booksQueryWithQueryFile() throws Exception {
+        result.expectedMessageCount(1);
+        result.expectedBodiesReceived(booksQueryResult);
+
+        template.sendBody("direct:start2", "");
+
+        result.assertIsSatisfied();
+    }
+
+    @Test
+    public void bookByIdQuery() throws Exception {
+        result.expectedMessageCount(1);
+        result.expectedBodiesReceived(bookByIdQueryResult);
+
+        template.sendBody("direct:start3", "");
+
+        result.assertIsSatisfied();
+    }
+
+    @Test
+    public void addBookMutation() throws Exception {
+        result.expectedMessageCount(1);
+        result.expectedBodiesReceived(addBookMutationResult);
+
+        template.sendBody("direct:start4", "");
+
+        result.assertIsSatisfied();
+    }
+
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlProducerTest.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlProducerTest.java
new file mode 100644
index 0000000..7ad8e2c
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlProducerTest.java
@@ -0,0 +1,42 @@
+package org.apache.camel.component.graphql;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.camel.util.json.JsonObject;
+import org.junit.Test;
+
+public class GraphqlProducerTest {
+
+    @Test
+    public void shouldBuildRequestBodyWithQuery() {
+        String query = "queryText";
+
+        String body = GraphqlProducer.buildRequestBody(query, null, null);
+
+        String expectedBody = "{"
+            + "\"query\":\"queryText\","
+            + "\"operationName\":null,"
+            + "\"variables\":{}"
+            + "}";
+        assertEquals(expectedBody, body);
+    }
+
+    @Test
+    public void shouldBuildRequestBodyWithQueryOperationNameAndVariables() {
+        String query = "queryText";
+        String operationName = "queryName";
+        JsonObject variables = new JsonObject();
+        variables.put("key1", "value1");
+        variables.put("key2", "value2");
+
+        String body = GraphqlProducer.buildRequestBody(query, operationName, variables);
+
+        String expectedBody = "{"
+            + "\"query\":\"queryText\","
+            + "\"operationName\":\"queryName\","
+            + "\"variables\":{\"key1\":\"value1\",\"key2\":\"value2\"}"
+            + "}";
+        assertEquals(expectedBody, body);
+    }
+
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Author.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Author.java
new file mode 100644
index 0000000..7847d32
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Author.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+public class Author {
+    private final String id;
+    private final String name;
+
+    public Author(String id, String name) {
+        this.id = id;
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getName() {
+        return name;
+    }
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Book.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Book.java
new file mode 100644
index 0000000..06d02d0
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/Book.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+public class Book {
+    private String id;
+    private String name;
+    private String authorId;
+
+    public Book(String id, String name, String authorId) {
+        this.id = id;
+        this.name = name;
+        this.authorId = authorId;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAuthorId() {
+        return authorId;
+    }
+
+    public void setAuthorId(String authorId) {
+        this.authorId = authorId;
+    }
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/BookInput.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/BookInput.java
new file mode 100644
index 0000000..9ffcfe1
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/BookInput.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+public class BookInput {
+    private String id;
+    private String name;
+    private String authorId;
+
+    public BookInput() {
+    }
+
+    public BookInput(String name, String authorId) {
+        this.name = name;
+        this.authorId = authorId;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAuthorId() {
+        return authorId;
+    }
+
+    public void setAuthorId(String authorId) {
+        this.authorId = authorId;
+    }
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlDataFetchers.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlDataFetchers.java
new file mode 100644
index 0000000..86104ff
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlDataFetchers.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import graphql.schema.DataFetcher;
+
+public class GraphqlDataFetchers {
+
+    private static List<Book> books = Arrays.asList(
+            new Book("book-1", "Harry Potter and the Philosopher's Stone", "author-1"),
+            new Book("book-2", "Moby Dick", "author-2"),
+            new Book("book-3", "Interview with the vampire", "author-3"));
+
+    private static List<Author> authors = Arrays.asList(
+            new Author("author-1", "Joanne Rowling"),
+            new Author("author-2", "Herman Melville"),
+            new Author("author-3", "Anne Rice"));
+
+    public static DataFetcher<List<Book>> getBooksDataFetcher() {
+        return dataFetchingEnvironment -> books;
+    }
+
+    public static DataFetcher<Book> getBookByIdDataFetcher() {
+        return dataFetchingEnvironment -> {
+            String bookId = dataFetchingEnvironment.getArgument("id");
+            return books.stream().filter(book -> book.getId().equals(bookId)).findFirst().orElse(null);
+        };
+    }
+
+    public static DataFetcher<Author> getAuthorDataFetcher() {
+        return dataFetchingEnvironment -> {
+            Book book = dataFetchingEnvironment.getSource();
+            String authorId = book.getAuthorId();
+            return authors.stream().filter(author -> author.getId().equals(authorId)).findFirst().orElse(null);
+        };
+    }
+
+    public static DataFetcher<Book> addBookDataFetcher() {
+        return dataFetchingEnvironment -> {
+            Map<String, Object> bookInput = dataFetchingEnvironment.getArgument("bookInput");
+            String id = "book-" + (books.size() + 1);
+            String name = (String) bookInput.get("name");
+            String authorId = (String) bookInput.get("authorId");
+            Book book = new Book(id, name, authorId);
+            return book;
+        };
+    }
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlFactory.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlFactory.java
new file mode 100644
index 0000000..9b97f89
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlFactory.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+import static graphql.schema.idl.TypeRuntimeWiring.newTypeWiring;
+
+import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.ObjectHelper;
+
+import graphql.GraphQL;
+import graphql.schema.GraphQLSchema;
+import graphql.schema.idl.RuntimeWiring;
+import graphql.schema.idl.SchemaGenerator;
+import graphql.schema.idl.SchemaParser;
+import graphql.schema.idl.TypeDefinitionRegistry;
+
+public class GraphqlFactory {
+
+    public static GraphQL newGraphQL() {
+        try {
+            String schema = IOHelper.loadText(ObjectHelper.loadResourceAsStream("schema.graphqls"));
+            GraphQLSchema graphQLSchema = buildSchema(schema);
+            return GraphQL.newGraphQL(graphQLSchema).build();
+        } catch (Exception e) {
+            System.err.println(e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static GraphQLSchema buildSchema(String schema) {
+        TypeDefinitionRegistry typeDefinitionRegistry = new SchemaParser().parse(schema);
+        RuntimeWiring runtimeWiring = buildWiring();
+        return new SchemaGenerator().makeExecutableSchema(typeDefinitionRegistry, runtimeWiring);
+    }
+
+    private static RuntimeWiring buildWiring() {
+        return RuntimeWiring.newRuntimeWiring()
+            .type(newTypeWiring("Query").dataFetcher("books", GraphqlDataFetchers.getBooksDataFetcher()))
+            .type(newTypeWiring("Query").dataFetcher("bookById", GraphqlDataFetchers.getBookByIdDataFetcher()))
+            .type(newTypeWiring("Book").dataFetcher("author", GraphqlDataFetchers.getAuthorDataFetcher()))
+            .type(newTypeWiring("Mutation").dataFetcher("addBook", GraphqlDataFetchers.addBookDataFetcher()))
+            .build();
+    }
+
+}
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlServer.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlServer.java
new file mode 100644
index 0000000..ffeddf6
--- /dev/null
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/server/GraphqlServer.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.server;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpEntityEnclosingRequest;
+import org.apache.http.HttpException;
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpResponse;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.bootstrap.HttpServer;
+import org.apache.http.impl.bootstrap.ServerBootstrap;
+import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.util.EntityUtils;
+
+import graphql.ExecutionInput;
+import graphql.ExecutionResult;
+import graphql.GraphQL;
+
+public class GraphqlServer {
+
+    private final GraphQL graphql;
+    private final HttpServer server;
+
+    public GraphqlServer() {
+        this.graphql = GraphqlFactory.newGraphQL();
+        this.server = ServerBootstrap.bootstrap()
+            .registerHandler("/graphql", new GraphqlHandler())
+            .create();
+    }
+
+    public void start() throws IOException {
+        server.start();
+    }
+
+    public void shutdown() {
+        server.shutdown(0, TimeUnit.SECONDS);
+    }
+
+    public int getPort() {
+        return server.getLocalPort();
+    }
+
+    class GraphqlHandler implements HttpRequestHandler {
+
+        private final ObjectMapper objectMapper = new ObjectMapper();
+
+        public void handle(HttpRequest request, HttpResponse response, HttpContext context)
+                throws HttpException, IOException {
+            if (request instanceof HttpEntityEnclosingRequest) {
+                HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
+                String json = EntityUtils.toString(entity);
+
+                Map<String, Object> map = jsonToMap(json);
+                String query = (String) map.get("query");
+                String operationName = (String) map.get("operationName");
+                Map<String, Object> variables = (Map<String, Object>) map.get("variables");
+
+                ExecutionInput executionInput = ExecutionInput.newExecutionInput()
+                    .query(query)
+                    .operationName(operationName)
+                    .variables(variables)
+                    .build();
+                ExecutionResult executionResult = graphql.execute(executionInput);
+                Map<String, Object> resultMap = executionResult.toSpecification();
+                String result = objectMapper.writeValueAsString(resultMap);
+
+                response.setHeader("Content-Type", "application/json; charset=UTF-8");
+                response.setEntity(new StringEntity(result));
+            }
+        }
+
+        private Map<String, Object> jsonToMap(String json) throws IOException {
+            return objectMapper.readValue(json, new TypeReference<Map<String, Object>>() {});
+        }
+
+    }
+}
diff --git a/components/camel-graphql/src/test/resources/addBookMutation.graphql b/components/camel-graphql/src/test/resources/addBookMutation.graphql
new file mode 100644
index 0000000..ef93f95
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/addBookMutation.graphql
@@ -0,0 +1,9 @@
+mutation AddBook($bookInput: BookInput) {
+  addBook(bookInput: $bookInput) {
+    id
+    name
+    author {
+      name
+    }
+  }
+}
diff --git a/components/camel-graphql/src/test/resources/addBookMutationResult.json b/components/camel-graphql/src/test/resources/addBookMutationResult.json
new file mode 100644
index 0000000..4afc929
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/addBookMutationResult.json
@@ -0,0 +1,11 @@
+{
+  "data": {
+    "addBook": {
+      "id": "book-4",
+      "name": "Typee",
+      "author": {
+        "name": "Herman Melville"
+      }
+    }
+  }
+}
diff --git a/components/camel-graphql/src/test/resources/bookByIdQueryResult.json b/components/camel-graphql/src/test/resources/bookByIdQueryResult.json
new file mode 100644
index 0000000..f01fb73
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/bookByIdQueryResult.json
@@ -0,0 +1,11 @@
+{
+  "data": {
+    "bookById": {
+      "id": "book-1",
+      "name": "Harry Potter and the Philosopher's Stone",
+      "author": {
+        "name": "Joanne Rowling"
+      }
+    }
+  }
+}
diff --git a/components/camel-graphql/src/test/resources/booksQuery.graphql b/components/camel-graphql/src/test/resources/booksQuery.graphql
new file mode 100644
index 0000000..ca0e894
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/booksQuery.graphql
@@ -0,0 +1,6 @@
+query Books {
+  books {
+    id
+    name
+  }
+}
diff --git a/components/camel-graphql/src/test/resources/booksQueryResult.json b/components/camel-graphql/src/test/resources/booksQueryResult.json
new file mode 100644
index 0000000..600b120
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/booksQueryResult.json
@@ -0,0 +1,18 @@
+{
+  "data": {
+    "books": [
+      {
+        "id": "book-1",
+        "name": "Harry Potter and the Philosopher's Stone"
+      },
+      {
+        "id": "book-2",
+        "name": "Moby Dick"
+      },
+      {
+        "id": "book-3",
+        "name": "Interview with the vampire"
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/components/camel-graphql/src/test/resources/multipleQueries.graphql b/components/camel-graphql/src/test/resources/multipleQueries.graphql
new file mode 100644
index 0000000..fd5bb3f
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/multipleQueries.graphql
@@ -0,0 +1,16 @@
+query Books {
+  books {
+    id
+    name
+  }
+}
+
+query BookById($id: ID) {
+  bookById(id: $id) {
+    id
+    name
+    author {
+      name
+    }
+  }
+}
diff --git a/components/camel-graphql/src/test/resources/schema.graphqls b/components/camel-graphql/src/test/resources/schema.graphqls
new file mode 100644
index 0000000..1bf17fe
--- /dev/null
+++ b/components/camel-graphql/src/test/resources/schema.graphqls
@@ -0,0 +1,29 @@
+schema {
+  query: Query,
+  mutation: Mutation
+}
+
+type Query {
+  books: [Book]
+  bookById(id: ID): Book
+}
+
+type Mutation {
+  addBook(bookInput: BookInput): Book
+}
+
+type Book {
+  id: ID
+  name: String
+  author: Author
+}
+
+type Author {
+  id: ID
+  name: String
+}
+
+input BookInput {
+  name: String
+  authorId: ID
+}
diff --git a/components/pom.xml b/components/pom.xml
index 1e213ec..d505f5d 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -185,6 +185,7 @@
         <module>camel-google-pubsub</module>
         <module>camel-gora</module>
         <module>camel-grape</module>
+        <module>camel-graphql</module>
         <module>camel-grok</module>
         <module>camel-grpc</module>
         <module>camel-gson</module>
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/GraphqlEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/GraphqlEndpointBuilderFactory.java
new file mode 100644
index 0000000..9cd4ca0
--- /dev/null
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/GraphqlEndpointBuilderFactory.java
@@ -0,0 +1,224 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.endpoint.dsl;
+
+import javax.annotation.Generated;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+
+/**
+ * A Camel GraphQL Component
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface GraphqlEndpointBuilderFactory {
+
+
+    /**
+     * Builder for endpoint for the GraphQL component.
+     */
+    public interface GraphqlEndpointBuilder extends EndpointProducerBuilder {
+        default AdvancedGraphqlEndpointBuilder advanced() {
+            return (AdvancedGraphqlEndpointBuilder) this;
+        }
+        /**
+         * The access token sent in the Authorization header.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder accessToken(String accessToken) {
+            doSetProperty("accessToken", accessToken);
+            return this;
+        }
+        /**
+         * The query or mutation name.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder operationName(String operationName) {
+            doSetProperty("operationName", operationName);
+            return this;
+        }
+        /**
+         * The password for Basic authentication.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder password(String password) {
+            doSetProperty("password", password);
+            return this;
+        }
+        /**
+         * The proxy host in the format hostname:port.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder proxyHost(String proxyHost) {
+            doSetProperty("proxyHost", proxyHost);
+            return this;
+        }
+        /**
+         * The query text.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder query(String query) {
+            doSetProperty("query", query);
+            return this;
+        }
+        /**
+         * The query file name located in the classpath.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder queryFile(String queryFile) {
+            doSetProperty("queryFile", queryFile);
+            return this;
+        }
+        /**
+         * The username for Basic authentication.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder username(String username) {
+            doSetProperty("username", username);
+            return this;
+        }
+        /**
+         * The JsonObject instance containing the operation variables.
+         * 
+         * The option is a: <code>org.apache.camel.util.json.JsonObject</code>
+         * type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder variables(Object variables) {
+            doSetProperty("variables", variables);
+            return this;
+        }
+        /**
+         * The JsonObject instance containing the operation variables.
+         * 
+         * The option will be converted to a
+         * <code>org.apache.camel.util.json.JsonObject</code> type.
+         * 
+         * Group: producer
+         */
+        default GraphqlEndpointBuilder variables(String variables) {
+            doSetProperty("variables", variables);
+            return this;
+        }
+    }
+
+    /**
+     * Advanced builder for endpoint for the GraphQL component.
+     */
+    public interface AdvancedGraphqlEndpointBuilder
+            extends
+                EndpointProducerBuilder {
+        default GraphqlEndpointBuilder basic() {
+            return (GraphqlEndpointBuilder) this;
+        }
+        /**
+         * Whether the endpoint should use basic property binding (Camel 2.x) or
+         * the newer property binding with additional capabilities.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedGraphqlEndpointBuilder basicPropertyBinding(
+                boolean basicPropertyBinding) {
+            doSetProperty("basicPropertyBinding", basicPropertyBinding);
+            return this;
+        }
+        /**
+         * Whether the endpoint should use basic property binding (Camel 2.x) or
+         * the newer property binding with additional capabilities.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedGraphqlEndpointBuilder basicPropertyBinding(
+                String basicPropertyBinding) {
+            doSetProperty("basicPropertyBinding", basicPropertyBinding);
+            return this;
+        }
+        /**
+         * Sets whether synchronous processing should be strictly used, or Camel
+         * is allowed to use asynchronous processing (if supported).
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedGraphqlEndpointBuilder synchronous(boolean synchronous) {
+            doSetProperty("synchronous", synchronous);
+            return this;
+        }
+        /**
+         * Sets whether synchronous processing should be strictly used, or Camel
+         * is allowed to use asynchronous processing (if supported).
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Group: advanced
+         */
+        default AdvancedGraphqlEndpointBuilder synchronous(String synchronous) {
+            doSetProperty("synchronous", synchronous);
+            return this;
+        }
+    }
+    /**
+     * GraphQL (camel-graphql)
+     * A Camel GraphQL Component
+     * 
+     * Category: graphql
+     * Available as of version: 3.0
+     * Maven coordinates: org.apache.camel:camel-graphql
+     * 
+     * Syntax: <code>graphql:httpUri?options</code>
+     * 
+     * Path parameter: httpUri (required)
+     * The GraphQL server URI.
+     */
+    default GraphqlEndpointBuilder graphql(String path) {
+        class GraphqlEndpointBuilderImpl extends AbstractEndpointBuilder implements GraphqlEndpointBuilder, AdvancedGraphqlEndpointBuilder {
+            public GraphqlEndpointBuilderImpl(String path) {
+                super("graphql", path);
+            }
+        }
+        return new GraphqlEndpointBuilderImpl(path);
+    }
+}
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index 7e1d01a..3e20aaf 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -134,6 +134,7 @@
 * xref:google-sheets-stream-component.adoc[Google Sheets Stream Component]
 * xref:gora-component.adoc[Gora Component]
 * xref:grape-component.adoc[Grape Component]
+* xref:graphql-component.adoc[GraphQL Component]
 * xref:grok-dataformat.adoc[Grok DataFormat]
 * xref:groovy-language.adoc[Groovy Language]
 * xref:grpc-component.adoc[gRPC Component]
diff --git a/docs/components/modules/ROOT/pages/graphql-component.adoc b/docs/components/modules/ROOT/pages/graphql-component.adoc
new file mode 100644
index 0000000..6cf0a71
--- /dev/null
+++ b/docs/components/modules/ROOT/pages/graphql-component.adoc
@@ -0,0 +1,189 @@
+[[graphql-component]]
+= GraphQL Component
+:page-source: components/camel-graphql/src/main/docs/graphql-component.adoc
+
+*Available as of Camel version 3.0*
+
+The GraphQL component is a GraphQL client that communicates over HTTP and supports queries and mutations, but not subscriptions. It uses the https://hc.apache.org/httpcomponents-client-4.5.x/index.html[Apache HttpClient] library.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-graphql</artifactId>
+    <version>x.x.x</version>
+  <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+== GraphQL Endpoint URI
+
+// endpoint options: START
+The GraphQL endpoint is configured using URI syntax:
+
+----
+graphql:httpUri?options
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *httpUri* | *Required* The GraphQL server URI. |  | URI
+|===
+
+
+=== Query Parameters (11 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *accessToken* (producer) | The access token sent in the Authorization header. |  | String
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *operationName* (producer) | The query or mutation name. |  | String
+| *password* (producer) | The password for Basic authentication. |  | String
+| *proxyHost* (producer) | The proxy host in the format hostname:port. |  | String
+| *query* (producer) | The query text. |  | String
+| *queryFile* (producer) | The query file name located in the classpath. |  | String
+| *username* (producer) | The username for Basic authentication. |  | String
+| *variables* (producer) | The JsonObject instance containing the operation variables. |  | JsonObject
+| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
+|===
+// endpoint options: END
+
+== GraphQL Component Options
+
+// component options: START
+The GraphQL component supports 1 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+|===
+// component options: END
+
+// spring-boot-auto-configure options: START
+== Spring Boot Auto-Configuration
+
+When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:
+
+[source,xml]
+----
+<dependency>
+  <groupId>org.apache.camel</groupId>
+  <artifactId>camel-graphql-starter</artifactId>
+  <version>x.x.x</version>
+  <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+
+The component supports 2 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *camel.component.graphql.basic-property-binding* | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | Boolean
+| *camel.component.graphql.enabled* | Whether to enable auto configuration of the graphql component. This is enabled by default. |  | Boolean
+|===
+// spring-boot-auto-configure options: END
+
+== Message Body
+
+Camel will store the GraphQL response from the external server on the OUT message body. All headers from the IN message will be copied to the OUT message, so headers are preserved during routing. Additionally Camel will add the HTTP response headers as well to the OUT message headers.
+
+== Examples
+
+=== Queries
+
+Simple queries can be defined directly in the URI:
+
+[source,java]
+----
+from("direct:start")
+    .to("graphql://http://example.com/graphql?query={books{id name}}")
+----
+
+More complex queries can be stored in a file and referenced in the URI:
+
+[source,java]
+----
+# booksQuery.graphql
+query Books {
+  books {
+    id
+    name
+  }
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=booksQuery.graphql")
+----
+
+When the query file defines multiple operations, it's required to specify which one should be executed:
+
+[source,java]
+----
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=multipleQueries.graphql&operationName=Books")
+----
+
+Queries with variables need to reference a JsonObject instance from the registry:
+
+[source,java]
+----
+@BindToRegistry("bookByIdQueryVariables")
+public JsonObject bookByIdQueryVariables() {
+    JsonObject variables = new JsonObject();
+    variables.put("id", "book-1");
+    return variables;
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?queryFile=bookByIdQuery.graphql&variables=#bookByIdQueryVariables")
+----
+
+=== Mutations
+
+Mutations are like queries with variables. They specify a query and a reference to a variables bean:
+
+[source,java]
+----
+# addBookMutation.graphql
+mutation AddBook($bookInput: BookInput) {
+  addBook(bookInput: $bookInput) {
+    id
+    name
+    author {
+      name
+    }
+  }
+}
+
+@BindToRegistry("addBookMutationVariables")
+public JsonObject addBookMutationVariables() {
+    JsonObject bookInput = new JsonObject();
+    bookInput.put("name", "Typee");
+    bookInput.put("authorId", "author-2");
+    JsonObject variables = new JsonObject();
+    variables.put("bookInput", bookInput);
+    return variables;
+}
+
+from("direct:start")
+    .to("graphql://http://example.com/graphql?graphql?queryFile=addBookMutation.graphql&variables=#addBookMutationVariables")
+----
diff --git a/parent/pom.xml b/parent/pom.xml
index e509a4c..85c1da6 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -238,6 +238,7 @@
         <google-api-services-pubsub-version>v1-rev12-1.22.0</google-api-services-pubsub-version>
         <google-mail-guava-version>17.0</google-mail-guava-version>
         <google-truth-version>0.30</google-truth-version>
+        <graphql-java-version>13.0</graphql-java-version>
         <grizzly-websockets-version>2.3.25</grizzly-websockets-version>
         <grpc-version>1.23.0</grpc-version>
         <grpc-google-auth-library-version>0.13.0</grpc-google-auth-library-version>
@@ -1386,6 +1387,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-grok</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -2965,6 +2971,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql-starter</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-grok-starter</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -4276,7 +4287,7 @@
             <dependency>
                 <groupId>com.github.ben-manes.caffeine</groupId>
                 <artifactId>caffeine</artifactId>
-                <version>${caffeine-version}</version>                
+                <version>${caffeine-version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>org.checkerframework</groupId>
@@ -4925,14 +4936,14 @@
                 <artifactId>tagsoup</artifactId>
                 <version>${tagsoup-version}</version>
             </dependency>
-            
+
             <!-- optional Any23 -->
             <dependency>
                 <groupId>org.apache.any23</groupId>
                 <artifactId>apache-any23-core</artifactId>
                 <version>${apache-any23-version}</version>
             </dependency>
-            
+
             <!-- optional RDF4J -->
             <dependency>
                 <groupId>org.eclipse.rdf4j</groupId>
@@ -5661,7 +5672,7 @@
                           </goals>
                       </execution>
                   </executions>
-              </plugin>  
+              </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
@@ -5773,7 +5784,7 @@
             <plugin>
               <groupId>org.jboss.jandex</groupId>
               <artifactId>jandex-maven-plugin</artifactId>
-          </plugin>  
+          </plugin>
         </plugins>
     </build>
 
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/pom.xml b/platforms/spring-boot/components-starter/camel-graphql-starter/pom.xml
new file mode 100644
index 0000000..f1b7787
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>components-starter</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>camel-graphql-starter</artifactId>
+  <packaging>jar</packaging>
+  <name>Spring-Boot Starter :: Camel :: GraphQL</name>
+  <description>Spring-Boot Starter for A Camel GraphQL Component</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <version>${spring-boot-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-graphql</artifactId>
+      <version>${project.version}</version>
+      <!--START OF GENERATED CODE-->
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+      <!--END OF GENERATED CODE-->
+    </dependency>
+    <!--START OF GENERATED CODE-->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring-boot-starter</artifactId>
+    </dependency>
+    <!--END OF GENERATED CODE-->
+  </dependencies>
+</project>
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java
new file mode 100644
index 0000000..7f6f14d
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.springboot;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Generated;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.graphql.GraphqlComponent;
+import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
+import org.apache.camel.spring.boot.CamelAutoConfiguration;
+import org.apache.camel.spring.boot.ComponentConfigurationProperties;
+import org.apache.camel.spring.boot.util.CamelPropertiesHelper;
+import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
+import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
+import org.apache.camel.support.IntrospectionSupport;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
+@Configuration
+@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class,
+        GraphqlComponentAutoConfiguration.GroupConditions.class})
+@AutoConfigureAfter(CamelAutoConfiguration.class)
+@EnableConfigurationProperties({ComponentConfigurationProperties.class,
+        GraphqlComponentConfiguration.class})
+public class GraphqlComponentAutoConfiguration {
+
+    private static final Logger LOGGER = LoggerFactory
+            .getLogger(GraphqlComponentAutoConfiguration.class);
+    @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
+    private CamelContext camelContext;
+    @Autowired
+    private GraphqlComponentConfiguration configuration;
+    @Autowired(required = false)
+    private List<ComponentCustomizer<GraphqlComponent>> customizers;
+
+    static class GroupConditions extends GroupCondition {
+        public GroupConditions() {
+            super("camel.component", "camel.component.graphql");
+        }
+    }
+
+    @Lazy
+    @Bean(name = "graphql-component")
+    @ConditionalOnMissingBean(GraphqlComponent.class)
+    public GraphqlComponent configureGraphqlComponent() throws Exception {
+        GraphqlComponent component = new GraphqlComponent();
+        component.setCamelContext(camelContext);
+        Map<String, Object> parameters = new HashMap<>();
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
+        for (Map.Entry<String, Object> entry : parameters.entrySet()) {
+            Object value = entry.getValue();
+            Class<?> paramClass = value.getClass();
+            if (paramClass.getName().endsWith("NestedConfiguration")) {
+                Class nestedClass = null;
+                try {
+                    nestedClass = (Class) paramClass.getDeclaredField(
+                            "CAMEL_NESTED_CLASS").get(null);
+                    HashMap<String, Object> nestedParameters = new HashMap<>();
+                    IntrospectionSupport.getProperties(value, nestedParameters,
+                            null, false);
+                    Object nestedProperty = nestedClass.newInstance();
+                    CamelPropertiesHelper.setCamelProperties(camelContext,
+                            nestedProperty, nestedParameters, false);
+                    entry.setValue(nestedProperty);
+                } catch (NoSuchFieldException e) {
+                }
+            }
+        }
+        CamelPropertiesHelper.setCamelProperties(camelContext, component,
+                parameters, false);
+        if (ObjectHelper.isNotEmpty(customizers)) {
+            for (ComponentCustomizer<GraphqlComponent> customizer : customizers) {
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.graphql.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.graphql.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
+            }
+        }
+        return component;
+    }
+}
\ No newline at end of file
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConfiguration.java
new file mode 100644
index 0000000..4803c40
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConfiguration.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.graphql.springboot;
+
+import javax.annotation.Generated;
+import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * A Camel GraphQL Component
+ * 
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo")
+@ConfigurationProperties(prefix = "camel.component.graphql")
+public class GraphqlComponentConfiguration
+        extends
+            ComponentConfigurationPropertiesCommon {
+
+    /**
+     * Whether to enable auto configuration of the graphql component. This is
+     * enabled by default.
+     */
+    private Boolean enabled;
+    /**
+     * Whether the component should use basic property binding (Camel 2.x) or
+     * the newer property binding with additional capabilities
+     */
+    private Boolean basicPropertyBinding = false;
+
+    public Boolean getBasicPropertyBinding() {
+        return basicPropertyBinding;
+    }
+
+    public void setBasicPropertyBinding(Boolean basicPropertyBinding) {
+        this.basicPropertyBinding = basicPropertyBinding;
+    }
+}
\ No newline at end of file
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..f5d491d
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.camel.component.graphql.springboot.GraphqlComponentAutoConfiguration
diff --git a/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 0000000..7ba1344
--- /dev/null
+++ b/platforms/spring-boot/components-starter/camel-graphql-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+provides: camel-graphql
diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml
index f47863e..066cf04 100644
--- a/platforms/spring-boot/components-starter/pom.xml
+++ b/platforms/spring-boot/components-starter/pom.xml
@@ -205,6 +205,7 @@
     <module>camel-google-sheets-starter</module>
     <module>camel-gora-starter</module>
     <module>camel-grape-starter</module>
+    <module>camel-graphql-starter</module>
     <module>camel-grok-starter</module>
     <module>camel-groovy-starter</module>
     <module>camel-grpc-starter</module>
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
index 005396cd..59f94fe 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
@@ -1444,6 +1444,16 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-graphql-starter</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-grok</artifactId>
         <version>${project.version}</version>
       </dependency>