From 77e56643c55aeca72cea8e06c582dddae45dca44 Mon Sep 17 00:00:00 2001 From: Vikram Rangnekar Date: Sat, 1 Jun 2019 10:53:24 -0400 Subject: [PATCH] Reduce steps to run the demo --- README.md | 2 +- demo | 5 ++++- docs/README.md | 7 ++----- docs/guide.md | 12 +++++------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5786a25..d668655 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ And so after a lot of coffee and some Avocado toasts __Super Graph was born, a G - Full text search and Aggregations - Rails Auth supported (Redis, Memcache, Cookie) - JWT tokens supported (Auth0, etc) -- Stitching in REST APIs +- Join with remote REST APIs - Highly optimized and fast Postgres SQL queries - Configure with a simple config file - High performance GO codebase diff --git a/demo b/demo index 1a14e4b..43c20c1 100755 --- a/demo +++ b/demo @@ -4,6 +4,9 @@ if [ "$1" == "setup" ]; then docker-compose -f rails-app/demo.yml run web rake db:create db:migrate db:seed elif [ "$1" == "run" ]; then docker-compose -f rails-app/demo.yml up +elif [ "$1" == "start" ]; then + docker-compose -f rails-app/demo.yml run web rake db:create db:migrate db:seed + docker-compose -f rails-app/demo.yml up else - echo "./demo [setup|run]" + echo "./demo [setup|run|start]" fi \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index b732cc3..e897de9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,11 +25,8 @@ Without writing a line of code get an instant high-performance GraphQL API for y # download super graph source git clone https://github.com/dosco/super-graph.git -# setup the demo rails app & database -./demo setup - -# run the demo -./demo run +# setup the demo rails app & database and run it +./demo start # signin to the demo app (user1@demo.com / 123456) open http://localhost:3000 diff --git a/docs/guide.md b/docs/guide.md index b496596..eb5da31 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -13,6 +13,7 @@ Without writing a line of code get an instant high-performance GraphQL API for y - Full text search and Aggregations - Rails Auth supported (Redis, Memcache, Cookie) - JWT tokens supported (Auth0, etc) +- Join with remote REST APIs - Highly optimized and fast Postgres SQL queries - Configure with a simple config file - High performance GO codebase @@ -24,11 +25,8 @@ Without writing a line of code get an instant high-performance GraphQL API for y # download super graph source git clone https://github.com/dosco/super-graph.git -# setup the demo rails app & database -./demo setup - -# run the demo -./demo run +# setup the demo rails app & database and run it +./demo start # signin to the demo app (user1@demo.com / 123456) open http://localhost:3000 @@ -347,9 +345,9 @@ class AddSearchColumn < ActiveRecord::Migration[5.1] end ``` -## API Stitching +## Join with remote REST APIs -It often happens that after fetching some data from the DB we need to call another API to fetch some more data and all this combined into a single JSON response. +It often happens that after fetching some data from the DB we need to call another API to fetch some more data and all this combined into a single JSON response. For example along with a list of users you need their last 5 payments from Stripe. This requires you to query your DB for the users and Stripe for the payments. Super Graph handles all this for you also only the fields you requested from the Stripe API are returned. All this is a very performance focused way. For example you need to list the last 3 payments made by a user. You will first need to look up the user in the database and then call the Stripe API to fetch his last 3 payments. For this to work your user table in the db has a `customer_id` column that contains his Stripe customer ID.