Skip to content

Instantly share code, notes, and snippets.

View duwerq's full-sized avatar

Matthew duwerq

View GitHub Profile
type Query {
findEstablishments(
input: FindEstablishmentsInput!
): SearchableEstablishmentConnection @aws_iam @aws_cognito_user_pools
}
type GPS {
lon: Float
lat: Float
"ConfigureESCustom": {
"Type": "Custom::ConfigureES",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": ["ConfigureES", "Arn"]
}
}
},
"ConfigureES": {
"Type": "AWS::Lambda::Function",
type GPS {
lon: Float
lat: Float
}
type Establishment
@model
@auth(rules: [{ allow: public, provider: iam }])
@key(fields: ["ownerId", "id"]) {
id: ID!
@duwerq
duwerq / html.js
Last active July 10, 2020 15:52
Gatsby html.js example
import React from "react"
import PropTypes from "prop-types"
export default function HTML(props) {
return (
<html {...props.htmlAttributes}>
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
<meta
import React, { Component } from 'react';
import { withApollo } from 'react-apollo';
export default options => (WrappedComponent) => {
class QueryEnhancer extends Component {
constructor(props) {
super(props);
this.state = {
[`${this.props.options.dataKey}`]: {},
[`${this.props.options.dataKey}Loading`]: false,
@duwerq
duwerq / App.js
Last active March 3, 2020 01:50
AmplifySignUpForm.js
import React, { useState } from "react";
import Auth from "@aws-amplify/auth";
import config from "./aws-exports";
Auth.configure(config);
const signUpUser = async ({
password,
setSuccessOrErrorMessage,
arbitrary: {'Arbitrary non-empty content'}