38
loading...
This website collects cookies to deliver better user experience
railway version
railway version 0.2.40
railway login
railway init
railway add
railway connect postgresql
psql (13.3, server 13.2)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
railway=#
CREATE TABLE Post (title text, body text);
INSERT INTO Post VALUES ('This is a blog post', 'Wooooooo');
INSERT INTO Post VALUES ('Another blog post', 'Even better than the other!');
\d
List of relations
Schema | Name | Type | Owner
-------------+------+-------+----------
public | post | table | postgres
(1 row)
\d post
Table "public.post"
Column | Type | Collation | Nullable | Default
-------------+------+-----------+----------+---------
title | text | | |
body | text | | |
\q
echo `railway variables get DATABASE_URL` | pbcopy
npm install -g postgraphile
npx
the beginning of all postgraphile
commands in this tutorial.railway run postgraphile --watch --enhance-graphiql --dynamic-json --port 5001
localhost:5001/graphiql
and send the following query.curl \
--request POST \
--url "http://localhost:5001/graphql" \
--header "Content-Type: application/json" \
--data '{"query":"{ query { allPosts { totalCount nodes { body title } } } }"}'
{
"data":{
"query":{
"allPosts":{
"totalCount":2,
"nodes":[
{
"body":"Wooooooo",
"title":"This is a blog post"
},
{
"body":"Even better than the other!",
"title":"Another blog post"
}
]
}
}
}
}
./ngrok http 5001
Session Status online
Account Anthony Campolo (Plan: Free)
Version 2.3.40
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://363ef1ef5cf3.ngrok.io -> http://localhost:5001
Forwarding https://363ef1ef5cf3.ngrok.io -> http://localhost:5001
Connections ttl opn rt1 rt5 p50 p90
2 0 0.00 0.00 5.11 5.21