Class GraphqlType
- All Implemented Interfaces:
IField
,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
Field
GraphQL Types are the building blocks for object types, queries, mutations, etc. They are types like String, Int, Id or even Object Types you create.
i.e. String
, String!
, [String]
, [String!]
, [String]!
GraphQL Types are used to define the entirety of schema.
Example:
GraphqlApi api; MappingTemplate dummyRequest; MappingTemplate dummyResponse; ObjectType info = ObjectType.Builder.create("Info") .definition(Map.of( "node", ResolvableField.Builder.create() .returnType(GraphqlType.string()) .args(Map.of( "id", GraphqlType.string())) .dataSource(api.addNoneDataSource("none")) .requestMappingTemplate(dummyRequest) .responseMappingTemplate(dummyResponse) .build())) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.IField
IField.Jsii$Default, IField.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GraphqlType
(Type type) protected
GraphqlType
(Type type, GraphqlTypeOptions options) protected
GraphqlType
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
GraphqlType
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescription(experimental) Generate the arguments for this field.static GraphqlType
awsDate()
(experimental)AWSDate
scalar type represents a valid extendedISO 8601 Date
string.static GraphqlType
awsDate
(BaseTypeOptions options) (experimental)AWSDate
scalar type represents a valid extendedISO 8601 Date
string.static GraphqlType
(experimental)AWSDateTime
scalar type represents a valid extendedISO 8601 DateTime
string.static GraphqlType
awsDateTime
(BaseTypeOptions options) (experimental)AWSDateTime
scalar type represents a valid extendedISO 8601 DateTime
string.static GraphqlType
awsEmail()
(experimental)AWSEmail
scalar type represents an email address string (i.e.username@example.com
).static GraphqlType
awsEmail
(BaseTypeOptions options) (experimental)AWSEmail
scalar type represents an email address string (i.e.username@example.com
).static GraphqlType
(experimental)AWSIPAddress
scalar type respresents a validIPv4
ofIPv6
address string.static GraphqlType
awsIpAddress
(BaseTypeOptions options) (experimental)AWSIPAddress
scalar type respresents a validIPv4
ofIPv6
address string.static GraphqlType
awsJson()
(experimental)AWSJson
scalar type represents a JSON string.static GraphqlType
awsJson
(BaseTypeOptions options) (experimental)AWSJson
scalar type represents a JSON string.static GraphqlType
awsPhone()
(experimental)AWSPhone
scalar type represents a valid phone number.static GraphqlType
awsPhone
(BaseTypeOptions options) (experimental)AWSPhone
scalar type represents a valid phone number.static GraphqlType
awsTime()
(experimental)AWSTime
scalar type represents a valid extendedISO 8601 Time
string.static GraphqlType
awsTime
(BaseTypeOptions options) (experimental)AWSTime
scalar type represents a valid extendedISO 8601 Time
string.static GraphqlType
(experimental)AWSTimestamp
scalar type represents the number of seconds since1970-01-01T00:00Z
.static GraphqlType
awsTimestamp
(BaseTypeOptions options) (experimental)AWSTimestamp
scalar type represents the number of seconds since1970-01-01T00:00Z
.static GraphqlType
awsUrl()
(experimental)AWSURL
scalar type represetns a valid URL string.static GraphqlType
awsUrl
(BaseTypeOptions options) (experimental)AWSURL
scalar type represetns a valid URL string.(experimental) Generate the directives for this field.directivesToString
(List<AuthorizationType> _modes) (experimental) Generate the directives for this field.static GraphqlType
(experimental)Boolean
scalar type is a boolean value: true or false.static GraphqlType
doBoolean
(BaseTypeOptions options) (experimental)Boolean
scalar type is a boolean value: true or false.static GraphqlType
doFloat()
(experimental)Float
scalar type is a signed double-precision fractional value.static GraphqlType
doFloat
(BaseTypeOptions options) (experimental)Float
scalar type is a signed double-precision fractional value.static GraphqlType
doInt()
(experimental)Int
scalar type is a signed non-fractional numerical value.static GraphqlType
doInt
(BaseTypeOptions options) (experimental)Int
scalar type is a signed non-fractional numerical value.(experimental) the intermediate type linked to this attribute (i.e.(experimental) property determining if this attribute is a list i.e.(experimental) property determining if this attribute is non-nullable i.e.(experimental) property determining if this attribute is a non-nullable list i.e.getType()
(experimental) the type of attribute.static GraphqlType
id()
(experimental)ID
scalar type is a unique identifier.static GraphqlType
id
(BaseTypeOptions options) (experimental)ID
scalar type is a unique identifier.static GraphqlType
(experimental) an intermediate type to be added as an attribute (i.e.static GraphqlType
intermediate
(GraphqlTypeOptions options) (experimental) an intermediate type to be added as an attribute (i.e.static GraphqlType
string()
(experimental)String
scalar type is a free-form human-readable text.static GraphqlType
string
(BaseTypeOptions options) (experimental)String
scalar type is a free-form human-readable text.toString()
(experimental) Generate the string for this attribute.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.services.appsync.IField
getFieldOptions
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
GraphqlType
protected GraphqlType(software.amazon.jsii.JsiiObjectRef objRef) -
GraphqlType
protected GraphqlType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
GraphqlType
@Stability(Experimental) protected GraphqlType(@NotNull Type type, @Nullable GraphqlTypeOptions options) - Parameters:
type
- This parameter is required.options
-
-
GraphqlType
- Parameters:
type
- This parameter is required.
-
-
Method Details
-
awsDate
@Stability(Experimental) @NotNull public static GraphqlType awsDate(@Nullable BaseTypeOptions options) (experimental)AWSDate
scalar type represents a valid extendedISO 8601 Date
string.In other words, accepts date strings in the form of
YYYY-MM-DD
. It accepts time zone offsets.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsDate
(experimental)AWSDate
scalar type represents a valid extendedISO 8601 Date
string.In other words, accepts date strings in the form of
YYYY-MM-DD
. It accepts time zone offsets. -
awsDateTime
@Stability(Experimental) @NotNull public static GraphqlType awsDateTime(@Nullable BaseTypeOptions options) (experimental)AWSDateTime
scalar type represents a valid extendedISO 8601 DateTime
string.In other words, accepts date strings in the form of
YYYY-MM-DDThh:mm:ss.sssZ
. It accepts time zone offsets.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsDateTime
(experimental)AWSDateTime
scalar type represents a valid extendedISO 8601 DateTime
string.In other words, accepts date strings in the form of
YYYY-MM-DDThh:mm:ss.sssZ
. It accepts time zone offsets. -
awsEmail
@Stability(Experimental) @NotNull public static GraphqlType awsEmail(@Nullable BaseTypeOptions options) (experimental)AWSEmail
scalar type represents an email address string (i.e.username@example.com
).- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsEmail
(experimental)AWSEmail
scalar type represents an email address string (i.e.username@example.com
). -
awsIpAddress
@Stability(Experimental) @NotNull public static GraphqlType awsIpAddress(@Nullable BaseTypeOptions options) (experimental)AWSIPAddress
scalar type respresents a validIPv4
ofIPv6
address string.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsIpAddress
(experimental)AWSIPAddress
scalar type respresents a validIPv4
ofIPv6
address string. -
awsJson
@Stability(Experimental) @NotNull public static GraphqlType awsJson(@Nullable BaseTypeOptions options) (experimental)AWSJson
scalar type represents a JSON string.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsJson
(experimental)AWSJson
scalar type represents a JSON string. -
awsPhone
@Stability(Experimental) @NotNull public static GraphqlType awsPhone(@Nullable BaseTypeOptions options) (experimental)AWSPhone
scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.The number can specify a country code at the beginning, but is not required for US phone numbers.
- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsPhone
(experimental)AWSPhone
scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.The number can specify a country code at the beginning, but is not required for US phone numbers.
-
awsTime
@Stability(Experimental) @NotNull public static GraphqlType awsTime(@Nullable BaseTypeOptions options) (experimental)AWSTime
scalar type represents a valid extendedISO 8601 Time
string.In other words, accepts date strings in the form of
hh:mm:ss.sss
. It accepts time zone offsets.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsTime
(experimental)AWSTime
scalar type represents a valid extendedISO 8601 Time
string.In other words, accepts date strings in the form of
hh:mm:ss.sss
. It accepts time zone offsets. -
awsTimestamp
@Stability(Experimental) @NotNull public static GraphqlType awsTimestamp(@Nullable BaseTypeOptions options) (experimental)AWSTimestamp
scalar type represents the number of seconds since1970-01-01T00:00Z
.Timestamps are serialized and deserialized as numbers.
- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsTimestamp
(experimental)AWSTimestamp
scalar type represents the number of seconds since1970-01-01T00:00Z
.Timestamps are serialized and deserialized as numbers.
-
awsUrl
@Stability(Experimental) @NotNull public static GraphqlType awsUrl(@Nullable BaseTypeOptions options) (experimental)AWSURL
scalar type represetns a valid URL string.URLs wihtout schemes or contain double slashes are considered invalid.
- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
awsUrl
(experimental)AWSURL
scalar type represetns a valid URL string.URLs wihtout schemes or contain double slashes are considered invalid.
-
doBoolean
@Stability(Experimental) @NotNull public static GraphqlType doBoolean(@Nullable BaseTypeOptions options) (experimental)Boolean
scalar type is a boolean value: true or false.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
doBoolean
(experimental)Boolean
scalar type is a boolean value: true or false. -
doFloat
@Stability(Experimental) @NotNull public static GraphqlType doFloat(@Nullable BaseTypeOptions options) (experimental)Float
scalar type is a signed double-precision fractional value.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
doFloat
(experimental)Float
scalar type is a signed double-precision fractional value. -
id
(experimental)ID
scalar type is a unique identifier.ID
type is serialized similar toString
.Often used as a key for a cache and not intended to be human-readable.
- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
id
(experimental)ID
scalar type is a unique identifier.ID
type is serialized similar toString
.Often used as a key for a cache and not intended to be human-readable.
-
doInt
@Stability(Experimental) @NotNull public static GraphqlType doInt(@Nullable BaseTypeOptions options) (experimental)Int
scalar type is a signed non-fractional numerical value.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
doInt
(experimental)Int
scalar type is a signed non-fractional numerical value. -
intermediate
@Stability(Experimental) @NotNull public static GraphqlType intermediate(@Nullable GraphqlTypeOptions options) (experimental) an intermediate type to be added as an attribute (i.e. an interface or an object type).- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList - intermediateType.
-
intermediate
(experimental) an intermediate type to be added as an attribute (i.e. an interface or an object type). -
string
@Stability(Experimental) @NotNull public static GraphqlType string(@Nullable BaseTypeOptions options) (experimental)String
scalar type is a free-form human-readable text.- Parameters:
options
- the options to configure this attribute - isList - isRequired - isRequiredList.
-
string
(experimental)String
scalar type is a free-form human-readable text. -
argsToString
(experimental) Generate the arguments for this field.- Specified by:
argsToString
in interfaceIField
-
directivesToString
@Stability(Experimental) @NotNull public String directivesToString(@Nullable List<AuthorizationType> _modes) (experimental) Generate the directives for this field.- Specified by:
directivesToString
in interfaceIField
- Parameters:
_modes
-
-
directivesToString
(experimental) Generate the directives for this field.- Specified by:
directivesToString
in interfaceIField
-
toString
(experimental) Generate the string for this attribute. -
getIsList
(experimental) property determining if this attribute is a list i.e. if true, attribute would be[Type]
.Default: - false
-
getIsRequired
(experimental) property determining if this attribute is non-nullable i.e. if true, attribute would beType!
and this attribute must always have a value.Default: - false
- Specified by:
getIsRequired
in interfaceIField
-
getIsRequiredList
(experimental) property determining if this attribute is a non-nullable list i.e. if true, attribute would be[ Type ]!
and this attribute's list must always have a value.Default: - false
- Specified by:
getIsRequiredList
in interfaceIField
-
getType
(experimental) the type of attribute. -
getIntermediateType
(experimental) the intermediate type linked to this attribute (i.e. an interface or an object).Default: - no intermediate type
- Specified by:
getIntermediateType
in interfaceIField
-