spring-boot-starter-graphql

This is a Spring boot starter project for the GraphQL Java project.

License

License

MIT
Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

com.merapar
ArtifactId

ArtifactId

spring-boot-starter-graphql
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

spring-boot-starter-graphql
This is a Spring boot starter project for the GraphQL Java project.
Project URL

Project URL

https://github.com/merapar/spring-boot-starter-graphql
Project Organization

Project Organization

Pivotal Software, Inc.
Source Code Management

Source Code Management

http://github.com/merapar/spring-boot-starter-graphql/tree/master

Download spring-boot-starter-graphql

How to add to project

<!-- https://jarcasting.com/artifacts/com.merapar/spring-boot-starter-graphql/ -->
<dependency>
    <groupId>com.merapar</groupId>
    <artifactId>spring-boot-starter-graphql</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.merapar/spring-boot-starter-graphql/
implementation 'com.merapar:spring-boot-starter-graphql:1.0.1'
// https://jarcasting.com/artifacts/com.merapar/spring-boot-starter-graphql/
implementation ("com.merapar:spring-boot-starter-graphql:1.0.1")
'com.merapar:spring-boot-starter-graphql:jar:1.0.1'
<dependency org="com.merapar" name="spring-boot-starter-graphql" rev="1.0.1">
  <artifact name="spring-boot-starter-graphql" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.merapar', module='spring-boot-starter-graphql', version='1.0.1')
)
libraryDependencies += "com.merapar" % "spring-boot-starter-graphql" % "1.0.1"
[com.merapar/spring-boot-starter-graphql "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.12
org.springframework.boot : spring-boot-starter-web jar 1.4.3.RELEASE
com.graphql-java : graphql-java jar 2.3.0

test (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar 1.4.3.RELEASE
junit : junit jar 4.12
org.assertj : assertj-core jar 2.5.0

Project Modules

There are no modules declared in this project.

Join the chat at https://gitter.im/merapar/graphql-spring-boot-starter Build Status Code coverage Latest Release Dev version

GraphQL Spring boot starter

This is a Spring boot starter project for the GraphQL Java project.

Table of Contents

Overview

The implementation is based on Spring boot starter web project that will expose the GraphQL endpoint as rest controller.

It takes care of exposing a rest endpoint with all configured graphQL fields automatically.

The library aims for real-life usage in production with the ease of Spring Boot.

Getting started

Check out the following documentation on using spring boot starter project.

By adding GraphQL Spring boot starter as maven dependency on the application a @Controller will be created pointing to the configured request mapping with default "/v1/graphql". During startup all components that implement "GraphQlFields" interface will be applied on the GraphQL schema exposed by the controller.

An example from the sample project:

package com.merapar.graphql.sample.fields;

import com.merapar.graphql.GraphQlFields;
import graphql.schema.GraphQLFieldDefinition;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

import static graphql.Scalars.GraphQLString;
import static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;

@Component
public class HelloWorldFields implements GraphQlFields {

    @Override
    public List<GraphQLFieldDefinition> getQueryFields() {
        return Collections.singletonList(
                newFieldDefinition()
                        .type(GraphQLString)
                        .name("hello")
                        .staticValue("world")
                        .build()
        );
    }

    @Override
    public List<GraphQLFieldDefinition> getMutationFields() {
        return Collections.emptyList();
    }
}

Configuration

The following default properties can be configured via properties file:

com.merapar.graphql:
  rootQueryName: "queries"
  rootQueryDescription: ""
  rootMutationName: "mutations"
  rootMutationDescription: ""
  requestMapping:
    path: "/v1/graphql"
  executor:
    minimumThreadPoolSizeQuery: 10
    maximumThreadPoolSizeQuery: 20
    keepAliveTimeInSecondsQuery: 30
    minimumThreadPoolSizeMutation: 10
    maximumThreadPoolSizeMutation: 20
    keepAliveTimeInSecondsMutation: 30
    minimumThreadPoolSizeSubscription: 10
    maximumThreadPoolSizeSubscription: 20
    keepAliveTimeInSecondsSubscription: 30
    

How to use the latest release with Maven

Dependency:

<dependency>
    <groupId>com.merapar</groupId>
    <artifactId>graphql-spring-boot-starter</artifactId>
    <version>1.0.2</version>
</dependency>

How to use the latest build with Maven

Add the repository:

<repository>
    <id>bintray-merapar-maven</id>
    <name>bintray</name>
    <url>http://dl.bintray.com/merapar/maven</url>
</repository>

Dependency:

<dependency>
    <groupId>com.merapar</groupId>
    <artifactId>graphql-spring-boot-starter</artifactId>
    <version>1.0.3-alpha</version>
</dependency>

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By contributing to this project (commenting or opening PR/Issues etc) you are agreeing to follow this conduct, so please take the time to read it.

Contributions

Every contribution to make this project better is welcome: Thank you!

In order to make this a pleasant as possible for everybody involved, here are some tips:

Acknowledgment

This implementation is based on the graphql-java project.

License

GraphQL Spring boot starter is licensed under the MIT License. See LICENSE for details.

Copyright (c) 2016 Merapar Technologies

graphql-java License

com.merapar

Merapar

Merapar Technologies is a software project company focussing on the development of scalable backend solutions using cloud-based technologies.

Versions

Version
1.0.1
1.0.0