graphql-rxjava

GraphQL Rx-Java

License

License

MIT
Categories

Categories

Java Languages RxJava Container Microservices Reactive libraries
GroupId

GroupId

com.graphql-java
ArtifactId

ArtifactId

graphql-rxjava
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

graphql-rxjava
GraphQL Rx-Java
Project URL

Project URL

https://github.com/nfl/graphql-rxjava
Source Code Management

Source Code Management

https://github.com/nfl/graphql-rxjava

Download graphql-rxjava

How to add to project

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

Dependencies

compile (5)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.12
org.antlr : antlr4-runtime jar 4.5.1
com.graphql-java : graphql-java jar 2015-11-04T21-08-13
org.apache.commons : commons-lang3 jar 3.1
io.reactivex : rxjava jar 1.0.12

test (5)

Group / Artifact Type Version
junit : junit jar 4.11
org.spockframework : spock-core jar 1.0-groovy-2.4
org.codehaus.groovy : groovy-all jar 2.4.4
org.objenesis : objenesis jar 2.1
cglib : cglib-nodep jar 3.1

Project Modules

There are no modules declared in this project.

graphql-rxjava

This is an execution strategy for graphql-java that makes it easier to use rxjava's Observable. It currently requires Java8.

Build Status

Table of Contents

Rx Hello World

This is the famous "hello world" in graphql-rxjava:

import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLSchema;

import graphql.execution.RxExecutionStrategy;
import graphql.execution.RxExecutionResult;

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

public class HelloWorld {

    public static void main(String[] args) {

        GraphQLObjectType queryType = newObject()
                        .name("helloWorldQuery")
                        .field(newFieldDefinition()
                                .type(GraphQLString)
                                .name("hello")
                                .staticValue(Observable.just("world")))
                                .build())
                        .build();

        GraphQLSchema schema = GraphQLSchema.newSchema()
                        .query(queryType)
                        .build();

        Observable<?> result = ((RxExecutionResult)new GraphQL(schema, new RxExecutionStrategy()).execute("{hello}")).getDataObservable();

        result.subscribe(System.out::println);
        // Prints: {hello=world}
    }
}

Getting started with gradle

Make sure mavenCentral is among your repos:

repositories {
    mavenCentral()
}

Dependency:

dependencies {
  compile 'com.graphql-java:graphql-rxjava:0.0.1'
}

License

graphql-rxjava is licensed under the MIT License. See LICENSE for details.

Copyright (c) 2015, NFL and Contributors

graphql-js License

com.graphql-java

National Football League

Together, We Make Football. And Software.

Versions

Version
0.0.1