Skip to main content

types

Creates, updates, deletes, gets or lists a types resource.

Overview​

Nametypes
TypeResource
Idaws.appsync.types

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe type name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>)
arnstringThe type Amazon Resource Name (ARN).
definitionstringThe type definition.
descriptionstringThe type description.
format_stringThe type format: SDL or JSON. (SDL, JSON)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_typesselectapi_id, format, regionnextToken, maxResultsLists the types for a given API.
create_typeinsertapi_id, region, definition, formatCreates a Type object.
update_typeupdateapi_id, type_name, region, formatUpdates a Type object.
delete_typedeleteapi_id, type_name, regionDeletes a Type object.
get_typeexecapi_id, type_name, format, regionRetrieves a Type object.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_idstringThe API ID.
formatstringThe type format: SDL or JSON.
regionstringAWS region (default: us-east-1)
type_namestringThe type name.
maxResultsintegerThe maximum number of results that you want the request to return.
nextTokenstringAn identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.

SELECT examples​

Lists the types for a given API.

SELECT
name,
arn,
definition,
description,
format_
FROM aws.appsync.types
WHERE api_id = '{{ api_id }}' -- required
AND format = '{{ format }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;

INSERT examples​

Creates a Type object.

INSERT INTO aws.appsync.types (
definition,
format,
api_id,
region
)
SELECT
'{{ definition }}' /* required */,
'{{ format }}' /* required */,
'{{ api_id }}',
'{{ region }}'
RETURNING
type_
;

UPDATE examples​

Updates a Type object.

UPDATE aws.appsync.types
SET
definition = '{{ definition }}',
format = '{{ format }}'
WHERE
api_id = '{{ api_id }}' --required
AND type_name = '{{ type_name }}' --required
AND region = '{{ region }}' --required
AND format = '{{ format }}' --required
RETURNING
type_;

DELETE examples​

Deletes a Type object.

DELETE FROM aws.appsync.types
WHERE api_id = '{{ api_id }}' --required
AND type_name = '{{ type_name }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods​

Retrieves a Type object.

EXEC aws.appsync.types.get_type
@api_id='{{ api_id }}' --required,
@type_name='{{ type_name }}' --required,
@format='{{ format }}' --required,
@region='{{ region }}' --required
;