class InputType
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppSync.InputType |
Java | software.amazon.awscdk.services.appsync.InputType |
Python | aws_cdk.aws_appsync.InputType |
TypeScript (source) | @aws-cdk/aws-appsync » InputType |
Implements
IIntermediate
Input Types are abstract types that define complex objects.
They are used in arguments to represent
Example
declare const api: appsync.GraphqlApi;
const review = new appsync.InputType('Review', {
definition: {
stars: appsync.GraphqlType.int({ isRequired: true }),
commentary: appsync.GraphqlType.string(),
},
});
api.addType(review);
Initializer
new InputType(name: string, props: IntermediateTypeOptions)
Parameters
- name
string - props
IntermediateType Options
Properties
| Name | Type | Description |
|---|---|---|
| definition | { [string]: IField } | the attributes of this type. |
| name | string | the name of this type. |
| modes? | Authorization[] | the authorization modes for this intermediate type. |
definition
Type:
{ [string]: IField }
the attributes of this type.
name
Type:
string
the name of this type.
modes?
Type:
Authorization[]
(optional)
the authorization modes for this intermediate type.
Methods
| Name | Description |
|---|---|
| add | Add a field to this Input Type. |
| attribute(options?) | Create a GraphQL Type representing this Input Type. |
| to | Generate the string of this input type. |
addField(options)
public addField(options: AddFieldOptions): void
Parameters
- options
Add— the options to add a field.Field Options
Add a field to this Input Type.
Input Types must have both fieldName and field options.
attribute(options?)
public attribute(options?: BaseTypeOptions): GraphqlType
Parameters
- options
Base— the options to configure this attribute.Type Options
Returns
Create a GraphQL Type representing this Input Type.
toString()
public toString(): string
Returns
string
Generate the string of this input type.

.NET
Java
Python
TypeScript (