-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-1182-cache-update
Resolve Conflicts: server/src-exec/Main.hs server/src-exec/Ops.hs server/src-lib/Hasura/Server/App.hs server/src-lib/Hasura/Server/Init.hs server/src-lib/Hasura/Server/Query.hs server/src-rsr/migrate_from_9_to_10.sql
- Loading branch information
Showing
322 changed files
with
7,820 additions
and
5,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_output | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:11-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libpq5 \ | ||
netcat \ | ||
&& curl -L https://github.com/hasura/graphql-engine/raw/master/cli/get.sh | INSTALL_PATH=/bin bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const echo = (req, res) => { | ||
try { | ||
const { event: { op, data }, table: { name, schema } } = req.body; | ||
const response = { message: 'received event', data: { op, data, name, schema } }; | ||
console.log('--->', response); | ||
return res.json(response); | ||
} catch (err) { | ||
console.error('xxx>', err); | ||
return res.status(500).json({ error: err.message || err }); | ||
} | ||
}; | ||
|
||
export default echo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { buildSchema } from 'graphql'; | ||
|
||
const schema = buildSchema(` | ||
type Query { | ||
hello: String | ||
} | ||
`); | ||
|
||
const root = { | ||
hello: () => { | ||
return 'Hello world!'; | ||
} | ||
}; | ||
|
||
export { schema, root }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import express from 'express'; | ||
import morgan from 'morgan'; | ||
import graphqlHTTP from 'express-graphql'; | ||
|
||
import echo from './echo'; | ||
import { schema, root } from './graphql'; | ||
|
||
const app = express(); | ||
app.use(express.json()); | ||
app.use(morgan('tiny')); | ||
|
||
app.get('/', (req, res) => res.send('api server listening for requests')); | ||
|
||
app.post('/trigger/echo', echo); | ||
|
||
app.use('/remote-schema/hello', graphqlHTTP({ | ||
schema: schema, | ||
rootValue: root, | ||
graphiql: process.env.ENABLE_GRAPHIQL === 'true' ? true : false, | ||
})); | ||
|
||
const port = process.env.PORT || 3000; | ||
app.listen(port, () => console.log(`event triggers listening on port ${port}!`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "api-server", | ||
"version": "1.0.0", | ||
"description": "api server for event triggers and remote schemas", | ||
"main": "index.js", | ||
"author": "shahidhk", | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "nodemon -r esm index.js", | ||
"start-prod": "node -r esm index.js" | ||
}, | ||
"devDependencies": { | ||
"nodemon": "^1.18.10" | ||
}, | ||
"dependencies": { | ||
"esm": "^3.2.6", | ||
"express": "^4.16.4", | ||
"express-graphql": "^0.7.1", | ||
"graphql": "^14.1.1", | ||
"morgan": "^1.9.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
endpoint: http://localhost:8080 |
3 changes: 3 additions & 0 deletions
3
...cleci/server-upgrade/hasura/migrations/1551151778747_create_table_public_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- args: | ||
sql: DROP TABLE "public"."author" | ||
type: run_sql |
8 changes: 8 additions & 0 deletions
8
.circleci/server-upgrade/hasura/migrations/1551151778747_create_table_public_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- args: | ||
sql: CREATE TABLE "public"."author"("id" serial NOT NULL, "name" text NOT NULL, | ||
PRIMARY KEY ("id") ); | ||
type: run_sql | ||
- args: | ||
name: author | ||
schema: public | ||
type: add_existing_table_or_view |
3 changes: 3 additions & 0 deletions
3
...leci/server-upgrade/hasura/migrations/1551151797817_create_table_public_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- args: | ||
sql: DROP TABLE "public"."article" | ||
type: run_sql |
8 changes: 8 additions & 0 deletions
8
.circleci/server-upgrade/hasura/migrations/1551151797817_create_table_public_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- args: | ||
sql: CREATE TABLE "public"."article"("id" serial NOT NULL, "title" text NOT NULL, | ||
"author_id" integer NOT NULL, PRIMARY KEY ("id") ); | ||
type: run_sql | ||
- args: | ||
name: article | ||
schema: public | ||
type: add_existing_table_or_view |
3 changes: 3 additions & 0 deletions
3
...rade/hasura/migrations/1551151805486_alter_table_public_article_add_foreign_key.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- args: | ||
sql: ALTER TABLE "public"."article" DROP CONSTRAINT "article_author_id_fkey" | ||
type: run_sql |
4 changes: 4 additions & 0 deletions
4
...pgrade/hasura/migrations/1551151805486_alter_table_public_article_add_foreign_key.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- args: | ||
sql: ALTER TABLE "public"."article" ADD FOREIGN KEY ("author_id") REFERENCES "public"."author" | ||
("id") | ||
type: run_sql |
6 changes: 6 additions & 0 deletions
6
...migrations/1551151812056_add_relationship_authorByauthorId_table_public_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
relationship: authorByauthorId | ||
table: | ||
name: article | ||
schema: public | ||
type: drop_relationship |
8 changes: 8 additions & 0 deletions
8
...a/migrations/1551151812056_add_relationship_authorByauthorId_table_public_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- args: | ||
name: authorByauthorId | ||
table: | ||
name: article | ||
schema: public | ||
using: | ||
foreign_key_constraint_on: author_id | ||
type: create_object_relationship |
6 changes: 6 additions & 0 deletions
6
...igrations/1551151820765_add_relationship_articlesByauthorId_table_public_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
relationship: articlesByauthorId | ||
table: | ||
name: author | ||
schema: public | ||
type: drop_relationship |
12 changes: 12 additions & 0 deletions
12
.../migrations/1551151820765_add_relationship_articlesByauthorId_table_public_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- args: | ||
name: articlesByauthorId | ||
table: | ||
name: author | ||
schema: public | ||
using: | ||
foreign_key_constraint_on: | ||
column: author_id | ||
table: | ||
name: article | ||
schema: public | ||
type: create_array_relationship |
6 changes: 6 additions & 0 deletions
6
...rade/hasura/migrations/1551271368044_update_permission_user_public_table_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: drop_insert_permission |
15 changes: 15 additions & 0 deletions
15
...pgrade/hasura/migrations/1551271368044_update_permission_user_public_table_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- args: | ||
permission: | ||
allow_upsert: true | ||
check: | ||
id: | ||
_eq: X-Hasura-User-Id | ||
columns: | ||
- name | ||
set: | ||
id: x-hasura-user-id | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: create_insert_permission |
6 changes: 6 additions & 0 deletions
6
...rade/hasura/migrations/1551271380134_update_permission_user_public_table_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: drop_select_permission |
15 changes: 15 additions & 0 deletions
15
...pgrade/hasura/migrations/1551271380134_update_permission_user_public_table_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- args: | ||
permission: | ||
allow_aggregations: true | ||
columns: | ||
- id | ||
- name | ||
filter: | ||
id: | ||
_eq: X-Hasura-User-Id | ||
limit: null | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: create_select_permission |
6 changes: 6 additions & 0 deletions
6
...rade/hasura/migrations/1551271390609_update_permission_user_public_table_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: drop_update_permission |
13 changes: 13 additions & 0 deletions
13
...pgrade/hasura/migrations/1551271390609_update_permission_user_public_table_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- args: | ||
permission: | ||
columns: | ||
- name | ||
filter: | ||
id: | ||
_eq: X-Hasura-User-Id | ||
set: {} | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: create_update_permission |
6 changes: 6 additions & 0 deletions
6
...rade/hasura/migrations/1551271394593_update_permission_user_public_table_author.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: drop_delete_permission |
10 changes: 10 additions & 0 deletions
10
...pgrade/hasura/migrations/1551271394593_update_permission_user_public_table_author.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- args: | ||
permission: | ||
filter: | ||
id: | ||
_eq: X-Hasura-User-Id | ||
role: user | ||
table: | ||
name: author | ||
schema: public | ||
type: create_delete_permission |
6 changes: 6 additions & 0 deletions
6
...ade/hasura/migrations/1551271434010_update_permission_user_public_table_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: drop_insert_permission |
16 changes: 16 additions & 0 deletions
16
...grade/hasura/migrations/1551271434010_update_permission_user_public_table_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- args: | ||
permission: | ||
allow_upsert: true | ||
check: | ||
author_id: | ||
_eq: X-Hasura-User-Id | ||
columns: | ||
- id | ||
- title | ||
set: | ||
author_id: x-hasura-user-id | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: create_insert_permission |
6 changes: 6 additions & 0 deletions
6
...ade/hasura/migrations/1551271446402_update_permission_user_public_table_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: drop_select_permission |
16 changes: 16 additions & 0 deletions
16
...grade/hasura/migrations/1551271446402_update_permission_user_public_table_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- args: | ||
permission: | ||
allow_aggregations: true | ||
columns: | ||
- author_id | ||
- id | ||
- title | ||
filter: | ||
author_id: | ||
_eq: X-Hasura-User-Id | ||
limit: null | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: create_select_permission |
6 changes: 6 additions & 0 deletions
6
...ade/hasura/migrations/1551271457684_update_permission_user_public_table_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: drop_update_permission |
13 changes: 13 additions & 0 deletions
13
...grade/hasura/migrations/1551271457684_update_permission_user_public_table_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- args: | ||
permission: | ||
columns: | ||
- title | ||
filter: | ||
author_id: | ||
_eq: X-Hasura-User-Id | ||
set: {} | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: create_update_permission |
6 changes: 6 additions & 0 deletions
6
...ade/hasura/migrations/1551271461819_update_permission_user_public_table_article.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- args: | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: drop_delete_permission |
10 changes: 10 additions & 0 deletions
10
...grade/hasura/migrations/1551271461819_update_permission_user_public_table_article.up.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- args: | ||
permission: | ||
filter: | ||
author_id: | ||
_eq: X-Hasura-User-Id | ||
role: user | ||
table: | ||
name: article | ||
schema: public | ||
type: create_delete_permission |
3 changes: 3 additions & 0 deletions
3
...cleci/server-upgrade/hasura/migrations/1551271959908_create_trigger_author_echo.down.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- args: | ||
name: author_echo | ||
type: delete_event_trigger |
Oops, something went wrong.