Class GraphqlType

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appsync.GraphqlType
All Implemented Interfaces:
IField, software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
Field

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.508Z") @Stability(Experimental) public class GraphqlType extends software.amazon.jsii.JsiiObject implements IField
(experimental) The GraphQL Types in AppSync's GraphQL.

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();
 
  • 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

      @Stability(Experimental) protected GraphqlType(@NotNull Type type)
      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 extended ISO 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

      @Stability(Experimental) @NotNull public static GraphqlType awsDate()
      (experimental) AWSDate scalar type represents a valid extended ISO 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 extended ISO 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

      @Stability(Experimental) @NotNull public static GraphqlType awsDateTime()
      (experimental) AWSDateTime scalar type represents a valid extended ISO 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

      @Stability(Experimental) @NotNull public static GraphqlType 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 valid IPv4 of IPv6 address string.

      Parameters:
      options - the options to configure this attribute - isList - isRequired - isRequiredList.
    • awsIpAddress

      @Stability(Experimental) @NotNull public static GraphqlType awsIpAddress()
      (experimental) AWSIPAddress scalar type respresents a valid IPv4 of IPv6 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

      @Stability(Experimental) @NotNull public static GraphqlType 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

      @Stability(Experimental) @NotNull public static GraphqlType 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 extended ISO 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

      @Stability(Experimental) @NotNull public static GraphqlType awsTime()
      (experimental) AWSTime scalar type represents a valid extended ISO 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 since 1970-01-01T00:00Z.

      Timestamps are serialized and deserialized as numbers.

      Parameters:
      options - the options to configure this attribute - isList - isRequired - isRequiredList.
    • awsTimestamp

      @Stability(Experimental) @NotNull public static GraphqlType awsTimestamp()
      (experimental) AWSTimestamp scalar type represents the number of seconds since 1970-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

      @Stability(Experimental) @NotNull public static GraphqlType 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

      @Stability(Experimental) @NotNull public static GraphqlType 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

      @Stability(Experimental) @NotNull public static GraphqlType doFloat()
      (experimental) Float scalar type is a signed double-precision fractional value.
    • id

      @Stability(Experimental) @NotNull public static GraphqlType id(@Nullable BaseTypeOptions options)
      (experimental) ID scalar type is a unique identifier. ID type is serialized similar to String.

      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

      @Stability(Experimental) @NotNull public static GraphqlType id()
      (experimental) ID scalar type is a unique identifier. ID type is serialized similar to String.

      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

      @Stability(Experimental) @NotNull public static GraphqlType 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

      @Stability(Experimental) @NotNull public static GraphqlType 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

      @Stability(Experimental) @NotNull public static GraphqlType string()
      (experimental) String scalar type is a free-form human-readable text.
    • argsToString

      @Stability(Experimental) @NotNull public String argsToString()
      (experimental) Generate the arguments for this field.
      Specified by:
      argsToString in interface IField
    • directivesToString

      @Stability(Experimental) @NotNull public String directivesToString(@Nullable List<AuthorizationType> _modes)
      (experimental) Generate the directives for this field.

      Specified by:
      directivesToString in interface IField
      Parameters:
      _modes -
    • directivesToString

      @Stability(Experimental) @NotNull public String directivesToString()
      (experimental) Generate the directives for this field.
      Specified by:
      directivesToString in interface IField
    • toString

      @Stability(Experimental) @NotNull public String toString()
      (experimental) Generate the string for this attribute.
      Specified by:
      toString in interface IField
      Overrides:
      toString in class Object
    • getIsList

      @Stability(Experimental) @NotNull public Boolean getIsList()
      (experimental) property determining if this attribute is a list i.e. if true, attribute would be [Type].

      Default: - false

      Specified by:
      getIsList in interface IField
    • getIsRequired

      @Stability(Experimental) @NotNull public Boolean getIsRequired()
      (experimental) property determining if this attribute is non-nullable i.e. if true, attribute would be Type! and this attribute must always have a value.

      Default: - false

      Specified by:
      getIsRequired in interface IField
    • getIsRequiredList

      @Stability(Experimental) @NotNull public Boolean 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 interface IField
    • getType

      @Stability(Experimental) @NotNull public Type getType()
      (experimental) the type of attribute.
      Specified by:
      getType in interface IField
    • getIntermediateType

      @Stability(Experimental) @Nullable public IIntermediateType getIntermediateType()
      (experimental) the intermediate type linked to this attribute (i.e. an interface or an object).

      Default: - no intermediate type

      Specified by:
      getIntermediateType in interface IField