1
0
mirror of https://github.com/hasura/graphql-engine.git synced 2024-12-22 15:01:39 +03:00
Commit Graph

736 Commits

Author SHA1 Message Date
Rakesh Emmadi
8df23ad6c9 use postgres IN experssion for _in operator (fix ) () 2018-11-26 15:39:55 +05:30
Anon Ray
512ee6fb9f adds basic support for remote schemas/schema stitching () 2018-11-23 18:32:46 +05:30
Rakesh Emmadi
58fe579497 support Postgres's DISTINCT ON (close ) () 2018-11-23 07:23:56 +05:30
Rakesh Emmadi
030f094de9 handle empty array for _in and _nin operators, fix () 2018-11-21 12:28:29 +05:30
Vamshi Surabhi
47dcae1614
fix sql generation for boolean expressions, closes ()
When using self referential relationships in boolean expressions, the exists clause incorrectly uses the table names to qualify columns which will be the same for parent table and the child table. This is now fixed by generating unique aliases as we traverse down the relationships.
2018-11-16 18:10:23 +05:30
Rakesh Emmadi
b719e82e89 add statistical aggregate operations and count on columns (close ) () 2018-11-14 18:29:59 +05:30
Tirumarai Selvan
317efb81f1 event triggers: take webhook url from env (close ) () 2018-11-14 12:43:01 +05:30
Rakesh Emmadi
80de0e019a do not generate prefix for column identifiers in agg select, fix () 2018-11-12 12:58:46 +05:30
Abhinav Srivastava
c776cd84a6 update multiple files () 2018-11-08 12:02:57 +05:30
Rakesh Emmadi
999580481c allow specifying a list of columns that can be inserted (close ) () 2018-11-02 20:38:38 +05:30
Rakesh Emmadi
0e9d6994ac refactor nested insert mutation and fix returning (fix ) ()
* improved nested insert execution logic

* integrate error path, improve executing 'withExp' and improve tests

* add more readable types in '/Resolve/Insert.hs'

* set conflict context just before executing WITH expression
2018-11-02 19:31:01 +05:30
Rakesh Emmadi
1a91399298 extract session variables from relational bool expression (fix ) () 2018-11-02 15:06:33 +05:30
Mohammed Rishad
58ccddc76e pep8 fixes for python files () 2018-10-30 14:51:58 +05:30
nizar-m
4f091e5e5b gitignore generated .tix files in pytest folder () 2018-10-29 19:55:37 +05:30
nizar-m
0ffb0478b9 Tests for server with access control, and some more tests ()
* 1) Tests for creating permissions
2) Test for constraint_on with GraphQL insert on_conflict

* Run tests with access key and webhook

* Tests for GraphQL query with quoted columns

* Rewrite test-server.sh so that it can be run locally

* JWT based tests

* Tests with various postgres types

* For tests on select queries, run setup only once per class

* Tests for v1 count queries

* Skip teardown for tests that does not modify data

* Workaround for hpc 'parse error when reading .tix file'

* Move GeoJson tests to the new structure

* Basic tests for v1 queries

* Tests for column, table or operator not found error cases on GraphQL queries

* Skip test teardown for mutation tests which does not change database state, even when it returns 200.
2018-10-28 23:57:49 +05:30
Rakesh Emmadi
fb842fde6f optional 'set' field in insert permissions, closes () 2018-10-26 20:28:20 +05:30
Rakesh Emmadi
f6ed169219 allow ordering using columns from object relationships (closes ) ()
* allow ordering using columns from object relationships, close 

* validate table fields in nested insert

* add tests

* add docs

* change 'table_order_by' type from enums to ordered map

* remove unwanted code from 'Schema.hs' file

* 'AnnGObject' is not list of field name and value tuple

* update docs for new order_by type

* use 'InsOrdHashMap' for 'AnnGObj'

* handle empty fields in order_by

* remove '_' prefixes for asc/desc

* fix the changed order_by syntax across the repo
2018-10-26 17:27:33 +05:30
Rakesh Emmadi
a8cee16ab5 support aggregations (closes ) ()
* support for count and aggregations on columns, close 

* support explain query for aggregations

* '<arr-rel>_agg' in '<table>' type, fix order by for aggregations

* add 'allow_aggregations' key in select permissions

* Add checkbox to toggle count and aggregations on columns on select permission

* align aggregation checkbox with columns div

* improve readability of the generated sql

* alias is needed at the top level aggregation

* throw internal errors for unexpected fields

* rename SelFld to more readable TableAggFld

* rename agg to aggregate
2018-10-26 14:32:43 +05:30
Tirumarai Selvan
810b440089 trigger webhooks on column level changes instead of row (close , close ) () 2018-10-25 12:52:51 +05:30
nizar-m
cd030068c2 GeoJSON: Fix MultiPolygon parse error (closes ) 2018-10-24 13:51:37 +05:30
Rakesh Emmadi
45691e3509 for views consider only insertable ones in generating nested insert input objects (fix ) () 2018-10-16 15:55:41 +05:30
Rakesh Emmadi
37e848ccca fix input object validation logic (fix ) () 2018-10-12 16:06:47 +05:30
Vamshi Surabhi
ecf8c760ec workaround postgres default limit of 63 chars for identifiers (close ) () 2018-10-12 14:58:43 +05:30
Rakesh Emmadi
00d5a5c1a3 insert mutations can now handle nested-data/relationsips (close ) () 2018-10-05 20:43:51 +05:30
Vamshi Surabhi
32ae105279 improved sql generation for select queries (closes , , ) ()
Better SQL generation for select queries (the query plans will be the same but much more readable). This closes some long standing issues (, , ).
2018-10-05 14:26:47 +05:30
Rakesh Emmadi
91376316f2 breaking: encode bigint and bigserial postgres types as strings in response (fix ) ()
This is breaking change where bigint and bigserial Postgres types will be encoded as GraphQL String types, as opposed to Int as present in earlier releases.

Input types were already encoded as String.

This is achieved by selecting `bigint` and `bigserial` columns as `text`s in the SQL query: `select "big_id"::text ..` instead of `select "big_id" .. `.

Reason for that change is outlined in  where JavaScript cannot decode 64 bit Integers.
2018-10-05 10:46:21 +05:30
nizar-m
596bccde49 add python based tests, remove haskell tests
this does not generate coverage report yet
2018-10-04 18:14:15 +05:30
Rakesh Emmadi
fc7ea9213c fix non-admin insert returns null column values when query affects zero rows in postgres (fix ) ()
Insert trigger function: If query affects no rows then return `null`

Insert trigger function is modified to have 
 `IF r IS NULL THEN RETURN null; ELSE RETURN r; END IF;` in return statement.
2018-09-29 11:12:47 +05:30
Tirumarai Selvan
2cd2b23b2d add custom headers for webhooks, refactor retry logic () 2018-09-24 17:20:11 +05:30
Rakesh Emmadi
8f6b19d6f1 quote constraint name for non-admin inserts (fix ) ()
### Description
What component does this PR affect? 

- [x] Server
### Related Issue
 

### Solution and Design
Use `quote_ident()` SQL function over `constraint_name` in insert trigger function definition.

### Type
- [x] Bug fix (non-breaking change which fixes an issue)
2018-09-20 20:54:20 +05:30
Aravind Shankar
729b56dd20 live queries tests for subscription () 2018-09-20 07:16:03 +05:30
Tirumarai Selvan
c42af444f7 implement query to update an event trigger () 2018-09-19 17:42:57 +05:30
Rakesh Emmadi
ec516ce55b allow _is_null operator for filter/check permissions (close ) () 2018-09-18 17:15:35 +05:30
nizar-m
cde559fe58 dont set non-null constraint for manual object relationships (close ) 2018-09-18 17:01:16 +05:30
Vamshi Surabhi
85df9ac1e8 payload is now optional in connection_init message (close ) () 2018-09-18 13:13:30 +05:30
Vamshi Surabhi
534f23d1a6 python based tests () 2018-09-18 11:51:57 +05:30