Questions tagged [postgraphile]

A GraphQL API created by reflection over a PostgreSQL schema. Formerly PostGraphQL.

https://github.com/graphile/postgraphile

118 questions
2
votes
1 answer

Postgraphile views vs functions

Recently, I started working with Postgraphile to implement an API for the use of the react app I'm currently working on. As my app grows I find myself continuously writing new views with smart comments to create more complex queries to the database.…
maryum375
  • 727
  • 1
  • 10
  • 22
2
votes
2 answers

How to run GraphQL filter query on an ARRAY field type in Hasura?

I'm trying to run GraphQL filter query on array field types, for example on a text ARRAY field type. In the following example scenario: CREATE TABLE CREATE TABLE Employee ( firstName text, lastName text, tags …
dgkm
  • 21
  • 1
  • 4
2
votes
1 answer

Fetch data after given createdAt date

I want to fetch data of last one hour. I have doubt how to add > && < in postgraphile? if I add current_timestamp in double quotation still getting error. Here is postgraphile screen. 'hour in postgraphile
Radhe9254
  • 198
  • 1
  • 11
1
vote
1 answer

Does Hasura support "contains" filter for integer[] data types from postgres?

We are evaluating a migration from postgraphile to hasura and what I've noticed is that hasura doesn't support a contains filter option for a view column of type integer[]. Is there a way to enable this? We have several views depending on the…
Han Che
  • 8,239
  • 19
  • 70
  • 116
1
vote
0 answers

I am getting a GraphQL query syntax error on a simple query

I am getting an error code of 42601: "syntax error at or near ")" The query itself is very simple: query SimilarJobs { similarityScore(skills: ["KS1203W702ND09XHKJR5"]) { score } } Here is a screenshot of what's happening: I don't see a syntax…
Michael
  • 25
  • 4
1
vote
0 answers

Postgraphile not exposing non public schema with introspection

When using Postgraphile with express, I can connect to my database, but when running the server via node dist/index.js: Not working in index.js const postgraphileOptions: PostGraphileOptions = { subscriptions: true, watchPg: true, …
Randall Spencer
  • 69
  • 2
  • 11
1
vote
1 answer

postgraphile - how to enable many to many relation field

I have Uploads table. Uploads has many-to-many relation with Parties table. the junction table is Uploads_Parties, it contains: upload_id & party_id as fields. how can i make postgraphile to consider these relation in the schema generation…
Itay Tur
  • 683
  • 1
  • 15
  • 40
1
vote
1 answer

Postgraphil Graphql - how to filter query only if the input is not null and not empty

Im using postgraphile and i have this query: query Products($categories: [String]){ products( filter: { category: { in: $categories } }) { id name category } } is there a way to not use the filter if the $categories…
Itay Tur
  • 683
  • 1
  • 15
  • 40
1
vote
1 answer

How to add Wrap resolver in NestJS and GraphQL to check if email from header is equal to the email in query

I'm using cognito authentication, I create a middlware const { email } = payload; req.headers['user-email'] = email as string; I want to write this kind of function public async httpCheck(query: any, args: any, context: any, resolveInfo: any)…
1
vote
1 answer

How to add a where condition based on context in a Postgraphile plugin?

I'm evaluating Postgraphile for a small experiment and was trying to add an implicit where condition to the generated SQL query for all the query operations based on the resolver context (for example, something like, where(user_id =…
Faizuddin Mohammed
  • 4,118
  • 5
  • 27
  • 51
1
vote
1 answer

How to add Cors to PostGraphile

I am trying to add cors to my PostGraphile route in an express server. app.use( postgraphile(process.env.DATABASE_URL || process.env.POSTGRES, ‘public’, { watchPg: true, graphiql: true, enhanceGraphiql: true, enableCors: true, …
1
vote
0 answers

Disabling Postgraphile automatically generated mutations?

Taken from postgraphile documentation PostGraphile automatically generates CRUD Mutations for you; but it's rare that these will cover all your needs - and many people just disable them outright. Is there any drawbacks or concerns of using…
Kevin Amiranoff
  • 13,440
  • 11
  • 59
  • 90
1
vote
2 answers

Postgres RLS Policy and functions

I have a RLS policy violation on a Postgres function. I believe it's because the policy relies on rows created in the function. A SELECT command is run in the function. New rows are not available because they are still in a transaction. Here is the…
steve76
  • 302
  • 2
  • 9
1
vote
1 answer

In Postgraphile How Do I Update/Delete a JOIN Table?

I am using Postgraphile (with the many-to-many plugin) with three tables: foos, bars, and foo_bars. foo_bars is a simple join table with foo_id and bar_id columns, which have foreign key constraints to the corresponding table. When I look at…
machineghost
  • 33,529
  • 30
  • 159
  • 234
1
vote
1 answer

In Postgraphile, use permissions on many-to-many relationships

How would one go about defining extended permissions and authorization on a many-to-many relationship using Postgraphile? Imagine I have this many-to-many relationship (graciously borrowed from official docs and adjusted with simplified…
Cameron
  • 1,524
  • 11
  • 21