Created
April 13, 2018 22:23
-
-
Save adrianhall/293d2ad4dc5e9e8588b651c1fa1e946e to your computer and use it in GitHub Desktop.
CloudFormation template for AWS AppSync (partial)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppSyncApi: | |
Type: "AWS::AppSync::GraphQLApi" | |
Description: "The GraphQL API for the Notes App" | |
Properties: | |
AuthenticationType: "AMAZON_COGNITO_USER_POOLS" | |
Name: !Sub ${APIName} | |
UserPoolConfig: | |
UserPoolId: !Ref UserPoolClient | |
AwsRegion: !Sub ${AWS::Region} | |
DefaultAction: "ALLOW" | |
AppSyncSchema: | |
Type: "AWS::AppSync::GraphQLSchema" | |
Properties: | |
ApiId: !GetAtt AppSyncApi.ApiId | |
Definition: | | |
type Note { | |
NoteId: ID! | |
title: String | |
content: String | |
} | |
type PaginatedNotes { | |
notes: [Note!]! | |
nextToken: String | |
} | |
type Query { | |
allNotes(limit: Int, nextToken: String): PaginatedNotes! | |
getNote(NoteId: ID!): Note | |
} | |
type Mutation { | |
saveNote(NoteId: ID!, title: String!, content: String!): Note | |
deleteNote(NoteId: ID!): Note | |
} | |
type Schema { | |
query: Query | |
mutation: Mutation | |
} | |
AppSyncNotesTableDataSource: | |
Type: "AWS::AppSync::DataSource" | |
Properties: | |
ApiId: !GetAtt AppSyncApi.ApiId | |
Name: !Sub ${APIName}_notes_table | |
Description: "The Notes Table AppSync Data Source" | |
Type: AMAZON_DYNAMODB | |
ServiceRoleArn: !GetAtt DynamoDBRole.Arn | |
DynamoDBConfig: | |
TableName: !Ref DynamoDBNotesTable | |
AwsRegion: !Sub ${AWS::Region} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you tried to use extend keyword for schema so that the schema can be modularized and distributed to different yml files?