@PublicApi
public class ExtendedScalars
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static graphql.schema.GraphQLScalarType |
CountryCode
The CountryCode scalar type as defined by ISO 3166-1 alpha-2.
|
static graphql.schema.GraphQLScalarType |
Currency
A field whose value is an ISO-4217 currency.
|
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 |
LocalTime
A 24-hour local time scalar that accepts strings like `hh:mm:ss` and `hh:mm:ss.sss` and produces
`java.time.LocalTime` 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 |
static graphql.schema.GraphQLScalarType |
UUID
A UUID scalar that accepts a universally unique identifier and produces
UUID 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
Patterns to control
the acceptable values for that scalar. |
public static final 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,
ZonedDateTimepublic static final graphql.schema.GraphQLScalarType Date
Its Coercing.serialize(java.lang.Object) and Coercing.parseValue(java.lang.Object) methods
accept date TemporalAccessors and formatted Strings as valid objects.
See the rfc3339 spec for more details on the format.
LocalDatepublic static final graphql.schema.GraphQLScalarType Time
Its Coercing.serialize(java.lang.Object) and Coercing.parseValue(java.lang.Object) methods
accept time TemporalAccessors and formatted Strings as valid objects.
See the rfc3339 spec for more details on the format.
OffsetTimepublic static final graphql.schema.GraphQLScalarType LocalTime
Its Coercing.serialize(java.lang.Object) and Coercing.parseValue(java.lang.Object) methods
accept time TemporalAccessors and formatted Strings as valid objects.
LocalTimepublic static final 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
}
Jsonpublic static final graphql.schema.GraphQLScalarType Json
Object scalar, since some people prefer their SDL to look like the following :
type Customer {
name : String
backendDetails : JSON
}
Objectpublic static final graphql.schema.GraphQLScalarType Url
URL objects at runtimepublic static final graphql.schema.GraphQLScalarType Locale
Locale objects at runtime.public static final graphql.schema.GraphQLScalarType Currency
public static final graphql.schema.GraphQLScalarType CountryCode
public static graphql.schema.GraphQLScalarType UUID
UUID objects at runtime.public static final graphql.schema.GraphQLScalarType PositiveInt
Scalars.GraphQLIntpublic static final graphql.schema.GraphQLScalarType NegativeInt
Scalars.GraphQLIntpublic static final graphql.schema.GraphQLScalarType NonPositiveInt
Scalars.GraphQLIntpublic static final graphql.schema.GraphQLScalarType NonNegativeInt
Scalars.GraphQLIntpublic static final graphql.schema.GraphQLScalarType PositiveFloat
Scalars.GraphQLFloatpublic static final graphql.schema.GraphQLScalarType NegativeFloat
Scalars.GraphQLFloatpublic static final graphql.schema.GraphQLScalarType NonPositiveFloat
Scalars.GraphQLFloatpublic static final graphql.schema.GraphQLScalarType NonNegativeFloat
Scalars.GraphQLFloatpublic 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)
Patterns 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