Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import NewDestinationsSubscription from './Queries/NewDestinationsSubscription';
import AWSAppSyncClient from "aws-appsync";
import { Rehydrated } from 'aws-appsync-react';
import { AUTH_TYPE } from "aws-appsync/lib/link/auth-link";
import { graphql, ApolloProvider, compose } from 'react-apollo';
import * as AWS from 'aws-sdk';
import AppSync from './aws-exports.js';
import AllDestinationsQuery from './Queries/AllDestinationsQuery';
import NewDestinationMutation from './Queries/NewDestinationMutation';
const client = new AWSAppSyncClient({
url: AppSync.aws_appsync_graphqlEndpoint,
region: AppSync.aws_appsync_region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: AppSync.aws_appsync_apiKey,
// type: AUTH_TYPE.AWS_IAM,
// Note - Testing purposes only
/*credentials: new AWS.Credentials({
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_ACCESS_KEY
})*/
// Amazon Cognito Federated Identities using AWS Amplify
//credentials: () => Auth.currentCredentials(),
// Amazon Cognito user pools using AWS Amplify
// type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
// jwtToken: async () => (await Auth.currentSession()).getIdToken().getJwtToken(),
},
ScrollView
} from 'react-native'
import ListItems from './Components/listItems'
import AddItems from './Components/addItems'
// The AppSync Import Bus
import AWSAppSyncClient from 'aws-appsync'
import { Rehydrated } from 'aws-appsync-react'
import { AUTH_TYPE } from 'aws-appsync/lib/link/auth-link'
import { ApolloProvider } from 'react-apollo'
import AppSync from './AppSync.js'
const client = new AWSAppSyncClient({
url: AppSync.graphqlEndpoint,
region: AppSync.region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: AppSync.apiKey
}
})
class App extends Component {
state = { allItems: [] }
render () {
return (
import AWSAppSyncClient from "aws-appsync";
import { Rehydrated } from "aws-appsync-react";
import { AUTH_TYPE } from "aws-appsync/lib/link/auth-link";
import { ApolloProvider } from "react-apollo";
import AppSync from "./AppSync.js";
const styles = {
fontFamily: "sans-serif",
textAlign: "center"
};
const client = new AWSAppSyncClient({
url: AppSync.graphqlEndpoint,
region: AppSync.region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: AppSync.apiKey
}
});
export default class App extends Component {
state = { allItems: [] };
render() {
return (
<div style="{styles}">
<h2>Welcome to GraphQL + Amazon AppSync</h2>
<em>
Please be clean in your list, as this is shared across all examples
</em>
</div>
import AWSAppSyncClient from "aws-appsync";
import { Rehydrated } from "aws-appsync-react";
import { AUTH_TYPE } from "aws-appsync/lib/link/auth-link";
import { ApolloProvider } from "react-apollo";
import AppSync from "./AppSync.js";
const styles = {
fontFamily: "sans-serif",
textAlign: "center"
};
const client = new AWSAppSyncClient({
url: AppSync.graphqlEndpoint,
region: AppSync.region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: AppSync.apiKey
}
});
export default class App extends Component {
state = { allItems: [] };
render() {
return (
<div style="{styles}">
<h2>Welcome to GraphQL + Amazon AppSync</h2>
<em>
Please be clean in your list, as this is shared across all examples
</em>
</div>