Class ObjectType

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.553Z") @Stability(Experimental) public class ObjectType extends InterfaceType implements IIntermediateType
(experimental) Object Types are types declared by you.

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

    • ObjectType

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

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

      @Stability(Experimental) public ObjectType(@NotNull String name, @NotNull ObjectTypeOptions 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 Object Type.

      Object Types must have both fieldName and field options.

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

      @Stability(Experimental) @NotNull protected Resolver generateResolver(@NotNull IGraphqlApi api, @NotNull String fieldName, @Nullable ResolvableFieldOptions options)
      (experimental) Generate the resolvers linked to this Object Type.

      Parameters:
      api - This parameter is required.
      fieldName - This parameter is required.
      options -
    • generateResolver

      @Stability(Experimental) @NotNull protected Resolver generateResolver(@NotNull IGraphqlApi api, @NotNull String fieldName)
      (experimental) Generate the resolvers linked to this Object Type.

      Parameters:
      api - This parameter is required.
      fieldName - This parameter is required.
    • 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 InterfaceType
    • getInterfaceTypes

      @Stability(Experimental) @Nullable public List<InterfaceType> getInterfaceTypes()
      (experimental) The Interface Types this Object Type implements.

      Default: - no interface types

      Specified by:
      getInterfaceTypes in interface IIntermediateType
    • getResolvers

      @Stability(Experimental) @Nullable public List<Resolver> getResolvers()
      (experimental) The resolvers linked to this data source.
      Specified by:
      getResolvers in interface IIntermediateType
    • setResolvers

      @Stability(Experimental) public void setResolvers(@Nullable List<Resolver> value)
      (experimental) The resolvers linked to this data source.
      Specified by:
      setResolvers in interface IIntermediateType