This file contains hidden or 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
| Conditions: | |
| IsProduction: !Equals [!Ref 'ENV', 'PROD'] |
This file contains hidden or 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
| Parameters: | |
| ENV: | |
| Description: 'The environment that this stack represents' | |
| Type: String | |
| Default: 'DEV' | |
| ConstraintDescription: "Must be either 'DEV', 'STAG', or 'PROD'" | |
| AllowedValues: | |
| - 'DEV' | |
| - 'STAG' | |
| - 'PROD' |
This file contains hidden or 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
| [ | |
| { | |
| "ParameterKey": "ENV", | |
| "ParameterValue": "DEV" | |
| } | |
| ] |
This file contains hidden or 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
| aws cloudformation create-stack --stack-name HasuraContainer --template-body file://./ECR.yaml | |
| #Or, if you don't want the default name of `demo/hasura` for your registry. Fill in the parameters in the ecr_parameters.json file and create the stack like this. | |
| aws cloudformation create-stack --stack-name HasuraContainer --template-body file://./ECR.yaml --parameters file://./ecr_parameters.json |
This file contains hidden or 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
| { | |
| "data": { | |
| "insert_user": { | |
| "returning": [ | |
| { | |
| "id": "05d21ca2-931c-4ed4-baf6-581769003905" | |
| } | |
| ], | |
| "affected_rows": 1 | |
| } |
This file contains hidden or 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
| mutation NewUser($email: String!) { | |
| insert_user(objects: [{email: $email}]) { | |
| returning{ | |
| id | |
| } | |
| affected_rows | |
| } | |
| } |
This file contains hidden or 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
| { | |
| "data": { | |
| "user": [ | |
| { | |
| "id": "b2c7a193-6500-4144-9079-cfc336995538", | |
| "email": "[email protected]" | |
| } | |
| ], | |
| "user_by_pk": { | |
| "id": "b2c7a193-6500-4144-9079-cfc336995538", |
This file contains hidden or 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
| query User($byID: uuid!) { | |
| user(where: {id: {_eq: $byID}}) { | |
| id | |
| } | |
| user_by_pk(id: $byID) { | |
| id | |
| } | |
| } |
This file contains hidden or 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
| { | |
| "data": { | |
| } | |
| } |
This file contains hidden or 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
| func euclideanDistance(first: [Double], second: [Double]) -> Double { | |
| guard first.count == second.count else { | |
| fatalError("Vector space is not the same") | |
| } | |
| var result: Double = 0 | |
| for i in 0..<first.count { | |
| result += pow(first[i] - second[i], 2.0) | |
| } | |
| return sqrt(result) | |
| } |