Starting a large project and curious about some of these questions:
1) how does native jsonb support work? Are the fields mapped differently somehow? Any gotchas?
2) is graphql-js a dependency so we can always get there latest community updates or does this project user a fork or its own implementation?
3) is there an easy way to use es6/es7 syntax? Any pointers to custom schemas/queries with es6/7?
4) do you know if there are any issues using AWS postgres over rds or Aurora?
Thank you in advance
how does native jsonb support work? Are the fields mapped differently somehow? Any gotchas?
JSON and JSONB support just emits the JSON string in the response. If you want the JSON object and not just the string you can pass the --dynamic-json flag. In GraphQL all JSON fields will have a custom scalar Json type 😊
is graphql-js a dependency so we can always get there latest community updates or does this project user a fork or its own implementation?
Yep! We even have a version range that is more flexible then what is the default for 0.x packages https://github.com/calebmer/postgraphql/blob/54879f694b3918d256fedf84071703ea4dd5ec10/package.json#L42
is there an easy way to use es6/es7 syntax? Any pointers to custom schemas/queries with es6/7?
I’m not sure what you mean by this. Do you want a build artifact of PostGraphQL that is ES2015/ES2016 instead of ES5, or would you like to use PostGraphQL in an ES2016 project?
do you know if there are any issues using AWS postgres over rds or Aurora?
RDS supports Postgres which is a good option and Aurora is MySQL (right?). PostGraphQL currently doesn’t support MySQL. RDS is great and I believe it is the top choice for most of PostGraphQL users.
Let me know if you have any more questions 👍
I'm running PostGraphQL on RDS in production; and my code's written in ES2015+ 👍
Hello ,
I have installed PostGraphQL on an ec2 instance , and I am watching a schema on a RDS .It is working , and I get the usual message GraphiQL endpoint served at http://localhost:5000/graphiql .I need some guidance in order to proceed further . How can I now use the graphiql ?
Thank you
This might be a good place to start:
https://medium.com/the-graphqlhub/graphiql-graphql-s-killer-app-9896242b2125
Also check out:
Does one need to access the public IP address of ec2 instance , in order to send queries or to test it via graphiql and browser ?
Setup postgraphql locally, first. It sounds like your EC2 security group is getting in the way. You need to be able to access the ports on the server that's hosting postgraphql -- postgraphql is running a NodeJS express server and you have to be able to talk to the server to see the response.
Thank you for helping me .I did set up an express server , serving a static file on port 5000 , and it works , when accessing http://ec2-......compute.amazonaws.com:5000/ .Shouldn't I be also able to access http://ec2-......compute.amazonaws.com:5000/grapiql ? like we normally do on localhost , and send queries ?
The URL you placed has a typo: /graphiql. So long as you've not passed --disable-graphiql (-b) then yes, you should be able to visit /graphiql if you are successfully running postgraphql on port 5000 on your EC2 host. What happens when you visit just /graphql (no i)?
When I visit http://ec2-......compute.amazonaws.com:5000/graphql or http://ec2-......compute.amazonaws.com:5000/graphiql
I get
This site can’t be reached
ec2...compute.amazonaws.com refused to connect.
But when I visit http://ec2-......compute.amazonaws.com:5000/ , and I am running on this port my own express server , I get a normal response from my server .
Thank you for your help .
I am using now postgraphql as a middleware in a node.js app and I can post
queries to graphql endpoint .
I do have an additional question . I am still unable to use GraphIQL
interface .
I am using this code :
const postgraphql = require('postgraphql').postgraphql;
app.use(postgraphql('http://user:[email protected]/dbName'',
schemaName='name', {graphiql:true}));
What is the difference between
const postgraphql = require('postgraphql').postgraphql;
and
const postgraphql = require('postgraphql').default ;
Any sugestions ?
Thank you
On Wed, Dec 6, 2017 at 11:46 AM, Benjie Gillam notifications@github.com
wrote:
The URL you placed has a typo: /graphiql. So long as you've not passed
--disable-graphiql (-b) then yes, you should be able to visit /graphiql
if you are successfully running postgraphql on port 5000 on your EC2 host.
What happens when you visit just /graphql (no i)?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-349587490,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnU0QtIc4OYfGMFJtlpEpmEbaVwrKXks5s9mJkgaJpZM4MFsZZ
.
What is the difference between
const postgraphql = require('postgraphql').postgraphql;andconst postgraphql = require('postgraphql').default ;
Nothing: https://github.com/postgraphql/postgraphql/blob/master/src/index.ts#L3-L6
I do have an additional question . I am still unable to use GraphIQL interface
The code you've used should work:
const postgraphql = require('postgraphql').postgraphql;
app.use(postgraphql(process.env.DATABASE_URL,
process.env.SCHEMA_NAME, { graphiql: true }));
That should result in /graphiql serving up the page. Maybe you could detail exactly what error you're getting - what does the /graphiql endpoint return?
It works , indeed .
Thank you for your answer .
On Fri, Dec 15, 2017 at 3:28 PM, Benjie Gillam notifications@github.com
wrote:
What is the difference between const postgraphql = require('postgraphql').
postgraphql; and const postgraphql = require('postgraphql').default ;Nothing: https://github.com/postgraphql/postgraphql/blob/
master/src/index.ts#L3-L6I do have an additional question . I am still unable to use GraphIQL
interfaceThe code you've used should work:
const postgraphql = require('postgraphql').postgraphql;app.use(postgraphql(process.env.DATABASE_URL,process.env.SCHEMA_NAME, { graphiql: true }));
That should result in /graphiql serving up the page. Maybe you could
detail exactly what error you're getting - what does the /graphiql
endpoint return?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-352005591,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnU5co8qkNX50xPzqtldL8LKFl2pXjks5tAnP8gaJpZM4MFsZZ
.
Could you tell me what was wrong so I know how to advise the next person who has this issue please?
Hello ,
Sorry for the late answer , I did not expect an other reply from you , so I
did not check this mail anymore .
The code worked , as expected , I probably forgot to reload . It was my
mistake .
I do have an additional question , if possible . When setting it up in a
local environment , and using
const host ='postgres://user:password@localhost:5432/dbName ';
app.use(postgraphql(host,schemaName='schemaName',{graphiql:true}));
It does not work , even if the command postgraphql -c
postgres://user:password@localhost:5432/dbName -s schemaName
does give me the expected results . I have tried serving from port 3000 but
also from port 5000 .
What should I do ?
Thank you , again ...
On Fri, Dec 15, 2017 at 4:50 PM, Benjie Gillam notifications@github.com
wrote:
Could you tell me what was wrong so I know how to advise the next person
who has this issue please?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-352024248,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnU_tiCgOuZfMSCwtlQ7oz6XP4tj1jks5tAodLgaJpZM4MFsZZ
.
Could you expand on “it does not work”? That’s rather vague so it makes it hard to diagnose. Maybe share the full source of the file also.
Thank you for your answer . It's really helpful to not be alone and have
someone to ask questions .
It does not work in the sense that I can not access graphiql interface when
visiting localhost:3000/graphiql or localhost:5000/graphiql .
The only thing that I changed is the uri : const host =
'http://user:[email protected]/dbName';
One of the things that I do not understand , is that , when running the
node server on port 3000 , should I go in the browser for
localhost:5000/graphiql ? or port 3000 ? Because the command
postgraphql -c .....
displays graphiql on port 5000 ...
I know it's not a smart question .But it does not display the graphiql
interface on neither ..
On Thu, Dec 28, 2017 at 8:06 PM, Benjie Gillam notifications@github.com
wrote:
Could you expand on “it does not work”? That’s rather vague so it makes it
hard to diagnose. Maybe share the full source of the file also.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-354329758,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnUyC1k-EbwIbc62TyBH8cZ1eqjq8cks5tE9iSgaJpZM4MFsZZ
.
Addendum : when visiting localhost:5000/graphiql I get the error TypeError:
Failed to fetch .This is when node server is listening on port 5000.
When app listening on port 3000 en I visit ocalhost:3000/graphiql I get the
error TypeError: Failed to fetch .
In both cases , it fails when posting query IntrospectionQuery .
On Thu, Dec 28, 2017 at 8:34 PM, timon ionutadamclisi <
[email protected]> wrote:
Thank you for your answer . It's really helpful to not be alone and have
someone to ask questions .It does not work in the sense that I can not access graphiql interface
when visiting localhost:3000/graphiql or localhost:5000/graphiql .The only thing that I changed is the uri : const host =
'http://user:[email protected]/dbName';One of the things that I do not understand , is that , when running the
node server on port 3000 , should I go in the browser for
localhost:5000/graphiql ? or port 3000 ? Because the commandpostgraphql -c .....
displays graphiql on port 5000 ...
I know it's not a smart question .But it does not display the graphiql
interface on neither ..On Thu, Dec 28, 2017 at 8:06 PM, Benjie Gillam notifications@github.com
wrote:Could you expand on “it does not work”? That’s rather vague so it makes
it hard to diagnose. Maybe share the full source of the file also.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-354329758,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnUyC1k-EbwIbc62TyBH8cZ1eqjq8cks5tE9iSgaJpZM4MFsZZ
.
Your const host specifies http://; presumably you meant postgres://?
Please share the code you’re running, I’m getting quite confused between postgraphql commands and running it as an express app. Please also share the terminal output and the URL you are visiting and the browser output (e.g. a screenshot) - take me through everything step by step with screenshots or copy/paste of terminal/code.
Also please try connecting to your RDS host from psql on the command line:
psql postgres://user:[email protected]/dbname
And run an SQL query such as select 1+2
Hello ,
I have been on holiday , did not work on the project anymore .
The current problem is the following . While everything was working perfect
, we worked 2 days , suddenly , without changing anything , I start
getting this error
Failed to load http://localhost:3000/graphql: Response to preflight request
doesn't pass access control check: No 'Access-Control-Allow-Origin' header
is present on the requested resource. Origin 'http://www.localhost:3000' is
therefore not allowed access.
Can you kindly help me to understand what is going wrong ?
Thank you ...
On Fri, Dec 29, 2017 at 10:34 AM, Benjie Gillam notifications@github.com
wrote:
Your const host specifies http://; presumably you meant postgres://?
Please share the code you’re running, I’m getting quite confused between
postgraphql commands and running it as an express app. Please also share
the terminal output and the URL you are visiting and the browser output
(e.g. a screenshot) - take me through everything step by step with
screenshots or copy/paste of terminal/code.Also please try connecting to your RDS host from psql on the command line:
psql postgres://user:[email protected]/dbname
And run an SQL query such as select 1+2
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-354415748,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnU_sSVaRiHuTPcNsxp_BfVbC3wCijks5tFKQggaJpZM4MFsZZ
.
Hi @svendpeter it looks like you're loading your webpage as http://www.localhost:3000; if you instead load simply http://localhost:3000 it should work I expect.
Thank you !!
On Fri, Jan 12, 2018 at 7:09 PM, Benjie Gillam notifications@github.com
wrote:
Hi @svendpeter https://github.com/svendpeter it looks like you're
loading your webpage as http://www.localhost:3000; if you instead load
simply http://localhost:3000 it should work I expect.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/362#issuecomment-357296997,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgsnU9Aapz5qO3RDFKnkQAJShjagodlQks5tJ5G2gaJpZM4MFsZZ
.
AWS Aurora supports postgres now, but they don't yet allow the wal2json plugin according to this page:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraPostgreSQL.Compare.html
That seems to rule out live queries for now. But subscriptions should still work, right?
Hopefully; I’ve yet to use Aurora. You could implement a triggers version of live queries; it’s all quite modular. (You’d have to write the code though!) RDS supports wal2json.
Most helpful comment
I'm running PostGraphQL on RDS in production; and my code's written in ES2015+ 👍