This file contains 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
type Restaurant @model { | |
... | |
owner: String | |
} |
This file contains 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
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'; |
This file contains 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 searchRestaurants { | |
listRestaurants(filter: { | |
city: { | |
contains: "New York" | |
} | |
}) { | |
items { | |
id | |
name | |
description |
This file contains 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 listRestaurants { | |
listRestaurants { | |
items { | |
id | |
name | |
description | |
city | |
} | |
} | |
} |
This file contains 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 createRestaurant { | |
createRestaurant(input: { | |
name: "Nobu" | |
description: "Great Sushi" | |
city: "New York" | |
}) { | |
id name description city | |
} | |
} |
This file contains 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
type Restaurant @model { | |
id: ID! | |
name: String! | |
description: String! | |
city: String! | |
} |
This file contains 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
import { withAuthenticator } from 'aws-amplify-react'; | |
... | |
// app component | |
... | |
export default withAuthenticator(App); |
This file contains 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
import Amplify from 'aws-amplify'; | |
import awsConfig from './aws-exports'; | |
Amplify.configure(awsConfig); |