Skip to content

Instantly share code, notes, and snippets.

@joninsky
joninsky / exampleGraphQLResponse.json
Last active May 16, 2019 21:31
Basic returned example from GraphQL Request.
{
"data": {
}
}
query User($byID: uuid!) {
user(where: {id: {_eq: $byID}}) {
id
email
}
user_by_pk(id: $byID) {
id
email
}
}
@joninsky
joninsky / MixedQueryResults.json
Created May 16, 2019 21:44
MixedQueryResults
{
"data": {
"user": [
{
"id": "b2c7a193-6500-4144-9079-cfc336995538",
"email": "[email protected]"
}
],
"user_by_pk": {
"id": "b2c7a193-6500-4144-9079-cfc336995538",
mutation NewUser($email: String!) {
insert_user(objects: [{email: $email}]) {
returning{
id
}
affected_rows
}
}
@joninsky
joninsky / MutationResponseExample.json
Created May 16, 2019 21:59
MutationResponseExample
{
"data": {
"insert_user": {
"returning": [
{
"id": "05d21ca2-931c-4ed4-baf6-581769003905"
}
],
"affected_rows": 1
}
@joninsky
joninsky / commands.sh
Created July 19, 2019 17:39
ECR cloudformation creation
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
@joninsky
joninsky / parameters.json
Created August 25, 2019 22:46
Cloudformation ENV parameter example
[
{
"ParameterKey": "ENV",
"ParameterValue": "DEV"
}
]
@joninsky
joninsky / stack.yaml
Last active August 25, 2019 22:59
ENV parameter declaration in Cloudformation
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'
@joninsky
joninsky / stack.yaml
Created August 25, 2019 22:50
ENV Condition example Cloudformation
Conditions:
IsProduction: !Equals [!Ref 'ENV', 'PROD']
@joninsky
joninsky / stack.yaml
Created August 25, 2019 22:52
ENV tag example Cloudformation
RouteTableAPublic:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref VPC
Tags:
- Key: Name
Value: !Sub 'Route Table public A - ${ENV}'