Giter Club home page Giter Club logo

glitr's Introduction

GLiTR

Build Status Maven Central Download License

A library that lets you use Plain Old Java Objects to describe your GraphQL schema.

Binaries

Example for Maven:

<dependency>
    <groupId>com.nfl.glitr</groupId>
    <artifactId>glitr</artifactId>
    <version>x.y.z</version>
</dependency>

Example for gradle:

compile("com.nfl.glitr:glitr:x.y.z")

Change history can be found here: CHANGELOG.md

How to use the latest build with Gradle

Add the repositories:

repositories {
    maven { url  "http://dl.bintray.com/nfl/maven" }
}

Dependency:

dependencies {
  compile 'com.nfl.glitr:INSERT_LATEST_VERSION_HERE'
}

How to use the latest build with Maven

Add the repository:

<repository>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <id>bintray-nfl-maven</id>
    <name>bintray</name>
    <url>http://dl.bintray.com/nfl/maven</url>
</repository>

Dependency:

<dependency>
    <groupId>com.nfl.glitr</groupId>
    <artifactId>glitr</artifactId>
    <version>INSERT_LATEST_VERSION_HERE</version>
</dependency>

How to use it

This is the famous "hello world" in graphql-java with GLiTR:

import com.nfl.glitr.Glitr;
import com.nfl.glitr.GlitrBuilder;
import com.nfl.glitr.annotation.GlitrDescription;
import graphql.GraphQL;
import graphql.schema.DataFetchingEnvironment;

import java.util.Map;

public class HelloWorld {

    public static void main(String[] args) {

        Glitr glitr = GlitrBuilder.newGlitr()
                .withQueryRoot(new Root())
                .build();

        GraphQL graphQL = new GraphQL(glitr.getSchema());

        Map<String, Object> result = (Map<String, Object>) graphQL.execute("{hello}").getData();

        System.out.println(result); // Prints: {hello=World!}
    }

    @GlitrDescription("Where it all begins.")
    public static class Root {

        public String getHello(DataFetchingEnvironment environment) {
            return "World!";
        }
    }
}

Full Documentation

See the Wiki for full documentation, examples, operational details and other information.

Build

To build:

$ git clone [email protected]:NFL/glitr.git
$ cd glitr/
$ ./gradlew build

Further details on building can be found on the Getting Started page of the wiki.

Requirements

  • = Java 8

Examples

See glitr-examples for example implementation

Contact Info

LICENSE

GLiTR is licensed under the MIT License. See LICENSE for more details.

glitr's People

Contributors

alex-trubin avatar ch4rms avatar nflpauleverton avatar omurzin avatar tinnou avatar vaant avatar vanquish59 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glitr's Issues

Have a way to flag deprecated fields

The GraphQL schema supports deprecation. Create a @GlitrDeprecated annotation that denotes a field as deprecated.

Add support for deprecationReason and other useful information related to field deprecation.

Have a way to add additional types that are outside of the visited domain graph

Glitr scans domains however some domains might exist outside of the graph but we could still need them in the GraphQL schema.

Add GLiTR configuration time, offer the ability to add additional Java types for inspection.

Example:
For instance types A and B could implement an interface C that is discovered by GLiTR. Types A and B being never referenced elsewhere will not be inspected by GLiTR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.