Code Monkey home page Code Monkey logo

aws-mobile-appsync-events-starter-react-native's Introduction

Introduction

This is a Starter React Native application for using the Sample app in the AWS AppSync console when building your GraphQL API. The Sample app creates a GraphQL schema and provisions Amazon DynamoDB resources, then connects them appropriately with Resolvers. The application demonstrates GraphQL Mutations, Queries and Subscriptions using AWS AppSync. You can use this for learning purposes or adapt either the application or the GraphQL Schema to meet your needs.

EventDetails

Features

  • GraphQL Mutations

    • Create new events
    • Create comments on existing events
  • GraphQL Queries

    • Get all events (w/ pagination support)
    • Get an event by Id
  • GraphQL Subscriptions

    • Real time updates for comments on an event
  • Authorization

    • The app uses API Key as the authoriation mechanism

AWS Setup

  1. Navigate to the AWS AppSync console using the URL: http://console.aws.amazon.com/appsync/home

  2. Click on Create API and select the Sample Schema option. Enter a API name of your choice. Click Create.

React Native Setup

First, clone this repo:

git clone https://github.com/aws-samples/aws-mobile-appsync-events-starter-react-native.git
cd ./aws-mobile-appsync-events-starter-react-native

Wait until the progress bar at the top has completed deploying your resources. Then from the integration page of your GraphQL API (you can click the name you entered in the left hand navigation).

On this same page, select JavaScript at the bottom to download your aws-exports.js configuration file by clicking the Download Config button. Replace the aws-exports.js file in the root of your app with the file you just downloaded.

Start the application:

npm install 
npm run ios   #run-android

Application Walkthrough

App.js

  • Sets up the application navigation between screens using StackNavigator.
  • Configures the AWSAppSyncClient using an API Key. This can be configured to use Amazon Cognito Identity or Amazon Cognito User Pools as well.
  • Uses Higher Order Components for making GraphQL calls to AWS AppSync.

./Components/AllEvents.js

  • View to display all the events from ./queries/ListEvents.js with a ScrollView
  • Allows you to delete individual events with a swipe. This will use ./queries/DeleteEvent.js

./Components/AddEvent.js

  • View to create a new event using ./queries/CreateEvent.js

./queries Directory

  • Contains GraphQL queries and mutations for interacting with AWS AppSync.
  • Contains two optional queries (CommentOnEvent.js and GetEvent.js) for you to enhance the sample.

aws-mobile-appsync-events-starter-react-native's People

Contributors

appwiz avatar ashika01 avatar dependabot[bot] avatar domino987 avatar elorzafe avatar hyandell avatar iartemiev avatar manueliglesias avatar undefobj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-mobile-appsync-events-starter-react-native's Issues

Example on snack.expo.io

Thank you for this example. As I don't have the android studio (too heavy for my convertible) I can't test the code. Could you make a snack on snack.expo.io? Thanks for any help.

Change the verification email as well as the message

Right now the confirmation email comes as a "no-reply" and the only message is "This is yor verification code"

Need to update and customize that a little bit so that users get a welcome message and some Terms and Conditions.

Can't find field listAnotherEvent on object

Hi all, while playing with the starter pack following the Events app from the quickstart I decided to simply change all the schemas from the given code.
I changed Events for example to AnotherEvents, or listEvents to listAnotherEvents and all of the schemas to attend this new parameter.
I also changed the schemas from within the console. But I haven't change or attached any new resolvers to it)
where the problem can be? thanks

Can't find field listAnotherEvents on object (ROOT_QUERY) {
  "listEvents": {
    "type": "id",
    "id": "$ROOT_QUERY.listEvents",
    "generated": true
  }
}.

Unhandled (in react-apollo:Apollo(Apollo(AllAnotherEvents))), ApolloError@http:// [...]

Failed to load code for plug-in com.apple.xray.discovery.mobiledevice

After following the instructions on AWS and the readme, and executing npm run ios, I get the following stack trace:

npm run ios

> [email protected] ios /Users/username/aws-mobile-appsync-events-starter-react-native
> react-native run-ios

Scanning folders for symlinks in /Users/username/aws-mobile-appsync-events-starter-react-native/node_modules (23ms)
Found Xcode project awsappsyncevents.xcodeproj
2018-03-14 12:03:01.627 instruments[9356:1548471] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.xray.discovery.mobiledevice (/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin), error = Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin/Contents/MacOS/XRMobileDeviceDiscoveryPlugIn): Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
  Referenced from: /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin/Contents/MacOS/XRMobileDeviceDiscoveryPlugIn
  Reason: image not found" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin/Contents/MacOS/XRMobileDeviceDiscoveryPlugIn, NSDebugDescription=dlopen_preflight(/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin/Contents/MacOS/XRMobileDeviceDiscoveryPlugIn): Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
  Referenced from: /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/XRMobileDeviceDiscoveryPlugIn.xrplugin/Contents/MacOS/XRMobileDeviceDiscoveryPlugIn

Guest isn't online after 7 s

Is what I get when I run the Android Studio emulator (Nexus 5X with API 28). Below in the console I have Waiting for target device to come online.

Other than that I have build completed successfully with one warning, which I think is: 12:23 Emulator: qemu-system-x86_64: warning: TSC frequency mismatch between VM (2195012 kHz) and host (2195013 kHz), and TSC scaling unavailable.

If I try with NEXUS S API 24 I get Emulator: libpng warning: iCCP: known incorrect sRGB profile
and just a black screen.

Hm got a physical device working Xperia LT25i - 4.3. Put it in dev mode. Build successful. Error: error: device unauthorized. Please check the confirmation dialog on your device.

Don't know what that means, could it be that it's not authorized somewhere on AWS?

how to identify number of active subscribers by subscription in AppSync

Need to keep count of how many subscribers are connected with each subscription.

For UserA, UserB are connected with SubscriptionA : then 2 is the total subscribers
For UserA are connected with SubscriptionB : then 1 is the total subscribers

Can i know when UserA unsubscribes , subscribes, disconnects, reconnects from AppSync ?

Subscriptions example

The README states that this example shows: "GraphQL Subscriptions - Real time updates for comments on an event". That doesn't seem to be the case yet, which is understandable as this is in preview! Just adding an issue here to track progress so we can be notified when it is available.

can't find listEvents on object (ROOT_QUERY)

I have just installed the project and fortunately managed to build it. But when I create the first Upcoming Event I get the error: can't find listEvents on object (ROOT_QUERY)

I googled and found a possible solution here:
apollographql/apollo-client#1701

I managed to build the app a couple of weeks ago but then I don't had this error, instead I got error when adding comments to the first event and then everything was gone.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.