Skip to content

Instantly share code, notes, and snippets.

View omkar-joshi's full-sized avatar
💭
Done is the engine of more!

Omkar Joshi omkar-joshi

💭
Done is the engine of more!
View GitHub Profile
@omkar-joshi
omkar-joshi / schema.graphql
Created January 9, 2020 12:31
Snippet #8
type Restaurant @model {
...
owner: String
}
@omkar-joshi
omkar-joshi / App.tsx
Last active January 9, 2020 12:30
Snippet #7
import Amplify, { API, graphqlOperation } from 'aws-amplify';
import { withAuthenticator } from 'aws-amplify-react';
import React, { useEffect, useReducer } from 'react';
import { Button, Col, Container, Form, Row, Table } from 'react-bootstrap';
import './App.css';
import awsConfig from './aws-exports';
import { createRestaurant } from './graphql/mutations';
import { listRestaurants } from './graphql/queries';
import { onCreateRestaurant } from './graphql/subscriptions';
query searchRestaurants {
listRestaurants(filter: {
city: {
contains: "New York"
}
}) {
items {
id
name
description
query listRestaurants {
listRestaurants {
items {
id
name
description
city
}
}
}
mutation createRestaurant {
createRestaurant(input: {
name: "Nobu"
description: "Great Sushi"
city: "New York"
}) {
id name description city
}
}
@omkar-joshi
omkar-joshi / schema.graphql
Created January 9, 2020 12:23
Snippet #3
type Restaurant @model {
id: ID!
name: String!
description: String!
city: String!
}
@omkar-joshi
omkar-joshi / App.tsx
Created January 9, 2020 12:18
Snippet #2
import { withAuthenticator } from 'aws-amplify-react';
...
// app component
...
export default withAuthenticator(App);
@omkar-joshi
omkar-joshi / App.tsx
Last active January 21, 2020 11:13
Snippet #1
import Amplify from 'aws-amplify';
import awsConfig from './aws-exports';
Amplify.configure(awsConfig);