You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/scalars.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Scalars"
3
-
date: 2018-09-09T12:52:46+10:00
3
+
date: 2024-01-11
4
4
description: How scalar types work in graphql and how to write your own scalars
5
5
---
6
6
# Scalars in GraphQL
@@ -21,20 +21,22 @@ The [GraphQL specification](https://spec.graphql.org/draft/#sec-Scalars) states
21
21
22
22
The class ``graphql.Scalars`` contains singleton instances of the provided scalar types.
23
23
24
-
[graphql-java-extended-scalars](https://github.com/graphql-java/graphql-java-extended-scalars) adds the following scalar types which are useful in Java based systems:
24
+
[graphql-java-extended-scalars](https://github.com/graphql-java/graphql-java-extended-scalars) adds many more scalars, including the following which are useful in Java based systems:
25
25
26
26
* Long aka ``GraphQLLong`` - a java.lang.Long based scalar
27
27
* Short aka ``GraphQLShort`` - a java.lang.Short based scalar
28
28
* Byte aka ``GraphQLByte`` - a java.lang.Byte based scalar
29
29
* BigDecimal aka ``GraphQLBigDecimal`` - a java.math.BigDecimal based scalar
30
30
* BigInteger aka ``GraphQLBigInteger`` - a java.math.BigInteger based scalar
31
31
32
+
See the [documentation](https://github.com/graphql-java/graphql-java-extended-scalars) for how to use Extended Scalars.
33
+
32
34
## Writing your own Custom Scalars
33
35
34
-
You can write your own custom scalar implementations. In doing so you take on the responsibility for coercing values
36
+
If the scalar you want isn't in a library, you can also write your own custom scalar implementation. In doing so you take on the responsibility for coercing values
35
37
at runtime, which we will explain in a moment.
36
38
37
-
Imagine we decide we need to have an email scalar type. It will take email addresses as input and output.
39
+
Imagine we decide we need to have an email scalar type. It will take email addresses as input and output.
38
40
39
41
We would create a singleton ``graphql.schema.GraphQLScalarType`` instance for this.
40
42
@@ -44,17 +46,17 @@ public static final GraphQLScalarType EMAIL = GraphQLScalarType.newScalar()
44
46
.description("A custom scalar that handles emails")
Copy file name to clipboardExpand all lines: src/pages/about.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,6 @@ hide_table_of_contents: true
6
6
7
7
# About
8
8
9
-
The GraphQL Java project is run by [Andreas Marek](https://twitter.com/andimarek) and [Brad Baker](https://github.com/bbakerman).
9
+
The GraphQL Java project is run by [Andreas Marek](https://github.com/andimarek), [Brad Baker](https://github.com/bbakerman), and [Donna Zhou](https://github.com/dondonz).
10
10
11
11
Andreas Marek is responsible for the content of this website.
12
-
13
-
You can also follow [GraphQL Java on Twitter](https://twitter.com/graphql_java).
0 commit comments