All Projects → americanexpress → Nodes

americanexpress / Nodes

Licence: apache-2.0
A GraphQL JVM Client - Java, Kotlin, Scala, etc.

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects
scala
5932 projects

Projects that are alternatives of or similar to Nodes

Modelizr
Generate GraphQL queries from models that can be mocked and normalized.
Stars: ✭ 175 (-36.59%)
Mutual labels:  graphql, graphql-client
Swift Graphql
A GraphQL client that lets you forget about GraphQL.
Stars: ✭ 264 (-4.35%)
Mutual labels:  graphql, graphql-client
Gqlify
[NOT MAINTAINED]An API integration framework using GraphQL
Stars: ✭ 182 (-34.06%)
Mutual labels:  graphql, graphql-client
Babel Blade
(under new management!) ⛸️Solve the Double Declaration problem with inline GraphQL. Babel plugin/macro that works with any GraphQL client!
Stars: ✭ 266 (-3.62%)
Mutual labels:  graphql, graphql-client
Aws Mobile Appsync Sdk Ios
iOS SDK for AWS AppSync.
Stars: ✭ 231 (-16.3%)
Mutual labels:  graphql, graphql-client
Client Side Graphql
Stars: ✭ 119 (-56.88%)
Mutual labels:  graphql, graphql-client
Graphql.js
A Simple and Isomorphic GraphQL Client for JavaScript
Stars: ✭ 2,206 (+699.28%)
Mutual labels:  graphql, graphql-client
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (+419.57%)
Mutual labels:  graphql, graphql-client
Grafoo
A GraphQL Client and Toolkit
Stars: ✭ 264 (-4.35%)
Mutual labels:  graphql, graphql-client
36 Graphql Concepts
📜 36 concepts every GraphQL developer should know.
Stars: ✭ 209 (-24.28%)
Mutual labels:  graphql, graphql-client
Graphql Stack
A visual explanation of how the various tools in the GraphQL ecosystem fit together.
Stars: ✭ 117 (-57.61%)
Mutual labels:  graphql, graphql-client
Apollo Android
🤖  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
Stars: ✭ 2,949 (+968.48%)
Mutual labels:  graphql, graphql-client
Graphql Hooks
🎣 Minimal hooks-first GraphQL client
Stars: ✭ 1,610 (+483.33%)
Mutual labels:  graphql, graphql-client
Python Graphql Client
Simple GraphQL client for Python 2.7+
Stars: ✭ 133 (-51.81%)
Mutual labels:  graphql, graphql-client
Qlens
QLens is an electron app which dynamically generates GraphQL Schemas and Mongo Schema visualization. QLens significantly cuts development time by automating the formation of their GraphQL schemas based on information fetched from their non-relational database.
Stars: ✭ 110 (-60.14%)
Mutual labels:  graphql, graphql-client
Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+990.22%)
Mutual labels:  graphql, graphql-client
Angular1 Apollo
AngularJS integration for the Apollo Client
Stars: ✭ 108 (-60.87%)
Mutual labels:  graphql, graphql-client
Gest
👨‍💻 A sensible GraphQL testing tool - test your GraphQL schema locally and in the cloud
Stars: ✭ 109 (-60.51%)
Mutual labels:  graphql, graphql-client
Reason Urql
Reason bindings for Formidable's Universal React Query Library, urql.
Stars: ✭ 203 (-26.45%)
Mutual labels:  graphql, graphql-client
Neuron
A GraphQL client for Elixir
Stars: ✭ 244 (-11.59%)
Mutual labels:  graphql, graphql-client

Nodes

A GraphQL JVM Client - Java, Kotlin, Scala, etc.

Build Status Coverage Status Download

Nodes is a GraphQL client designed for constructing queries from standard model definitions. Making this library suitable for any JVM application that wishes to interface with a GraphQL service in a familiar way - a simple, flexible, compatible, adoptable, understandable library for everyone!

The Nodes library is intended to be used in a similar fashion to other popular API interfaces so that application architecture can remain unchanged whether interfacing with a REST, SOAP, GraphQL, or any other API specification. A request entity is built for handling request specific parameters; a template is used for executing that request and mapping the response to a response entity; a response entity is used to gather the results.

Installing

Currently the library is hosted on bintray. This can be added to your installation repositories as demonstrated below.

Maven

<repositories>
    <repository>
        <id>bintray-americanexpress-maven</id>
        <url>https://dl.bintray.com/americanexpress/maven</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
      <groupId>io.aexp.nodes.graphql</groupId>
      <artifactId>nodes</artifactId>
      <version>latest</version>
    </dependency>
</dependencies>

Gradle

repositories {
    maven {
        url 'https://dl.bintray.com/americanexpress/maven/'
    }
}

dependencies {
    compile 'io.aexp.nodes.graphql:nodes:latest'
}

Replace latest with the desired version to install. The versions available for installing can be found in the git tags, using semantic versioning.

Usage

GraphQLTemplate graphQLTemplate = new GraphQLTemplate();

GraphQLRequestEntity requestEntity = GraphQLRequestEntity.Builder()
    .url("http://graphql.example.com/graphql")
    .variables(new Variable<>("timeFormat", "MM/dd/yyyy"))
    .arguments(new Arguments("path.to.argument.property",
        new Argument<>("id", "d070633a9f9")))
    .scalars(BigDecimal.class)
    .request(SampleModel.class)
    .build();
GraphQLResponseEntity<SampleModel> responseEntity = graphQLTemplate.query(requestEntity, SampleModel.class);

Annotations to configure fields

@GraphQLArgument(name="name", value="defaultVal", type="String", optional=false)

Used above property fields
name (required): GraphQL argument name
value (optional): default value to set the argument to
type (optional): how to parse the optional value. Accepts an enum of "String", "Boolean", "Integer", or "Float" - defaults to be parsed as a string.
optional (optional): set to true if the value is optional and should be left out if value is null - defaults to false.
You can specify fields arguments directly inline using this. This is good for static field arguments such as result display settings, for instance the format of a date or the locale of a message.

example:

    ...
    @GraphQLArgument(name="isPublic", value="true", type="Boolean")
    private User user;
    ...

result:

query {
    ...
    user(isPublic: true) {
        ...

@GraphQLArguments({@GraphQLArgument})

Used above property fields
Annotation for allowing mutliple default argument descriptions on one field

example:

    ...
    @GraphQLArguments({
        @GraphQLArgument(name="isPublic", value="true", type="Boolean"),
        @GraphQLArgument(name="username")
    })
    private User user;
    ...

result:

query {
    ...
    user(isPublic: true, username: null) {
        ...

@GraphQLIgnore

Used above property fields
Annotation to ignore the field when constructing the schema

example:

    ...
    @GraphQLIgnore
    private User user;
    ...

result:

query {
    ...

@GraphQLProperty(name="name", arguments={@GraphQLArgument(...)})

Used above property and class fields
name (required): GraphQL schema field name, the property's field name will be used as the alias
arguments (optional): arguments for the specified graphQL schema.
When used above property fields the annotation simply aliases that field, but when used above class fields it will replace the defined class name.

example:

    ...
    @GraphQLProperty(name="myFavoriteUser", arguments={
        @GraphQLArgument(name="username", value="amex")
    })
    private User user;
    ...

result:

query {
    ...
    myFavoriteUser: user(username: "amex") {
        ...

@GraphQLVariable(name="name", scalar="Float!")

Used above property fields
name (required): GraphQL variable name
type (required): GraphQL scalar type. Including optional and required parsing (!)
This is good for sharing the same variables across multiple input parameters in a query.

example:

    ...
    @GraphQLVariable(name="isPublic", scalar="Boolean")
    private User user;
    ...

result:

query($isPublic: Boolean) {
    ...
    user(isPublic: $isPublic) {
        ...

@GraphQLVariables({@GraphQLVariable})

Used above property fields
Annotation for allowing mutliple variables for a given field.

example:

    ...
    @GraphQLVariables({
        @GraphQLVariable(name="isPublic", scalar="Boolean"),
        @GraphQLVariable(name="username", scalar="String!")
    })
    private User user;
    ...

result:

query($isPublic: Boolean, $username: String!) {
    ...
    user(isPublic: $isPublic, username: $username) {
        ...

Terminology

All language found in this library is aimed to align with the language used in the GraphQL specification. An example of this is GraphQL vs GraphQl, where in this library the GraphQL specification is favored over the Java standard.


Contributing

We welcome Your interest in the American Express Open Source Community on Github. Any Contributor to any Open Source Project managed by the American Express Open Source Community must accept and sign an Agreement indicating agreement to the terms below. Except for the rights granted in this Agreement to American Express and to recipients of software distributed by American Express, You reserve all right, title, and interest, if any, in and to Your Contributions. Please fill out the Agreement.

Please feel free to open pull requests and see CONTRIBUTING.md for commit formatting details.

License

Any contributions made under this project will be governed by the Apache License 2.0.

Code of Conduct

This project adheres to the American Express Community Guidelines. By participating, you are expected to honor these guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].