AWS CloudFormation
User Guide (API Version 2010-05-15)


The AWS::AppSync::GraphQLSchema resource is used for your AWS AppSync GraphQL schema which controls the data model for your API. Schema files are text written in Schema Definition Language (SDL) format. You can find information on schema authoring at Designing a GraphQL API.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::AppSync::GraphQLSchema", "Properties" : { "Definition" : String, "DefinitionS3Location" : String, "ApiId" : String } }


Type: "AWS::AppSync::GraphQLSchema" Properties: Definition: String DefinitionS3Location: String ApiId: String



The text representation of a GraphQL schema in SDL format.

Required: No

Type: String

Update requires: No interruption


A location of a GraphQL schema file on an S3 bucket if you wish to provision with the schema living in S3 rather than embedded in your CloudFormation template.

Required: No

Type: String

Update requires: No interruption


The AWS AppSync GraphQL API identifier to which you will apply this schema.

Required: Yes

Type: String

Update requires: Replacement

Return Values


When you pass the logical ID of an AWS::AppSync::GraphQLSchema resource to the intrinsic Ref function, the function returns the GraphQL API id with the literal String GraphQLSchema attached to it.

For more information about using the Ref function, see Ref.


GraphQL Schema creation example

The following example creates a GraphQL Schema and associates it with an existing GraphQL API by passing the GraphQL API Id as a paramater.


{ "Parameters": { "graphQlApiId": { "Type": "String" }, "graphQlSchemaS3DescriptionLocation": { "Type": "String" } }, "Resources": { "Schema": { "Type": "AWS::AppSync::GraphQLSchema", "Properties": { "ApiId": { "Ref": "graphQlApiId" }, "DefinitionS3Location": { "Ref": "graphQlSchemaS3DescriptionLocation" } } } } }


Parameters: graphQlApiId: Type: String graphQlSchemaS3DescriptionLocation: Type: String Resources: Schema: Type: AWS::AppSync::GraphQLSchema Properties: ApiId: Ref: graphQlApiId DefinitionS3Location: Ref: graphQlSchemaS3DescriptionLocation

See Also