Skip to content

Commit feea5be

Browse files
committed
Initial commit
0 parents  commit feea5be

19 files changed

Lines changed: 920 additions & 0 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
.gradle
3+
out
4+
*.iml

build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
}
6+
7+
apply plugin: 'java'
8+
apply plugin: 'groovy'
9+
10+
group = 'com.graphql-java'
11+
version = '0.0.1-SNAPSHOT'
12+
sourceCompatibility = 1.8
13+
14+
repositories {
15+
mavenCentral()
16+
maven { url "http://dl.bintray.com/andimarek/graphql-java" }
17+
}
18+
19+
20+
dependencies {
21+
compile "com.graphql-java:graphql-java:10.0"
22+
compile "com.ethlo.time:itu:1.2"
23+
24+
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
25+
testCompile 'org.codehaus.groovy:groovy-all:2.4.13'
26+
}

gradle/wrapper/gradle-wrapper.jar

53.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sat Sep 15 15:12:07 AEST 2018
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
# Big work in PROGRESS
4+
5+
Not released and not ready for external consumption yet!
6+
7+
Still exploring what it could be

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'graphql-java-scalars'
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package graphql.scalars;
2+
3+
import graphql.PublicApi;
4+
import graphql.scalars.datetime.DateTimeScalar;
5+
import graphql.scalars.datetime.FullDateScalar;
6+
import graphql.scalars.datetime.FullTimeScalar;
7+
import graphql.scalars.object.JsonScalar;
8+
import graphql.scalars.object.ObjectScalar;
9+
import graphql.schema.GraphQLScalarType;
10+
11+
@PublicApi
12+
public class ExtendedScalars {
13+
14+
15+
public static GraphQLScalarType DateTime = new DateTimeScalar();
16+
public static GraphQLScalarType Date = new FullDateScalar();
17+
public static GraphQLScalarType Time = new FullTimeScalar();
18+
19+
/**
20+
* An object scalar allows you to have a multi level data value without defining it in the graphql schema.
21+
* <p>
22+
* It might be useful when you have opaque data coming from a backend system that you want to pass on
23+
* but cant provide the actual graphql schema definition for.
24+
* <p>
25+
* <b>Use this with caution</b> since is breaks one of the key benefits
26+
* of graphql, which is that a schema describes the shape of the data that can be queried.
27+
*
28+
* <p>
29+
* This can be declared as follows :
30+
* <pre>
31+
* {@code
32+
*
33+
* type Customer {
34+
* name : String
35+
* backendDetails : Object
36+
* }
37+
* }
38+
* </pre>
39+
*
40+
* @see #Json
41+
*/
42+
public static GraphQLScalarType Object = new ObjectScalar();
43+
44+
/**
45+
* A synonym class for the {@link #Object} scalar, since some people prefer their SDL to look like the following :
46+
*
47+
* <pre>
48+
* {@code
49+
*
50+
* type Customer {
51+
* name : String
52+
* backendDetails : JSON
53+
* }
54+
* }
55+
* </pre>
56+
*/
57+
public static GraphQLScalarType Json = new JsonScalar();
58+
}

0 commit comments

Comments
 (0)