GithubHelp home page GithubHelp logo

isabella232 / graphql-java-datetime Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leolin310148/graphql-java-datetime

0.0 0.0 0.0 140 KB

GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.

License: Apache License 2.0

Shell 3.54% Java 59.28% Groovy 37.18%

graphql-java-datetime's Introduction

graphql-java-datetime

GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.

Build Status Latest Dev Build

Summary

A set of ISO 33601, RFC 3339 compatible date time scalars for GraphQL Java implementation (graphql-java).

Serialization

java.util.Date, java.time.LocalDate, java.time.LocalDateTime

Format                   JSON String
yyyy-MM-dd'T'HH:MM:ss.SSS'Z' 2017-07-09T13:14:45.947Z
yyyy-MM-dd'T'HH:MM:ss'Z' 2017-07-09T11:54:42Z
yyyy-MM-dd'T'HH:MM:ss 2017-07-09T11:54:42'
yyyy-MM-dd 2017-07-09

java.time.LocalTime

Format       JSON String
HH:MM:ss.SSS 17:59:59.129
HH:MM:ss 17:59:59
HH:MM 17:59

Usage

Spring Boot

Add graphql-datetime-spring-boot-starter starter to your project first.

Installation

Maven

Add folowing to your pom.xml:

<dependency>
  <groupId>com.zhokhov.graphql</groupId>
  <artifactId>graphql-datetime-spring-boot-starter</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle

Add folowing to your build.gradle:

compile 'com.zhokhov.graphql:graphql-datetime-spring-boot-starter:1.0.0'

Scalars

Add these scalars to your .graphqls schema file:

# java.util.Date implementation
scalar Date

# java.time.LocalDate implementation
scalar LocalDate

# java.time.LocalDateTime implementation
scalar LocalDateTime

# java.time.LocalTime implementation
scalar LocalTime

Sample

Now you can use these scalars in your application. Here is a graphql-datetime spring boot sample application, https://github.com/donbeave/graphql-java-datetime/tree/master/graphql-datetime-sample-app.

Bugs

To report any bug, please use the project Issues section on GitHub.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

License

Copyright © 2017 Alexey Zhokhov. All rights reserved.

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

graphql-java-datetime's People

Contributors

donbeave avatar

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.