Skip to content

Commit a5c02ab

Browse files
praveenwebhasura-bot
authored andcommitted
community: update sample apps to use hasura cloud and v3 migrations/metadata
GitOrigin-RevId: c3858e4
1 parent bf76de3 commit a5c02ab

File tree

262 files changed

+1936
-3291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+1936
-3291
lines changed

community/sample-apps/firebase-jwt/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ The client-side code is in `app/` folder.
4141

4242
## Configure Hasura to start in JWT mode
4343

44-
Deploy Hasura GraphQL Engine on Heroku:
45-
46-
[![Deploy HGE on heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/hasura/graphql-engine-heroku)
44+
- Deploy GraphQL Engine on Hasura Cloud and setup PostgreSQL via Heroku:
45+
46+
[![Deploy to Hasura Cloud](https://graphql-engine-cdn.hasura.io/img/deploy_to_hasura.png)](https://cloud.hasura.io/)
4747

4848
After deploying, add the following environment variables to configure JWT mode:
4949

Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
endpoint: http://localhost:8080
1+
version: 3
2+
endpoint: http://localhost:8080/
3+
api_paths:
4+
v1_query: v1/query
5+
v2_query: v2/query
6+
v1_metadata: v1/metadata
7+
graphql: v1/graphql
8+
config: v1alpha1/config
9+
pg_dump: v1alpha1/pg_dump
10+
version: v1/version
11+
metadata_directory: metadata
12+
migrations_directory: migrations
13+
seeds_directory: seeds
14+
actions:
15+
kind: synchronous
16+
handler_webhook_baseurl: http://localhost:3000
17+
codegen:
18+
framework: ""
19+
output_dir: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
actions: []
2+
custom_types:
3+
enums: []
4+
input_objects: []
5+
objects: []
6+
scalars: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: default
2+
configuration:
3+
connection_info:
4+
database_url:
5+
from_env: SAMPLE_APPS_DATABASE_URL
6+
pool_settings:
7+
idle_timeout: 180
8+
max_connections: 50
9+
retries: 1
10+
tables: []
11+
functions: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version: 3

community/sample-apps/gatsby-contentful-auth0/hasura/migrations/1563970259491_init_metadata.up.yaml

-169
This file was deleted.

community/sample-apps/gatsby-contentful-auth0/hasura/migrations/1564120661494_table_playlist_track_create_remote_relationship_track.down.yaml

-6
This file was deleted.

community/sample-apps/gatsby-contentful-auth0/hasura/migrations/1564120661494_table_playlist_track_create_remote_relationship_track.up.yaml

-14
This file was deleted.

community/sample-apps/gatsby-contentful-auth0/hasura/migrations/1563970185567_init_schema.up.sql community/sample-apps/gatsby-contentful-auth0/hasura/migrations/default/1613666112230_init/up.sql

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
CREATE TABLE public.playlist (
2-
id integer NOT NULL,
3-
name text NOT NULL,
4-
user_id text NOT NULL,
5-
created_at timestamp with time zone DEFAULT now() NOT NULL
6-
);
7-
CREATE TABLE public.playlist_track (
8-
track_id integer NOT NULL,
9-
playlist_id integer NOT NULL
10-
);
111
CREATE TABLE public.album (
122
id integer NOT NULL,
133
name text NOT NULL,
@@ -21,6 +11,12 @@ CREATE SEQUENCE public.album_id_seq
2111
NO MAXVALUE
2212
CACHE 1;
2313
ALTER SEQUENCE public.album_id_seq OWNED BY public.album.id;
14+
CREATE TABLE public.playlist (
15+
id integer NOT NULL,
16+
name text NOT NULL,
17+
user_id text NOT NULL,
18+
created_at timestamp with time zone DEFAULT now() NOT NULL
19+
);
2420
CREATE SEQUENCE public.playlist_id_seq
2521
AS integer
2622
START WITH 1
@@ -29,6 +25,10 @@ CREATE SEQUENCE public.playlist_id_seq
2925
NO MAXVALUE
3026
CACHE 1;
3127
ALTER SEQUENCE public.playlist_id_seq OWNED BY public.playlist.id;
28+
CREATE TABLE public.playlist_track (
29+
track_id integer NOT NULL,
30+
playlist_id integer NOT NULL
31+
);
3232
CREATE TABLE public.track (
3333
id integer NOT NULL,
3434
name text NOT NULL,
@@ -67,4 +67,4 @@ ALTER TABLE ONLY public.playlist_track
6767
ALTER TABLE ONLY public.playlist
6868
ADD CONSTRAINT playlist_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
6969
ALTER TABLE ONLY public.track
70-
ADD CONSTRAINT track_album_id_fkey FOREIGN KEY (album_id) REFERENCES public.album(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
70+
ADD CONSTRAINT track_album_id_fkey FOREIGN KEY (album_id) REFERENCES public.album(id) ON UPDATE RESTRICT ON DELETE RESTRICT;

community/sample-apps/gatsby-postgres-graphql/README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@ Boilerplate to get started with Gatsby, Hasura GraphQL engine as CMS and postgre
88

99
# Tutorial
1010

11-
1. Deploy Postgres and GraphQL Engine on Heroku:
11+
- Deploy GraphQL Engine on Hasura Cloud and setup PostgreSQL via Heroku:
12+
13+
[![Deploy to Hasura Cloud](https://graphql-engine-cdn.hasura.io/img/deploy_to_hasura.png)](https://cloud.hasura.io/)
1214

13-
[![Deploy to
14-
heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/hasura/graphql-engine-heroku)
15+
- Get the Hasura app URL (say `gatsby-graphql.hasura.app`)
1516

16-
2. Get the Heroku app URL (say `my-app.herokuapp.com`)
17-
3. Clone this repo:
17+
- Clone this repo:
1818

1919
```bash
2020
git clone https://github.com/hasura/graphql-engine
2121
cd graphql-engine/community/sample-apps/gatsby-postgres-graphql
2222
```
2323

24-
4. Create `author` table:
24+
- Create `author` table:
2525

26-
Open Hasura console: visit https://my-app.herokuapp.com on a browser
26+
Open Hasura console: visit https://gatsby-graphql.hasura.app on a browser
2727
Navigate to `Data` section in the top nav bar and create a table as follows:
2828

2929
![Create author table](./assets/add_table.jpg)
3030

31-
5. Insert sample data into `author` table:
31+
- Insert sample data into `author` table:
3232

3333
![Insert data into author table](./assets/insert_data.jpg)
3434

3535
Verify if the row is inserted successfully
3636

3737
![Insert data into author table](./assets/browse_rows.jpg)
3838

39-
6. Install npm modules:
39+
- Install npm modules:
4040

4141
```bash
4242
npm install
4343
```
4444

45-
7. Configure gatsby to use `gatsby-source-graphql` plugin and a connection GraphQL url to stitch the schema.
45+
- Configure gatsby to use `gatsby-source-graphql` plugin and a connection GraphQL url to stitch the schema.
4646

4747
```js
4848
{
@@ -60,13 +60,13 @@ npm install
6060
}
6161
```
6262

63-
8. Run the app:
63+
- Run the app:
6464

6565
```bash
66-
GATSBY_HASURA_GRAPHQL_URL=https://my-app.herokuapp.com/v1/graphql npm run develop
66+
GATSBY_HASURA_GRAPHQL_URL=https://gatsby-graphql.hasura.app/v1/graphql npm run develop
6767
```
6868

69-
9. Test the app
69+
- Test the app
7070
Visit [http://localhost:8000](http://localhost:8000) to view the app
7171

7272
![Demo app](./assets/test_app.jpg)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
endpoint: https://hasura-graphql-2.herokuapp.com
1+
endpoint: https://gatsby-graphql.hasura.app
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 3
2+
endpoint: http://localhost:8080/
3+
api_paths:
4+
v1_query: v1/query
5+
v2_query: v2/query
6+
v1_metadata: v1/metadata
7+
graphql: v1/graphql
8+
config: v1alpha1/config
9+
pg_dump: v1alpha1/pg_dump
10+
version: v1/version
11+
metadata_directory: metadata
12+
migrations_directory: migrations
13+
seeds_directory: seeds
14+
actions:
15+
kind: synchronous
16+
handler_webhook_baseurl: http://localhost:3000
17+
codegen:
18+
framework: ""
19+
output_dir: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
actions: []
2+
custom_types:
3+
enums: []
4+
input_objects: []
5+
objects: []
6+
scalars: []

0 commit comments

Comments
 (0)