@PublicApi
public class ExtendedScalars
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static graphql.schema.GraphQLScalarType |
Date
An RFC-3339 compliant date scalar that accepts string values like `1996-12-19` and produces
`java.time.LocalDate` objects at runtime.
|
static graphql.schema.GraphQLScalarType |
DateTime
An RFC-3339 compliant date time scalar that accepts string values like `1996-12-19T16:39:57-08:00` and produces
`java.time.OffsetDateTime` objects at runtime.
|
static graphql.schema.GraphQLScalarType |
GraphQLBigDecimal
This represents the "BigDecimal" type which is a representation of java.math.BigDecimal
|
static graphql.schema.GraphQLScalarType |
GraphQLBigInteger
This represents the "BigInteger" type which is a representation of java.math.BigInteger
|
static graphql.schema.GraphQLScalarType |
GraphQLByte
This represents the "Byte" type which is a representation of java.lang.Byte
|
static graphql.schema.GraphQLScalarType |
GraphQLChar
This represents the "Char" type which is a representation of java.lang.Character
|
static graphql.schema.GraphQLScalarType |
GraphQLLong
This represents the "Long" type which is a representation of java.lang.Long
|
static graphql.schema.GraphQLScalarType |
GraphQLShort
This represents the "Short" type which is a representation of java.lang.Short
|
static graphql.schema.GraphQLScalarType |
Json
A synonym class for the
Object scalar, since some people prefer their SDL to look like the following : |
static graphql.schema.GraphQLScalarType |
Locale
A Locale scalar that accepts a IETF BCP 47 language tag string and produces
Locale objects at runtime. |
static graphql.schema.GraphQLScalarType |
NegativeFloat
An `Float` scalar that MUST be less than zero
|
static graphql.schema.GraphQLScalarType |
NegativeInt
An `Int` scalar that MUST be less than zero
|
static graphql.schema.GraphQLScalarType |
NonNegativeFloat
An `Float` scalar that MUST be greater than or equal to zero
|
static graphql.schema.GraphQLScalarType |
NonNegativeInt
An `Int` scalar that MUST be greater than or equal to zero
|
static graphql.schema.GraphQLScalarType |
NonPositiveFloat
An `Float` scalar that MUST be less than or equal to zero
|
static graphql.schema.GraphQLScalarType |
NonPositiveInt
An `Int` scalar that MUST be less than or equal to zero
|
static graphql.schema.GraphQLScalarType |
Object
An object scalar allows you to have a multi level data value without defining it in the graphql schema.
|
static graphql.schema.GraphQLScalarType |
PositiveFloat
An `Float` scalar that MUST be greater than zero
|
static graphql.schema.GraphQLScalarType |
PositiveInt
An `Int` scalar that MUST be greater than zero
|
static graphql.schema.GraphQLScalarType |
Time
An RFC-3339 compliant time scalar that accepts string values like `6:39:57-08:00` and produces
`java.time.OffsetTime` objects at runtime.
|
static graphql.schema.GraphQLScalarType |
Url
A URL scalar that accepts URL strings and produces
URL objects at runtime |
Constructor and Description |
---|
ExtendedScalars() |
Modifier and Type | Method and Description |
---|---|
static AliasedScalar.Builder |
newAliasedScalar(java.lang.String name)
This allows an existing scalar to be wrapped and aliased with a new name.
|
static RegexScalar.Builder |
newRegexScalar(java.lang.String name)
A builder of a scalar that uses one or more regular expression
Pattern s to control
the acceptable values for that scalar. |
public static graphql.schema.GraphQLScalarType DateTime
Its Coercing.serialize(java.lang.Object)
and Coercing.parseValue(java.lang.Object)
methods
accept OffsetDateTime, ZoneDateTime and formatted Strings as valid objects.
See the rfc3339 spec for more details on the format.
OffsetDateTime
,
ZonedDateTime
public static graphql.schema.GraphQLScalarType Date
Its Coercing.serialize(java.lang.Object)
and Coercing.parseValue(java.lang.Object)
methods
accept date TemporalAccessor
s and formatted Strings as valid objects.
See the rfc3339 spec for more details on the format.
LocalDate
public static graphql.schema.GraphQLScalarType Time
Its Coercing.serialize(java.lang.Object)
and Coercing.parseValue(java.lang.Object)
methods
accept time TemporalAccessor
s and formatted Strings as valid objects.
See the rfc3339 spec for more details on the format.
OffsetTime
public static graphql.schema.GraphQLScalarType Object
It might be useful when you have opaque data coming from a backend system that you want to pass on but cant provide the actual graphql schema definition for.
Use this with caution since is breaks one of the key benefits of graphql, which is that a schema describes the shape of the data that can be queried.
This can be declared as follows :
type Customer {
name : String
backendDetails : Object
}
Json
public static graphql.schema.GraphQLScalarType Json
Object
scalar, since some people prefer their SDL to look like the following :
type Customer {
name : String
backendDetails : JSON
}
Object
public static graphql.schema.GraphQLScalarType Url
URL
objects at runtimepublic static graphql.schema.GraphQLScalarType Locale
Locale
objects at runtime.public static graphql.schema.GraphQLScalarType PositiveInt
Scalars.GraphQLInt
public static graphql.schema.GraphQLScalarType NegativeInt
Scalars.GraphQLInt
public static graphql.schema.GraphQLScalarType NonPositiveInt
Scalars.GraphQLInt
public static graphql.schema.GraphQLScalarType NonNegativeInt
Scalars.GraphQLInt
public static graphql.schema.GraphQLScalarType PositiveFloat
Scalars.GraphQLFloat
public static graphql.schema.GraphQLScalarType NegativeFloat
Scalars.GraphQLFloat
public static graphql.schema.GraphQLScalarType NonPositiveFloat
Scalars.GraphQLFloat
public static graphql.schema.GraphQLScalarType NonNegativeFloat
Scalars.GraphQLFloat
public static final graphql.schema.GraphQLScalarType GraphQLLong
public static final graphql.schema.GraphQLScalarType GraphQLShort
public static final graphql.schema.GraphQLScalarType GraphQLByte
public static final graphql.schema.GraphQLScalarType GraphQLBigDecimal
public static final graphql.schema.GraphQLScalarType GraphQLBigInteger
public static final graphql.schema.GraphQLScalarType GraphQLChar
public static RegexScalar.Builder newRegexScalar(java.lang.String name)
Pattern
s to control
the acceptable values for that scalar.
The scalar converts any passed in objects to Strings first and them matches it against the provided scalars to ensure its an acceptable value.
name
- the name of the scalarpublic static AliasedScalar.Builder newAliasedScalar(java.lang.String name)
For example you may take a `String` scalar and alias it as `SocialMediaLink` if that helps introduce more semantic meaning to your type system.
type Customer {
name : String
socialMediaLink : SocialMediaLink
}
A future version of the graphql specification may add this capability but in the meantime you can use this facility.
name
- the name of the aliased scalar