class Field
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppSync.Field |
Java | software.amazon.awscdk.services.appsync.Field |
Python | aws_cdk.aws_appsync.Field |
TypeScript (source) | @aws-cdk/aws-appsync » Field |
Implements
IField
Extends
Graphql
Fields build upon Graphql Types and provide typing and arguments.
Example
const field = new appsync.Field({
returnType: appsync.GraphqlType.string(),
args: {
argument: appsync.GraphqlType.string(),
},
});
const type = new appsync.InterfaceType('Node', {
definition: { test: field },
});
Initializer
new Field(options: FieldOptions)
Parameters
- options
FieldOptions
Properties
| Name | Type | Description |
|---|---|---|
| is | boolean | property determining if this attribute is a list i.e. if true, attribute would be [Type]. |
| is | boolean | property determining if this attribute is non-nullable i.e. if true, attribute would be Type! and this attribute must always have a value. |
| is | boolean | 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. |
| type | Type | the type of attribute. |
| field | Resolvable | The options for this field. |
| intermediate | IIntermediate | the intermediate type linked to this attribute (i.e. an interface or an object). |
isList
Type:
boolean
property determining if this attribute is a list i.e. if true, attribute would be [Type].
isRequired
Type:
boolean
property determining if this attribute is non-nullable i.e. if true, attribute would be Type! and this attribute must always have a value.
isRequiredList
Type:
boolean
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.
type
Type:
Type
the type of attribute.
fieldOptions?
Type:
Resolvable
(optional, default: no arguments)
The options for this field.
intermediateType?
Type:
IIntermediate
(optional, default: no intermediate type)
the intermediate type linked to this attribute (i.e. an interface or an object).
Methods
| Name | Description |
|---|---|
| args | Generate the args string of this resolvable field. |
| directives | Generate the directives for this field. |
| to | Generate the string for this attribute. |
argsToString()
public argsToString(): string
Returns
string
Generate the args string of this resolvable field.
directivesToString(modes?)
public directivesToString(modes?: AuthorizationType[]): string
Parameters
- modes
AuthorizationType []
Returns
string
Generate the directives for this field.
toString()
public toString(): string
Returns
string
Generate the string for this attribute.

.NET
Java
Python
TypeScript (