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
function visitAndExpression(exprNode: any): any { | |
const conditions = exprNode.expressions.map(function (expr: any) { return visitExpression(expr) }) | |
return function (it: any) { return conditions.every(function (c: any) { return c(it) }) } | |
} | |
function visitOrExpression(exprNode: any): any { | |
const conditions = exprNode.expressions.map(function (expr: any) { return visitExpression(expr) }) |
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
/** | |
* Example script to change amplify cli-generated cloudformation stack to support a graphql interface. See https://github.com/aws-amplify/amplify-cli/issues/202. | |
* Run this before every amplify push command (e.g. create your own bash script that does something like: amplify api gql-compile && node ./scripts/modifyAmplifyCF.js && ./amplify/backend/api/<your_app_name>/build/cloudformtion-template.json && amplify push --no-gql-override) | |
* Everytime you run amplify api gql-compile, the cloudformation files will be overwritten and this script would need to be run again. | |
* | |
* As an example for this script, it assumes you have a custom User table built (through custom stacks - User.json for the AppSync resolvers and UserTable.json for the dynamodb table) and a Doctor and Patient model that implement this interface, e.g. | |
* | |
* interface User { | |
* id: ID! | |
*. email: AWSEmail! |