FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
graphql-java/src/main/java/graphql/Scalars.java at parser-cleanup · graphql-java/graphql-java · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
graphql-java
/
graphql-java
Public
Notifications
You must be signed in to change notification settings
Fork
1.1k
Star
6.2k
Code
Issues
22
Pull requests
17
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
graphql-java
/
src
/
main
/
java
/
graphql
/
Scalars.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
61 lines (53 loc) · 3.1 KB
Breadcrumbs
graphql-java
/
src
/
main
/
java
/
graphql
/
Scalars.java
Copy path
File metadata and controls
61 lines (53 loc) · 3.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package
graphql
;
import
graphql
.
scalar
.
GraphqlBooleanCoercing
;
import
graphql
.
scalar
.
GraphqlFloatCoercing
;
import
graphql
.
scalar
.
GraphqlIDCoercing
;
import
graphql
.
scalar
.
GraphqlIntCoercing
;
import
graphql
.
scalar
.
GraphqlStringCoercing
;
import
graphql
.
schema
.
GraphQLScalarType
;
import
org
.
jspecify
.
annotations
.
NullMarked
;
/**
* This contains the implementations of the Scalar types that ship with graphql-java. Some are proscribed
* by the graphql specification (Int, Float, String, Boolean and ID) while others are offer because they are common on
* Java platforms.
* <p>
* For more info see <a href="https://graphql.org/learn/schema/#scalar-types">https://graphql.org/learn/schema/#scalar-types</a> and
* more specifically <a href="https://spec.graphql.org/draft/#sec-Scalars">https://spec.graphql.org/draft/#sec-Scalars</a>
*/
@
PublicApi
@
NullMarked
public
class
Scalars
{
/**
* This represents the "Int" type as defined in the graphql specification : <a href="https://spec.graphql.org/October2021/#sec-Int">...</a>
* <p>
* The Int scalar type represents a signed 32‐bit numeric non‐fractional value.
*/
public
static
final
GraphQLScalarType
GraphQLInt
=
GraphQLScalarType
.
newScalar
()
.
name
(
"Int"
).
description
(
"Built-in Int"
).
coercing
(
new
GraphqlIntCoercing
()).
build
();
/**
* This represents the "Float" type as defined in the graphql specification : <a href="https://spec.graphql.org/October2021/#sec-Float">...</a>
* <p>
* Note: The Float type in GraphQL is equivalent to Double in Java. (double precision IEEE 754)
*/
public
static
final
GraphQLScalarType
GraphQLFloat
=
GraphQLScalarType
.
newScalar
()
.
name
(
"Float"
).
description
(
"Built-in Float"
).
coercing
(
new
GraphqlFloatCoercing
()).
build
();
/**
* This represents the "String" type as defined in the graphql specification : <a href="https://spec.graphql.org/October2021/#sec-String">...</a>
*/
public
static
final
GraphQLScalarType
GraphQLString
=
GraphQLScalarType
.
newScalar
()
.
name
(
"String"
).
description
(
"Built-in String"
).
coercing
(
new
GraphqlStringCoercing
()).
build
();
/**
* This represents the "Boolean" type as defined in the graphql specification : <a href="https://spec.graphql.org/October2021/#sec-Boolean">...</a>
*/
public
static
final
GraphQLScalarType
GraphQLBoolean
=
GraphQLScalarType
.
newScalar
()
.
name
(
"Boolean"
).
description
(
"Built-in Boolean"
).
coercing
(
new
GraphqlBooleanCoercing
()).
build
();
/**
* This represents the "ID" type as defined in the graphql specification : <a href="https://spec.graphql.org/October2021/#sec-ID">...</a>
* <p>
* The ID scalar type represents a unique identifier, often used to re-fetch an object or as the key for a cache. The
* ID type is serialized in the same way as a String; however, it is not intended to be human‐readable. While it is
* often numeric, it should always serialize as a String.
*/
public
static
final
GraphQLScalarType
GraphQLID
=
GraphQLScalarType
.
newScalar
()
.
name
(
"ID"
).
description
(
"Built-in ID"
).
coercing
(
new
GraphqlIDCoercing
()).
build
();
}
Back
|
FazBrowse Home
|
New Git URL