Skip to content

Instantly share code, notes, and snippets.

View kkemple's full-sized avatar

Kurt Kemple kkemple

View GitHub Profile
version: 0.1
backend:
phases:
build:
commands:
- '# Get Amplify CLI Cloud-Formation stack info from environment cache'
- export STACKINFO="$(envCache --get stackInfo)"
- '# Execute Amplify CLI with the helper script'
- amplifyPush --environment $BUILD_ENV
- '# Store Amplify CLI Cloud-Formation stack info in environment cache'
import React, { Component } from "react";
import Amplify, { graphqlOperation } from "aws-amplify";
import { withAuthenticator, Connect } from "aws-amplify-react";
import "./App.css";
import awsConfig from "./aws-exports";
import * as mutations from "./graphql/mutations";
import * as queries from "./graphql/queries";
import * as subscriptions from "./graphql/subscriptions";
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Amplify from 'aws-amplify';
import awsConfig from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react';
Amplify.configure(awsConfig);
exports.onCreatePage = async ({ page, actions }) => {
const { createPage } = actions
if (page.path.match(/^\/dashboard/)) {
page.matchPath = "/dashboard/*"
createPage(page)
}
}
import React from 'react'
import Layout from '../components/Layout'
const Dashboard = props => (
<Layout {...props} title="Gatsby Starter Blog">
<h1>Liked Posts</h1>
</Layout>
)
import Amplify, { Auth } from 'aws-amplify'
import awsConfig from './src/aws-exports'
Amplify.configure(awsConfig)
import React from 'react'
import { withAuthenticator } from 'aws-amplify-react'
import Layout from '../components/Layout'
const Dashboard = props => (
<Layout {...props} title="Gatsby Starter Blog" isDashboard>
<h1>Liked Posts</h1>
</Layout>
)
...
return (
<div
style={{
marginLeft: `auto`,
marginRight: `auto`,
maxWidth: rhythm(24),
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
}}
>
type PostLike @model @auth(rules: [{ allow: owner, ownerField: "userId" }]) {
id: ID!
userId: String!
postId: String!
}
import React from 'react'
import { graphql, Link } from 'gatsby'
import { withAuthenticator, Connect } from 'aws-amplify-react'
import { graphqlOperation } from 'aws-amplify'
import Layout from '../components/Layout'
import { listPostLikes } from '../graphql/queries'
const Dashboard = props => (
<Layout {...props} title="Gatsby Starter Blog" isDashboard>