Commit Graph

278 Commits

Author SHA1 Message Date
Sameer Kolhar
ffd5e57666 console: update set_table_custom_fields to use set_table_customization API
#### Changelog - (have added an entry)

#### PR Description

This PR resolves https://github.com/hasura/graphql-engine/issues/6284.

 - Updates the API being used as the issue requires.
 - Places a check to raise an error whenever the user tries to save the custom_fields without _any_ input (it was possible in the previous versions of the console)

 - Updated form (picture)

<img width="745" alt="image" src="https://user-images.githubusercontent.com/6604943/103933740-d866a480-5149-11eb-90b2-e1c1c4559902.png">

Co-authored-by: Aleksandra Sikora <9019397+beerose@users.noreply.github.com>
GitOrigin-RevId: df3127c3c58b5ecf2d6ab79cb95610a96592ca12
2021-01-11 21:59:10 +00:00
Karthikeyan Chinnakonda
44347d2d74 server: template the schema and table names in the event trigger PG functions
Earlier, while creating the event trigger's internal postgres trigger, we used to get the name of the table from the `TG_TABLE_NAME` special trigger variable. Using this with normal tables works fine, but it breaks when the parent table is partitioned because we associate the ET configuration in the schema only with the original table (as it should be).

In this PR, we supply the table name and schema name through template variables instead of using `TG_TABLE_NAME` and `TG_TABLE_SCHEMA`, so that event triggers work with a partitioned table as well.

TODO:

- [x] Changelog
- [x] unit test (ET on partition table)

GitOrigin-RevId: 556376881a85525300dcf64da0611ee9ad387eb0
2021-01-06 20:22:34 +00:00
Karthikeyan Chinnakonda
8a7e749a69 server: fix issue when a non-nullable remote schema field was added as nullable (#279)
GitOrigin-RevId: cf6df889d93bc2e4da47e4fbc6c112be99de977a
2021-01-05 14:47:52 +00:00
Karthikeyan Chinnakonda
ef33a61266 server: fix handling of empty array values in relationships of set_custom_types API (#219)
* server: fix handling of empty array values in relationships of set_custom_types

* add a test for dropping the relationship

GitOrigin-RevId: abff138b0021647a1cb6c6c041c2ba53c1ff9b77
2020-12-24 10:11:58 +00:00
hasura-bot
a18cd6b1bc cli: fix action timeout not being picked up in metadata operations (close #6220)
GITHUB_PR_NUMBER: 6354
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6354

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 9869712d496d8e0733f9b25d44962e9a978ebc24
2020-12-24 05:07:26 +00:00
Aleksandra Sikora
f0799b47a4 console: misc fixes (close #4785, #6330, #6288, #6374) (#227)
GitOrigin-RevId: 420fd0a949ec1c58f2d6954a74a693be5e3d7214
2020-12-22 14:18:58 +00:00
Auke Booij
4bbd2fd4dc server: allow fragments to use variables (fix hasura/graphql-engine#6303) (#225)
GitOrigin-RevId: a60b6816212b749836d5d88f296e229e581ab452
2020-12-22 10:42:34 +00:00
Phil Freeman
2dfbf99b41 server: simplify shutdown logic, improve resource management (#218) (#195)
* Remove unused ExitCode constructors

* Simplify shutdown logic

* Update server/src-lib/Hasura/App.hs

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* WIP: fix zombie thread issue

* Use forkCodensity for the schema sync thread

* Use forkCodensity for the oauthTokenUpdateWorker

* Use forkCodensity for the schema update processor thread

* Add deprecation notice

* Logger threads use Codensity

* Add the MonadFix instance for Codensity to get log-sender thread logs

* Move outIdleGC out to the top level, WIP

* Update forkImmortal fuction for more logging info

* add back the idle GC to Pro

* setupAuth

* use ImmortalThreadLog

* Fix tests

* Add another finally block

* loud warnings

* Change log level

* hlint

* Finalize the logger in the correct place

* Add ManagedT

* Update server/src-lib/Hasura/Server/Auth.hs

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Comments etc.

Co-authored-by: Brandon Simmons <brandon@hasura.io>
Co-authored-by: Naveen Naidu <naveennaidu479@gmail.com>
GitOrigin-RevId: 156065c5c3ace0e13d1997daef6921cc2e9f641c
2020-12-21 18:56:57 +00:00
Karthikeyan Chinnakonda
39a4352569 Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions
server: remote schema permissions
GitOrigin-RevId: 63b9717e30351676c9474bdfddd3ad1ee1409eea
2020-12-21 09:12:35 +00:00
Auke Booij
be7f34891c server: give stack traces when encountering conflicting type definitions (#150)
Since PDV, introspection queries are parsed by a certain kind of reflection where during the GraphQL schema generation, we collect all GraphQL types used during schema generation to generate answers to introspection queries. This has a great advantage, namely that we don't need to keep track of which types are being used in our schema, as this information is extracted after the fact.

But what happens when we encounter two types with the same name in the GraphQL schema? Well, they better be the same, otherwise we likely made a programming error. So what do we do when we *do* encounter a conflict? So far, we've been throwing a rather generic error message, namely `found conflicting definitions for <typename> when collecting types from the schema`. It does not specify what the conflict is, or how it arose. In fact, I'm a little bit hesitant to output more information about what the conflict is, because we support many different kinds of GraphQL types, and these can have disagreements in many different ways. It'd be a bit tiring (not to mention error-prone) to spell this out explicitly for all types. And, in any case, at the moment our equality checks for types is incorrect anyway, as we are avoiding implementing a certain recursive equality checking algorithm.

As it turns out, type conflicts arise not just due to programming errors, but also arise naturally under certain configurations. @codingkarthik encountered an interesting case recently where adding a specific remote and a single unrelated database table would result in a conflict in our Relay schema. It was not readily visible how this conflict arose: this took significant engineering effort.

This adds stack traces to type collection, so that we can inform the user where the type conflict is taking place. The origin of the above conflict can easily be spotted using this PR. Here's a sample error message:

```
Found conflicting definitions for "PageInfo". The definition at "mutation_root.UpdateUser.favourites.anime.edges.node.characters.pageInfo" differs from the the definition at "query_root.test_connection.pageInfo"
```

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: d4c01c243022d8570b3c057b168a61c3033244ff
2020-12-04 15:37:55 +00:00
hasura-bot
3451413d1a server: do not block catalog migration on inconsistent metadata (#139)
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6286
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6286

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
GitOrigin-RevId: 27bbfc960da87e4ad54bad5943782f28aa113874
2020-12-04 08:39:05 +00:00
hasura-bot
f6bd354b40 server: hasura on PG v13 (#125)
GitOrigin-RevId: 00fd91c250bcf3dc7ee638e3b152e0dab7281de7
2020-12-01 12:22:42 +00:00
hasura-bot
7b31ff99d1 Support Postgres POSIX regex operators (close #4317) (#119)
Co-authored-by: christophediprima <dipdipdip84@gmail.com>
Co-authored-by: dip <dipdipdip84@gmail.com>
Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GITHUB_PR_NUMBER: 6172
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6172
GitOrigin-RevId: 5192d238b527cd21b6efb2f74e279ecc34756c29
2020-11-27 10:54:52 +00:00
hasura-bot
862f160ee6 console: select first operator by default on the browse rows screen (close #5729) (#93)
Co-authored-by: Dmitrii Grachikov <dgrachikov@gmail.com>
Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io>
GITHUB_PR_NUMBER: 6032
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6032

Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io>
Co-authored-by: Dmitrii Grachikov <dgrachikov@gmail.com>
GitOrigin-RevId: 44c2f5f082e3bd854a72abf56ca665bc1b213160
2020-11-24 16:17:57 +00:00
hasura-bot
5ca8cd23a0 server: support remote relationship with ID scalar types (#92)
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6227
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6227

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GitOrigin-RevId: 666ec37d570e46482e0f27db2c97c9e3f9c1f4d3
2020-11-24 12:20:22 +00:00
hasura-bot
fb902d4209 Support tracking SQL functions as mutations. Closes #1514 (#34)
* Support tracking SQL functions as mutations. Closes #1514

Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GITHUB_PR_NUMBER: 6160
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6160

* Update docs/graphql/core/api-reference/schema-metadata-api/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Brandon Simmons <brandon@hasura.io>
Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Marion Schleifer <marion@hasura.io>
GitOrigin-RevId: 8fd39258641ecace6e3e9930e497b1655ad35080
2020-11-18 18:05:59 +00:00
hasura-bot
8eebcb9bdf server: query remote server in a remote join query iff all arguments are not null (#31)
* server: query remote server in a remote join query iff all arguments are not null

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6199
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6199

* Update server/src-lib/Hasura/Backends/Postgres/Execute/RemoteJoin.hs

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Apply suggestions from code review

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Update server/tests-py/test_remote_relationships.py

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Apply suggestions from code review

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* use guard instead of case match

* add comment about the remote relationship joining

* add a comment about the design discussion

* update CHANGELOG

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GitOrigin-RevId: ce7e8288d37ad7c32705f96cb6363f6ad68f3c0a
2020-11-18 09:00:12 +00:00
Tirumarai Selvan A
320835a6f2 update changelog
GitOrigin-RevId: 693f0d573f8f60423d25e52cfcc4511dbbf829fc
2020-11-17 15:05:52 +00:00
Karthikeyan Chinnakonda
e2d07bb507 console/docs: add support for computed fields for views (close #6168)
Co-authored-by: rikinsk <rikin@hasura.io>
Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6174
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6174
GitOrigin-RevId: d03d9863251aaab696d34bf3672afa9decd7a5bc
2020-11-12 20:43:49 +00:00
Vishnu Bharathi P
58c44f55dd Merge oss/master onto mono/main
GitOrigin-RevId: 1c8c4d60e033c8a0bc8b2beed24c5bceb7d4bcc8
2020-11-12 22:37:19 +05:30
Vishnu Bharathi P
666058ab7f oss: renames dot files and folders
GitOrigin-RevId: 540aeec3be091e1cfb7b05a988f50445534ed663
2020-11-12 22:37:19 +05:30
Alexis King
6787a1b1b0
Fix the way replace_metadata drops event triggers (fix #5461) (#6137)
https://github.com/hasura/graphql-engine/pull/6137
2020-11-10 12:02:38 +00:00
Aravind K P
4e4e3f3fd3
cli (cli-migrations image): fix problems running cli-migrations-v2 image as a non root user (close #4651 close #5333) (#5306)
https://github.com/hasura/graphql-engine/pull/5306
2020-11-06 14:09:53 +00:00
Aravind K P
01c4cd2ff3
cli: do not clear metadata during metadata apply (close #6115) (#6119)
https://github.com/hasura/graphql-engine/pull/6119
2020-11-06 08:51:10 +00:00
Sasha Bogicevic
81e836a12c
server: configurable websocket keep alive interval (#6092)
Accept new server flag --websocket-keepalive to control
websockets keep-alive interval

Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-03 18:04:48 +01:00
Marion Schleifer
25892ac70c
docs: add guides to connect to cloud dbs (#5948)
https://github.com/hasura/graphql-engine/pull/5948
2020-11-02 12:20:04 +00:00
GavinRay97
b869e9c086
Add metadata types and generator lib to repo (#5452)
https://github.com/hasura/graphql-engine/pull/5452
2020-10-30 14:52:55 +00:00
Karthikeyan Chinnakonda
2cb08a89cb
server: customize tracking tables with a custom name (#5719)
https://github.com/hasura/graphql-engine/pull/5719
2020-10-29 12:48:45 +00:00
Karthikeyan Chinnakonda
562b6ac43a
Server: support remote relationships to unions, interfaces and enum types (#6080)
* add support for joining to remote interface and union fields

* add test for making a remote relationship with an Union type

* add CHANGELOG

* remove the pretty-simple library

* remove unused imports from Remote.hs

* Apply suggestions from code review

Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>

* support remote relationships against enum fields as well

* update CHANGELOG

Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-29 17:00:19 +05:30
Karthikeyan Chinnakonda
c63801b573
server: fix bug when renaming table with manual relationships (#5806)
https://github.com/hasura/graphql-engine/pull/5806
2020-10-28 10:21:53 +00:00
Alexis King
bf466e3b63
server: Fix fine-grained incremental cache invalidation (fix #3759) (#6027)
This issue was very tricky to track down, but fortunately easy to fix.
The interaction here is subtle enough that it’s difficult to put into
English what would go wrong in what circumstances, but the new unit test
captures precisely that interaction to ensure it remains fixed.
2020-10-27 14:52:19 -05:00
Sameer Kolhar
b72fc6922a
server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) (#5945)
https://github.com/hasura/graphql-engine/pull/5945
2020-10-22 13:26:42 +00:00
Sooraj
6299d1c278
console: down migrations improvements (close #3503, #4988) (#4790) 2020-10-14 13:27:32 +05:30
Marion Schleifer
ca3ebddc33
docs: console / cli / api workflows (close #3593) (#4948)
https://github.com/hasura/graphql-engine/pull/4948
2020-10-13 11:07:46 +00:00
Karthikeyan Chinnakonda
3ea611f9fd
Server: Validate remote schema queries (#5938)
* [skip ci] use the args while making the fieldParser

* modify the execution part of the remote queries

* parse union queries deeply

* add test for remote schema field validation

* add tests for validating remote query arguments


Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-13 14:03:11 +05:30
gahag
19b4f55ca1
server: implement websocket compression setting (fixes #3292) (#5928)
https://github.com/hasura/graphql-engine/pull/5928
2020-10-12 09:14:23 +00:00
Auke Booij
84a129c8e4
server: heterogeneous execution of GraphQL queries (#5869)
https://github.com/hasura/graphql-engine/pull/5869
2020-10-07 10:23:17 +00:00
Ahmed Kamal
d3abb474e5
cli: change 'hasura seeds' to 'hasura seed' with 'seeds' as alias (#5693)
https://github.com/hasura/graphql-engine/pull/5693
2020-10-07 09:26:30 +00:00
Marion Schleifer
048daf81d1
docs: add postgres reference section to docs (close #4440) (#4471)
https://github.com/hasura/graphql-engine/pull/4471
2020-10-06 16:04:58 +00:00
Sameer Kolhar
af32ccff36
server: limit length of event trigger names (close #5786) (#5826)
https://github.com/hasura/graphql-engine/pull/5826
2020-10-06 15:22:09 +00:00
Sameer Kolhar
9cb44fa61e
console: add notifications (#5070) 2020-10-05 14:31:10 +05:30
Sameer Kolhar
18e4c103ad
console: add option to flag an insertion as a migration (close #1766) (#4993)
https://github.com/hasura/graphql-engine/pull/4993
2020-09-29 17:15:39 +00:00
jasvithaM
92b3342ba9
console: remove ONLY as default for ALTER TABLE in column alter operations (close #5512) (#5706)
https://github.com/hasura/graphql-engine/pull/5706
2020-09-28 19:54:39 +00:00
Sameer Kolhar
10f41e7559
server: accept only non-negative integers for batch size and refetch interval (close #5653) (#5759)
https://github.com/hasura/graphql-engine/pull/5759
2020-09-17 10:56:41 +00:00
Karthikeyan Chinnakonda
9d047d1726
server: add custom timeouts to actions (#5762)
https://github.com/hasura/graphql-engine/pull/5762
2020-09-16 09:53:17 +00:00
Karthikeyan Chinnakonda
6eb7a7dd8a Merge branch 'master' into scheduled-triggers-created-at-bug-5272 2020-09-16 03:33:41 +05:30
Karthikeyan Chinnakonda
92ef504c9e
Server: add URL templating for event triggers and remote schemas (#5760)
* add url templating for event triggers


Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
2020-09-10 15:00:34 +05:30
Karthikeyan Chinnakonda
557aeabacc
Merge branch 'master' into scheduled-triggers-created-at-bug-5272 2020-09-09 13:20:32 +05:30
Tirumarai Selvan
bbc27437d8
v1.3.2 assets (#5752) 2020-09-09 13:19:32 +05:30
Karthikeyan Chinnakonda
c9a519c16d update changelog 2020-09-08 12:26:41 +05:30