GitXplorerGitXplorer
n

serverless-graphql-app

public
34 stars
9 forks
1 issues

Commits

List of commits on branch master.
Unverified
6444401473b208e09c56b9fc9790efd50453665a

Merge pull request #3 from lennym/bugfix/missing-dependencies

nnikhilaravi committed 9 years ago
Unverified
dec740a9841aabb04017606d9433acb5574da78c

Merge pull request #2 from dsibiski/patch-1

nnikhilaravi committed 9 years ago
Unverified
b9bd9cdb054704af0fa3691c9648cfc07fed61a3

Add missing dependencies to package.json

llennym committed 9 years ago
Unverified
1e982dee578760a05c61bfa2a8e458bb07b9d969

Fixes GraphiQL query sample in Readme

ddsibiski committed 9 years ago
Unverified
6399d4661abd0ce07192936ad5c85eb2bf72ecfe

Updates css on app homepage

nnikhilaravi committed 9 years ago
Unverified
c02e60fb017561fe4a59328938c33c3ea3cf1c8f

adds tests

nnikhilaravi committed 9 years ago

README

The README file for this repository.

Serverless GraphQL Jukebox

Front end and GraphiQL IDE for serverless graphql jukebox app.

The code for the creation of a lambda function and api gateway endpoint can be found here https://github.com/nikhilaravi/serverless-graphql Follow the steps to create the api and lambda first!! You'll need an api invoke url in order to deploy the UI.

Demo app: http://demo-v1.s3-website-us-east-1.amazonaws.com/app/

Demo GraphiQL: http://demo-v1.s3-website-us-east-1.amazonaws.com/graphiql/

To try out GraphiQL paste this query into the query editor

query($query: String) {
  suggestions(query: $query) {
    name,
    artist,
    url,
    imageUrl
  }
}

and paste this into the query variables editor on the bottom left of the screen.

{
  "query": "name of a song"
}

Then hit the 'play' button!

Technologies

  • AWS s3 - host a static website for the UI
  • GraphiQL - IDE to inspect and query a GraphQl schema
  • React
  • Babel
  • Webpack

Before you start export your environment variables

export AWS_ACCESS_KEY_ID='yourkey'
export AWS_ACCESS_KEY_SECRET='yoursecretkey'
export AWS_REGION='region'

1. Create an S3 bucket and enable static website hosting

Set the name of the bucket in the ./scripts/s3-create-app.sh file as well as in the ./scripts/s3-update-app.sh and ./scripts/s3-update-graphiql.sh

Create the bucket by typing the command:

npm run create-s3

2. Add the api invoke url to config.js

This the url that will be used to invoke the API gateway endpoint to trigger the GraphQL lambda function

3. Check everything works by running locally

The app and GraphiQL can be run individually using

npm run app:serve

or

npm run graphiql:serve

4. Deploy to S3

To deploy both the App and Graphiql use the command:

npm run deploy:ui

or to deploy each separately use:

npm run deploy:app

or

npm run deploy:graphiql

View the website!

Great your app is now live!

To view the app visit the url: http://bucketname.s3-website-eu-west-1.amazonaws.com/ Swap bucketname for the name of your bucket!!!*

Add /app at the end of the url to view the app or /graphiql to view GraphiQL.