Class InterfaceType

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appsync.InterfaceType
All Implemented Interfaces:
IIntermediateType, software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
ObjectType

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.521Z") @Stability(Experimental) public class InterfaceType extends software.amazon.jsii.JsiiObject implements IIntermediateType
(experimental) Interface Types are abstract types that includes a certain set of fields that other types must include if they implement the interface.

Example:

 InterfaceType node = InterfaceType.Builder.create("Node")
         .definition(Map.of(
                 "id", GraphqlType.string(BaseTypeOptions.builder().isRequired(true).build())))
         .build();
 ObjectType demo = ObjectType.Builder.create("Demo")
         .interfaceTypes(List.of(node))
         .definition(Map.of(
                 "version", GraphqlType.string(BaseTypeOptions.builder().isRequired(true).build())))
         .build();
 
  • Constructor Details

    • InterfaceType

      protected InterfaceType(software.amazon.jsii.JsiiObjectRef objRef)
    • InterfaceType

      protected InterfaceType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • InterfaceType

      @Stability(Experimental) public InterfaceType(@NotNull String name, @NotNull IntermediateTypeOptions props)
      Parameters:
      name - This parameter is required.
      props - This parameter is required.
  • Method Details

    • addField

      @Stability(Experimental) public void addField(@NotNull AddFieldOptions options)
      (experimental) Add a field to this Interface Type.

      Interface Types must have both fieldName and field options.

      Specified by:
      addField in interface IIntermediateType
      Parameters:
      options - the options to add a field. This parameter is required.
    • attribute

      @Stability(Experimental) @NotNull public GraphqlType attribute(@Nullable BaseTypeOptions options)
      (experimental) Create a GraphQL Type representing this Intermediate Type.

      Specified by:
      attribute in interface IIntermediateType
      Parameters:
      options - the options to configure this attribute.
    • attribute

      @Stability(Experimental) @NotNull public GraphqlType attribute()
      (experimental) Create a GraphQL Type representing this Intermediate Type.
      Specified by:
      attribute in interface IIntermediateType
    • toString

      @Stability(Experimental) @NotNull public String toString()
      (experimental) Generate the string of this object type.
      Specified by:
      toString in interface IIntermediateType
      Overrides:
      toString in class Object
    • getDefinition

      @Stability(Experimental) @NotNull public Map<String,IField> getDefinition()
      (experimental) the attributes of this type.
      Specified by:
      getDefinition in interface IIntermediateType
    • getName

      @Stability(Experimental) @NotNull public String getName()
      (experimental) the name of this type.
      Specified by:
      getName in interface IIntermediateType
    • getDirectives

      @Stability(Experimental) @Nullable public List<Directive> getDirectives()
      (experimental) the directives for this object type.

      Default: - no directives

      Specified by:
      getDirectives in interface IIntermediateType
    • getModes

      @Stability(Experimental) @Nullable protected List<AuthorizationType> getModes()
      (experimental) the authorization modes for this intermediate type.
    • setModes

      @Stability(Experimental) protected void setModes(@Nullable List<AuthorizationType> value)
      (experimental) the authorization modes for this intermediate type.