Skip to main content

graphql_apis

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

Overview

Namegraphql_apis
TypeResource
Idaws.appsync.graphql_apis

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe API name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>)
additional_authentication_providersarrayA list of additional authentication providers for the GraphqlApi API.
api_idstringThe API ID.
api_typestringThe value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED). (GRAPHQL, MERGED)
arnstringThe Amazon Resource Name (ARN).
authentication_typestringThe authentication type. (API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT, AWS_LAMBDA)
dnsobjectThe DNS records for the API.
enhanced_metrics_configobjectEnables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent. Enhanced metrics can be configured at the resolver, data source, and operation levels. EnhancedMetricsConfig contains three required parameters, each controlling one of these categories: resolverLevelMetricsBehavior: Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include: GraphQL errors: The number of GraphQL errors that occurred. Requests: The number of invocations that occurred during a request. Latency: The time to complete a resolver invocation. Cache hits: The number of cache hits during a request. Cache misses: The number of cache misses during a request. These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time: FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request. PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the metricsConfig value set to ENABLED. dataSourceLevelMetricsBehavior: Controls how data source metrics will be emitted to CloudWatch. Data source metrics include: Requests: The number of invocations that occured during a request. Latency: The time to complete a data source invocation. Errors: The number of errors that occurred during a data source invocation. These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time: FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the request. PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources that have the metricsConfig value set to ENABLED. operationLevelMetricsConfig: Controls how operation metrics will be emitted to CloudWatch. Operation metrics include: Requests: The number of times a specified GraphQL operation was called. GraphQL errors: The number of GraphQL errors that occurred during a specified GraphQL operation. Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED.
introspection_configstringSets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled. For more information about introspection, see GraphQL introspection. (ENABLED, DISABLED)
lambda_authorizer_configobjectA LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
log_configobjectThe Amazon CloudWatch Logs configuration.
merged_api_execution_role_arnstringThe Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.
open_id_connect_configobjectDescribes an OpenID Connect (OIDC) configuration.
ownerstringThe account owner of the GraphQL API.
owner_contactstringThe owner contact information for an API resource. This field accepts any string input with a length of 0 - 256 characters.
query_depth_limitintegerThe maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds. Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.
resolver_count_limitintegerThe maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000. When specified, the limit value can be between 1 and 10000. This field will produce a limit error if the operation falls out of bounds.
tagsobjectThe tags.
urisobjectThe URIs.
user_pool_configobjectDescribes an Amazon Cognito user pool configuration.
visibilitystringSets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed once the API has been created. (GLOBAL, PRIVATE)
waf_web_acl_arnstringThe ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.
xray_enabledbooleanA flag indicating whether to use X-Ray tracing for this GraphqlApi.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_graphql_apiselectapi_id, regionRetrieves a GraphqlApi object.
list_graphql_apisselectregionnextToken, maxResults, apiType, ownerLists your GraphQL APIs.
create_graphql_apiinsertregion, name, authenticationTypeCreates a GraphqlApi object.
update_graphql_apiupdateapi_id, region, name, authenticationTypeUpdates a GraphqlApi object.
associate_merged_graphql_apiupdatesource_api_identifier, region, mergedApiIdentifierCreates an association between a Merged API and source API using the source API's identifier.
associate_source_graphql_apiupdatemerged_api_identifier, region, sourceApiIdentifierCreates an association between a Merged API and source API using the Merged API's identifier.
disassociate_merged_graphql_apiupdatesource_api_identifier, association_id, regionDeletes an association between a Merged API and source API using the source API's identifier and the association ID.
disassociate_source_graphql_apiupdatemerged_api_identifier, association_id, regionDeletes an association between a Merged API and source API using the Merged API's identifier and the association ID.
delete_graphql_apideleteapi_id, regionDeletes a GraphqlApi 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.
association_idstringThe ID generated by the AppSync service for the source API association.
merged_api_identifierstringThe identifier of the AppSync Merged API. This is generated by the AppSync service. In most cases, Merged APIs (especially in your account) only require the API ID value or ARN of the merged API. However, Merged APIs in other accounts (cross-account use cases) strictly require the full resource ARN of the merged API.
regionstringAWS region (default: us-east-1)
source_api_identifierstringThe identifier of the AppSync Source API. This is generated by the AppSync service. In most cases, source APIs (especially in your account) only require the API ID value or ARN of the source API. However, source APIs from other accounts (cross-account use cases) strictly require the full resource ARN of the source API.
apiTypestringThe value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API (MERGED).
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.
ownerstringThe account owner of the GraphQL API.

SELECT examples

Retrieves a GraphqlApi object.

SELECT
name,
additional_authentication_providers,
api_id,
api_type,
arn,
authentication_type,
dns,
enhanced_metrics_config,
introspection_config,
lambda_authorizer_config,
log_config,
merged_api_execution_role_arn,
open_id_connect_config,
owner,
owner_contact,
query_depth_limit,
resolver_count_limit,
tags,
uris,
user_pool_config,
visibility,
waf_web_acl_arn,
xray_enabled
FROM aws.appsync.graphql_apis
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a GraphqlApi object.

INSERT INTO aws.appsync.graphql_apis (
name,
logConfig,
authenticationType,
userPoolConfig,
openIDConnectConfig,
tags,
additionalAuthenticationProviders,
xrayEnabled,
lambdaAuthorizerConfig,
apiType,
mergedApiExecutionRoleArn,
visibility,
ownerContact,
introspectionConfig,
queryDepthLimit,
resolverCountLimit,
enhancedMetricsConfig,
region
)
SELECT
'{{ name }}' /* required */,
'{{ logConfig }}',
'{{ authenticationType }}' /* required */,
'{{ userPoolConfig }}',
'{{ openIDConnectConfig }}',
'{{ tags }}',
'{{ additionalAuthenticationProviders }}',
{{ xrayEnabled }},
'{{ lambdaAuthorizerConfig }}',
'{{ apiType }}',
'{{ mergedApiExecutionRoleArn }}',
'{{ visibility }}',
'{{ ownerContact }}',
'{{ introspectionConfig }}',
{{ queryDepthLimit }},
{{ resolverCountLimit }},
'{{ enhancedMetricsConfig }}',
'{{ region }}'
RETURNING
graphql_api
;

UPDATE examples

Updates a GraphqlApi object.

UPDATE aws.appsync.graphql_apis
SET
name = '{{ name }}',
logConfig = '{{ logConfig }}',
authenticationType = '{{ authenticationType }}',
userPoolConfig = '{{ userPoolConfig }}',
openIDConnectConfig = '{{ openIDConnectConfig }}',
additionalAuthenticationProviders = '{{ additionalAuthenticationProviders }}',
xrayEnabled = {{ xrayEnabled }},
lambdaAuthorizerConfig = '{{ lambdaAuthorizerConfig }}',
mergedApiExecutionRoleArn = '{{ mergedApiExecutionRoleArn }}',
ownerContact = '{{ ownerContact }}',
introspectionConfig = '{{ introspectionConfig }}',
queryDepthLimit = {{ queryDepthLimit }},
resolverCountLimit = {{ resolverCountLimit }},
enhancedMetricsConfig = '{{ enhancedMetricsConfig }}'
WHERE
api_id = '{{ api_id }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND authenticationType = '{{ authenticationType }}' --required
RETURNING
graphql_api;

DELETE examples

Deletes a GraphqlApi object.

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