Fix demo to run as memory only
This commit is contained in:
parent
6b164aed08
commit
de52ce4738
|
@ -1,8 +1,10 @@
|
|||
# Super Graph
|
||||
# Super Graph - Instant GraphQL API for Rails
|
||||
|
||||
## Instant GraphQL API for Rails. Zero code.
|
||||
![MIT license](https://img.shields.io/github/license/dosco/super-graph.svg)
|
||||
![Docker build](https://img.shields.io/docker/cloud/build/dosco/super-graph.svg)
|
||||
![Cloud native](https://img.shields.io/badge/cloud--native-enabled-blue.svg)
|
||||
|
||||
Get an high-performance GraphQL API for your Rails app in seconds. Super Graph will auto-learn your database structure and relationships. Built in support for Rails authentication and JWT tokens.
|
||||
Get an high-performance GraphQL API for your Rails app in seconds without writing a line of code. Super Graph will auto-learn your database structure and relationships. Built in support for Rails authentication and JWT tokens.
|
||||
|
||||
![Super Graph Web UI](docs/.vuepress/public/super-graph-web-ui.png?raw=true "Super Graph Web UI for web developers")
|
||||
|
||||
|
|
2
demo
2
demo
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$1" == "setup" ]; then
|
||||
docker-compose -f rails-app/demo.yml run web rake db:drop db:create db:migrate db:seed
|
||||
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
|
||||
else
|
||||
|
|
|
@ -3,12 +3,15 @@ module.exports = {
|
|||
description: 'Get an instant GraphQL API for your Rails apps.',
|
||||
|
||||
themeConfig: {
|
||||
logo: '/hero.png',
|
||||
logo: '/logo.png',
|
||||
nav: [
|
||||
{ text: 'Guide', link: '/guide' },
|
||||
{ text: 'Install', link: '/install' },
|
||||
{ text: 'Github', link: 'https://github.com/dosco/super-graph' },
|
||||
{ text: 'Docker', link: 'https://hub.docker.com/r/dosco/super-graph/builds' },
|
||||
]
|
||||
],
|
||||
serviceWorker: {
|
||||
updatePopup: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
home: true
|
||||
heroImage: /hero.png
|
||||
heroImage: /logo.png
|
||||
heroText: "SUPER GRAPH"
|
||||
tagline: Get an instant GraphQL API for your Rails apps.
|
||||
actionText: Get Started →
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
Super Graph
|
||||
Get an instant GraphQL API for your Rails apps
|
||||
18 Apr 2019
|
||||
Tags: GraphQL, API, GoLang, Postgres
|
||||
|
||||
Vikram Rangnekar
|
||||
https://supergraph.dev
|
||||
@dosco
|
||||
|
||||
|
||||
* Motivation
|
||||
|
||||
Honestly, cause it was more fun than my real work. After working on several product though my career I found myself hating building CRUD APIs (Create, Update, Delete, List, Show). It was always the same thing figure out what the UI needs then build an endpoint for it, if related data is needed than join with another table. I didn't want to write that code anymore I wanted the computer to just do it.
|
||||
|
||||
** Subsection
|
||||
|
||||
- bullets
|
||||
- more bullets
|
||||
- a bullet with
|
||||
|
||||
*** Sub-subsection
|
||||
|
||||
Some More text
|
||||
|
||||
Preformatted text
|
||||
is indented (however you like)
|
||||
|
||||
Further Text, including invocations like:
|
||||
|
||||
.image image.jpg
|
||||
.background image.jpg
|
||||
.iframe http://foo
|
||||
.link http://foo label
|
||||
.caption _Gopher_ by [[https://www.instagram.com/reneefrench/][Renée French]]
|
||||
|
||||
Again, more text
|
|
@ -2,6 +2,7 @@ version: '3.4'
|
|||
services:
|
||||
db:
|
||||
image: postgres
|
||||
tmpfs: /var/lib/postgresql/data
|
||||
|
||||
super_graph:
|
||||
image: dosco/super-graph:latest
|
||||
|
@ -16,6 +17,7 @@ services:
|
|||
image: dosco/super-graph-demo:latest
|
||||
environment:
|
||||
RAILS_ENV: "development"
|
||||
tmpfs: /app/tmp/pids
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
Super Graph
|
||||
Instant GraphQL API for Rails. Zero Code.
|
||||
Tags: GraphQL, API, GoLang, Postgres
|
||||
|
||||
Vikram Rangnekar
|
||||
https://twitter.com/@dosco
|
||||
|
||||
|
||||
* Motivation
|
||||
|
||||
- Honestly, cause it was more fun than my real work.
|
||||
- Bored of building yet anther CRUD API
|
||||
- Save hours of my life
|
||||
- Easier to use advanced Postgres features
|
||||
- Always get secure, optimized queries
|
||||
- Quickly add GraphQL to existing apps
|
||||
|
||||
* Got Web UI?
|
||||
|
||||
.image https://supergraph.dev/super-graph-web-ui.png _ 1000
|
||||
|
||||
* What does it do?
|
||||
|
||||
- Add a GraphQL API to any Rails app with zero code
|
||||
- Automatically learns schemas and relationships
|
||||
- Supports Belongs-To, One-To-Many and Many-To-Many relationships
|
||||
- Full text search and Aggregations
|
||||
- Rails Auth supported (Redis, Memcache, Cookie)
|
||||
- JWT tokens supported (Auth0, etc)
|
||||
- Highly optimized and fast Postgres SQL queries
|
||||
|
||||
* How does it work?
|
||||
|
||||
GraphQL Input
|
||||
|
||||
query {
|
||||
users{
|
||||
email
|
||||
id
|
||||
}
|
||||
}
|
||||
|
||||
SQL Output
|
||||
|
||||
SELECT
|
||||
"users_0"."email" AS "email",
|
||||
"users_0"."id" AS "id"
|
||||
FROM (
|
||||
SELECT
|
||||
"users"."email",
|
||||
"users"."id"
|
||||
FROM "users"
|
||||
WHERE ((("users"."id") = ('4'))) limit ('20') :: integer)
|
||||
LIMIT ('20') :: integer))
|
||||
|
||||
* Advanced Queries made simple
|
||||
|
||||
query {
|
||||
products(
|
||||
# Search for all products that contain 'ale' or some version of it
|
||||
search: "ale"
|
||||
|
||||
# Return only matches where the price is less than 10
|
||||
where: { price: { lt: 10 } }
|
||||
|
||||
# Use the search_rank to order from the best match to the worst
|
||||
order_by: { search_rank: desc }) {
|
||||
|
||||
id
|
||||
name
|
||||
search_rank
|
||||
search_headline_description
|
||||
}
|
||||
}
|
||||
|
||||
* Easy to configure
|
||||
|
||||
database:
|
||||
variables:
|
||||
account_id: "select account_id from users where id = $user_id"
|
||||
|
||||
defaults:
|
||||
filter: ["{ user_id: { eq: $user_id } }"]
|
||||
|
||||
blacklist:
|
||||
- password
|
||||
- secret_token
|
||||
|
||||
fields:
|
||||
- name: users
|
||||
filter: ["{ id: { eq: $user_id } }"]
|
||||
|
||||
- name: products
|
||||
filter: [
|
||||
"{ price: { gt: 0 } }",
|
||||
"{ price: { lt: 8 } }"
|
||||
]
|
||||
|
||||
- name: me
|
||||
table: users
|
||||
filter: ["{ id: { eq: $user_id } }"]
|
Loading…
Reference in New Issue