A GraphQL API created by reflection over a PostgreSQL schema. Formerly PostGraphQL.
Questions tagged [postgraphile]
118 questions
8
votes
1 answer
PostgreSQL ignores pg_trgm GIN indexes when Row Level Security is enabled and NOT LEAKPROOF operator is used
First of all, this SO question describes a similar problem: PostgreSQL query not using INDEX when RLS (Row Level Security) is enabled
, but I was not able to successfully utilize it's suggestions and also would like to see if there is a way to…

user1762820
- 223
- 3
- 8
7
votes
2 answers
Filtering results in GraphQL using PostGraphile
I'm trying to wrap my head around GraphQL and I though using PostGraphile to easily and quickly map my PostgreSQL database and expose it using GraphQL. However, I've been stuck a long time on some things that in simple SQL would be a matter of…

Jonathan Perry
- 2,953
- 2
- 44
- 51
5
votes
1 answer
Is it possible to get rid of the 'data' ,'nodes', ... fields?
I have the following GraphQL query:
{
allForums {
nodes {
name,
topics: topicsByForumId(orderBy: [TITLE_ASC]) {
nodes {
title
}
}
}
}
}
This returns something as following:
{
"data": {
…

Opl0
- 51
- 2
4
votes
1 answer
relay-compiler 12 + graphql 16 = Invalid AST Node
I have a react / express / postgraphile / relay project and recently upgraded all my packages to the latest to see what would break. I got through most bugs except this relay-compiler error Invalid AST Node which seems to be related to graphql 16. I…

Kirk Ross
- 6,413
- 13
- 61
- 104
4
votes
0 answers
Merge GraphQL Types and their arguments in a stitched schema
I have two GraphQL schemas that define two different Types User which are in a one-to-one relationship. Each of them implements a set of arguments (filter, condition, ...) that are used for filtering for example.
// analyticsSchema
type User {
id:…

kluu
- 2,848
- 3
- 15
- 35
4
votes
0 answers
How do i use `selectGraphQLResultFromTable` to load relations for a Sequelize query in a post-graphile resolver?
I have in my database a couple of related tables:
rooms table:
"id" SERIAL PRIMARY KEY,
"details" jsonb,
"metadata" jsonb,
"region" character varying(255) NOT NULL DEFAULT 'uk'::character varying,
"createdAt" timestamp with time…

BaliTov
- 41
- 3
4
votes
2 answers
Postgraphile error while trying to open UI
When I try to open postgraphile UI it's not working. I'm getting the following error.
A serious error occurred when building the initial schema. Exiting
because retryOnInitFail is not set.
Error: Connection terminated unexpectedly
at Connection.…

deluxan
- 372
- 1
- 5
- 22
4
votes
2 answers
How to make INSERT ... RETURNING statement work when using Row Level Security (RLS)?
Below you can find code for a minimal test case for an issue I am having in a system where RLS is used to manage access to a hierarchical datastructure. I am using Postgres v11.
In the code I have units, which is a top level object. units have…

Jesper We
- 5,977
- 2
- 26
- 40
4
votes
3 answers
GraphQL queries in Separate File (gql, graphql)
I am working on project with teachnology combination of React + Postgraphile (GraphQL) + axios(http request to postgraphile server).
It has lots of GraphQL queries. Initially started with queries in same file with the other JavaScript and rendering…

Manan
- 140
- 2
- 14
3
votes
1 answer
connectionFilterRelations not working with postgraphile-plugin-connection-filter
I am trying to filter my results based on a one to many relationship and outlined in the documentation for postgraphile-plugin-connection-filter that outlines how to do it. I have enabled this but the options are not showing up.
I have reset the…

Jamie Hutber
- 26,790
- 46
- 179
- 291
3
votes
2 answers
Postgraphile "Only `POST` requests are allowed." error
I have Postgres running locally. I can access the database locally with psql postgres:///reviewapp and with \dt I can see a few tables.
If I run npx postgraphile -c "postgres:///reviewapp" I dont get any errors in the terminal:
PostGraphile v4.12.4…

Evanss
- 23,390
- 94
- 282
- 505
3
votes
1 answer
Can GraphQL operations/results format be simplified?
I'm using latest version of Postraphile (on its Docker container) and I've installed pg-simplify-inflector plugin, I've noted an improvement respect to names for operations, and I wish to get a simplified format for operations and their results.…

Ουιλιαμ Αρκευα
- 5,561
- 7
- 35
- 61
3
votes
1 answer
Angular/Graphile & CORS
I just spend more than a day trying to understand this. I'm working on a new hobby project and wanted to learn GraphQL. This is my current setup:
Server:
PostGreSQL db (docker)
Graphile server (docker)
configured via docker-compose, both images run…

Wim Verhavert
- 979
- 8
- 16
3
votes
2 answers
PG (Node-Postgres) Pool Hangs on Connect ... But Only Inside Gatsby?
NOTE: This is mainly a question about the pg or Node-PostgreSQL module. It has details from Gatsby and Postgraphile, but I don't need expertise in all three, just pg.
I have a database that works great with a PostGraphile-using Express server. I…

machineghost
- 33,529
- 30
- 159
- 234
3
votes
1 answer
GraphQL - How retrieve id of previous mutation, during query of multiple mutations
i would like run multiple mutations in the same query.
In the example below, i create an order and after i create a product record, concerning previously created.
I must have 2 mutations.
First, i insert an order. In output, i retrieve among…

stack80
- 33
- 6