Class ExtendedScalars
- java.lang.Object
-
- graphql.scalars.ExtendedScalars
-
@PublicApi public class ExtendedScalars extends java.lang.ObjectThis is the API entry point for all the extended scalars
-
-
Field Summary
Fields Modifier and Type Field Description static graphql.schema.GraphQLScalarTypeCountryCodeThe CountryCode scalar type as defined by ISO 3166-1 alpha-2.static graphql.schema.GraphQLScalarTypeCurrencyA field whose value is an ISO-4217 currency.static graphql.schema.GraphQLScalarTypeDateAn RFC-3339 compliant date scalar that accepts string values like `1996-12-19` and produces `java.time.LocalDate` objects at runtime.static graphql.schema.GraphQLScalarTypeDateTimeAn 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.GraphQLScalarTypeGraphQLBigDecimalThis represents the "BigDecimal" type which is a representation of java.math.BigDecimalstatic graphql.schema.GraphQLScalarTypeGraphQLBigIntegerThis represents the "BigInteger" type which is a representation of java.math.BigIntegerstatic graphql.schema.GraphQLScalarTypeGraphQLByteThis represents the "Byte" type which is a representation of java.lang.Bytestatic graphql.schema.GraphQLScalarTypeGraphQLCharThis represents the "Char" type which is a representation of java.lang.Characterstatic graphql.schema.GraphQLScalarTypeGraphQLLongThis represents the "Long" type which is a representation of java.lang.Longstatic graphql.schema.GraphQLScalarTypeGraphQLShortThis represents the "Short" type which is a representation of java.lang.Shortstatic graphql.schema.GraphQLScalarTypeJsonA synonym class for theObjectscalar, since some people prefer their SDL to look like the following :static graphql.schema.GraphQLScalarTypeLocaleA Locale scalar that accepts a IETF BCP 47 language tag string and producesLocaleobjects at runtime.static graphql.schema.GraphQLScalarTypeLocalTimeA 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.GraphQLScalarTypeNegativeFloatAn `Float` scalar that MUST be less than zerostatic graphql.schema.GraphQLScalarTypeNegativeIntAn `Int` scalar that MUST be less than zerostatic graphql.schema.GraphQLScalarTypeNonNegativeFloatAn `Float` scalar that MUST be greater than or equal to zerostatic graphql.schema.GraphQLScalarTypeNonNegativeIntAn `Int` scalar that MUST be greater than or equal to zerostatic graphql.schema.GraphQLScalarTypeNonPositiveFloatAn `Float` scalar that MUST be less than or equal to zerostatic graphql.schema.GraphQLScalarTypeNonPositiveIntAn `Int` scalar that MUST be less than or equal to zerostatic graphql.schema.GraphQLScalarTypeObjectAn object scalar allows you to have a multi level data value without defining it in the graphql schema.static graphql.schema.GraphQLScalarTypePositiveFloatAn `Float` scalar that MUST be greater than zerostatic graphql.schema.GraphQLScalarTypePositiveIntAn `Int` scalar that MUST be greater than zerostatic graphql.schema.GraphQLScalarTypeTimeAn 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.GraphQLScalarTypeUrlA URL scalar that accepts URL strings and producesURLobjects at runtimestatic graphql.schema.GraphQLScalarTypeUUIDA UUID scalar that accepts a universally unique identifier and producesUUIDobjects at runtime.
-
Constructor Summary
Constructors Constructor Description ExtendedScalars()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AliasedScalar.BuildernewAliasedScalar(java.lang.String name)This allows an existing scalar to be wrapped and aliased with a new name.static RegexScalar.BuildernewRegexScalar(java.lang.String name)A builder of a scalar that uses one or more regular expressionPatterns to control the acceptable values for that scalar.
-
-
-
Field Detail
-
DateTime
public static final 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.Its
Coercing.serialize(java.lang.Object)andCoercing.parseValue(java.lang.Object)methods accept OffsetDateTime, ZoneDateTime and formatted Strings as valid objects.See the rfc3339 spec for more details on the format.
- See Also:
OffsetDateTime,ZonedDateTime
-
Date
public static final 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.Its
Coercing.serialize(java.lang.Object)andCoercing.parseValue(java.lang.Object)methods accept dateTemporalAccessors and formatted Strings as valid objects.See the rfc3339 spec for more details on the format.
- See Also:
LocalDate
-
Time
public static final 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.Its
Coercing.serialize(java.lang.Object)andCoercing.parseValue(java.lang.Object)methods accept timeTemporalAccessors and formatted Strings as valid objects.See the rfc3339 spec for more details on the format.
- See Also:
OffsetTime
-
LocalTime
public static final 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.Its
Coercing.serialize(java.lang.Object)andCoercing.parseValue(java.lang.Object)methods accept timeTemporalAccessors and formatted Strings as valid objects.- See Also:
LocalTime
-
Object
public static final graphql.schema.GraphQLScalarType Object
An object scalar allows you to have a multi level data value without defining it in the graphql schema.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 }- See Also:
Json
-
Json
public static final graphql.schema.GraphQLScalarType Json
A synonym class for theObjectscalar, since some people prefer their SDL to look like the following :type Customer { name : String backendDetails : JSON }- See Also:
Object
-
Url
public static final graphql.schema.GraphQLScalarType Url
A URL scalar that accepts URL strings and producesURLobjects at runtime
-
Locale
public static final graphql.schema.GraphQLScalarType Locale
A Locale scalar that accepts a IETF BCP 47 language tag string and producesLocaleobjects at runtime.
-
Currency
public static final graphql.schema.GraphQLScalarType Currency
A field whose value is an ISO-4217 currency. See the ISO-4217 for more details.
-
CountryCode
public static final graphql.schema.GraphQLScalarType CountryCode
The CountryCode scalar type as defined by ISO 3166-1 alpha-2. See the ISO 3166-1 alpha-2 for more details.
-
UUID
public static graphql.schema.GraphQLScalarType UUID
A UUID scalar that accepts a universally unique identifier and producesUUIDobjects at runtime.
-
PositiveInt
public static final graphql.schema.GraphQLScalarType PositiveInt
An `Int` scalar that MUST be greater than zero- See Also:
Scalars.GraphQLInt
-
NegativeInt
public static final graphql.schema.GraphQLScalarType NegativeInt
An `Int` scalar that MUST be less than zero- See Also:
Scalars.GraphQLInt
-
NonPositiveInt
public static final graphql.schema.GraphQLScalarType NonPositiveInt
An `Int` scalar that MUST be less than or equal to zero- See Also:
Scalars.GraphQLInt
-
NonNegativeInt
public static final graphql.schema.GraphQLScalarType NonNegativeInt
An `Int` scalar that MUST be greater than or equal to zero- See Also:
Scalars.GraphQLInt
-
PositiveFloat
public static final graphql.schema.GraphQLScalarType PositiveFloat
An `Float` scalar that MUST be greater than zero- See Also:
Scalars.GraphQLFloat
-
NegativeFloat
public static final graphql.schema.GraphQLScalarType NegativeFloat
An `Float` scalar that MUST be less than zero- See Also:
Scalars.GraphQLFloat
-
NonPositiveFloat
public static final graphql.schema.GraphQLScalarType NonPositiveFloat
An `Float` scalar that MUST be less than or equal to zero- See Also:
Scalars.GraphQLFloat
-
NonNegativeFloat
public static final graphql.schema.GraphQLScalarType NonNegativeFloat
An `Float` scalar that MUST be greater than or equal to zero- See Also:
Scalars.GraphQLFloat
-
GraphQLLong
public static final graphql.schema.GraphQLScalarType GraphQLLong
This represents the "Long" type which is a representation of java.lang.Long
-
GraphQLShort
public static final graphql.schema.GraphQLScalarType GraphQLShort
This represents the "Short" type which is a representation of java.lang.Short
-
GraphQLByte
public static final graphql.schema.GraphQLScalarType GraphQLByte
This represents the "Byte" type which is a representation of java.lang.Byte
-
GraphQLBigDecimal
public static final graphql.schema.GraphQLScalarType GraphQLBigDecimal
This represents the "BigDecimal" type which is a representation of java.math.BigDecimal
-
GraphQLBigInteger
public static final graphql.schema.GraphQLScalarType GraphQLBigInteger
This represents the "BigInteger" type which is a representation of java.math.BigInteger
-
GraphQLChar
public static final graphql.schema.GraphQLScalarType GraphQLChar
This represents the "Char" type which is a representation of java.lang.Character
-
-
Method Detail
-
newRegexScalar
public static RegexScalar.Builder newRegexScalar(java.lang.String name)
A builder of a scalar that uses one or more regular expressionPatterns 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.
- Parameters:
name- the name of the scalar- Returns:
- a builder of a regex scalar
-
newAliasedScalar
public static AliasedScalar.Builder newAliasedScalar(java.lang.String name)
This allows an existing scalar to be wrapped and aliased with a new 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.
- Parameters:
name- the name of the aliased scalar- Returns:
- a builder of a aliased scalar
-
-