Commit Graph

1681 Commits

Author SHA1 Message Date
Toan Nguyen
15c0ebf1ef
allow special characters in json path's property name (close #3890) (#3892)
* allow underscore prefix and special characters in json path

* server: Rewrite/refactor JSONPath parser

The JSONPath parser is also rewritten, the previous implementation
was written in a very explicitly “recursive descent” style, but the whole
point of using attoparsec is to be able to backtrack! Taking advantage
of the combinators makes for a much simpler parser.

Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
Co-authored-by: Shahidh K Muhammed <shahidh@hasura.io>
2020-04-20 14:25:09 +05:30
Rishichandra Wawhal
3603af19d0
docs: update sample action handler URLs (#4450) 2020-04-20 11:48:00 +05:30
Rikin Kachhia
3c9d1f2330
ci: skip server tests in PRs if there are no server changes (#4412) 2020-04-17 13:18:40 -05:00
ShahAnuj2610
bf719cbf34
console: surround string type column default value with quotes (close #4371) (#4423) 2020-04-17 21:32:13 +05:30
Auke Booij
b2d65d16d3
server: _inc for non-integer numeric types (fix #3573) (#4429)
* Allow `_inc` to update other numeric types in addition to integers

* Add support for PostgreSQL's `money` field type

* Add support for _inc on money types

* Add note of generalized `_inc` support to changelog
2020-04-17 11:32:09 +02:00
Shahidh K Muhammed
da3220f3fa
tag release v1.2.0-beta.4 (#4428)
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-17 13:05:18 +05:30
Aleksandra Sikora
550de3e8a0
console: add possible undefined check (#4445) 2020-04-17 11:58:47 +05:30
Marion Schleifer
6b2d525dd6
docs: fix bug in query actions docs (#4434) 2020-04-16 19:30:03 +05:30
Tirumarai Selvan
c0a51d5d05
small fixes (#4430) 2020-04-16 16:39:01 +05:30
Rishichandra Wawhal
8a5cc73ae6
cli, console: actions dx improvements (close #4306, #4311) (#4308) 2020-04-16 13:40:47 +05:30
Karthikeyan Chinnakonda
5116e16e18
server(actions): add support for queries (close #4032) (#4309)
* add support for action queries

* a new parameter `type` is added in the ArgumentDefinition, its value
  can be either `query` or `mutation` and it defaults to the latter

* throw 400 when a query action is tried to explain

* update the actions docs to include query actions

* refactor the ToJSON and ToOrdJSON of ActionDefinition

Co-authored-by: Rishichandra Wawhal <rishi@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-16 12:55:19 +05:30
Karthikeyan Chinnakonda
a26bc80496
accept a new argument claims_namespace_path in JWT config (#4365)
* add new optional field `claims_namespace_path` in JWT config

* return value when empty array is found in executeJSONPath

* update the docs related to claims_namespace_path

* improve encodeJSONPath, add property tests for parseJSONPath

* throw error if both claims_namespace_path and claims_namespace are set

* refactor the Data.Parser.JsonPath to Data.Parser.JSONPathSpec

* update the JWT docs

Co-Authored-By: Marion Schleifer <marion@hasura.io>

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com>
2020-04-16 12:15:21 +05:30
Sitian Liu
2aa971ae83
community: fix typo in event trigger doc (#4426) 2020-04-16 06:57:58 +05:30
Aravind Shankar
5081a2969f
cli: update makefile to set plugins branch ref (#4421) 2020-04-16 06:54:50 +05:30
Auke Booij
dbf0c43ca8
server: Avoid duplicated test runs (#4420)
This avoids re-running tests when a parameterized test is specified
that doesn't actually depend on its parameter.
2020-04-15 11:13:53 -05:00
Aleksandra Sikora
72b2301bc0
console: persist page size in data browser (#4323) 2020-04-15 20:38:37 +05:30
Aravind
f073243283
cli: add hasura-collaborator-token and hasura-client-name to allowed headers (#4414) 2020-04-15 19:08:31 +05:30
Rakesh Emmadi
dc31b835e1
allow reusing Postgres scalars in custom types & actions (close #4125) (#4333)
* allow re-using Postgres scalars in custom types, close #4125

* add pytest tests

* update CHANGELOG.md

* add a doc pointer for reusable postgres scalars

* document the code, improve the CHANGELOG entry

As suggested by @lexi-lambda

* a bit more source code documentation, use WriterT to collect reused scalars

* Apply suggestions from code review

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* improve doc for Postgres scalars in custom graphql types

* Add some more references to Note; fix Haddock syntax

Also a few very minor tweaks:
  * Use HashSet instead of [] more pervasively
  * Export execWriterT from Hasura.Prelude
  * Use pattern guards in multi-way if
  * Tweak a few names/comments

* Pull buildActions out of buildAndCollectInfo, use buildInfoMap

* Tweak wording in documentation

* incorporate changes in console code

* account Postgres scalars for action input arguments

-> Avoid unnecessary 'throw500' in making action schema

* Review changes

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
2020-04-15 17:33:13 +05:30
Ali Oğuzhan Yıldız
dfc1f98e61
console: convert theme files to typescript (#4325) 2020-04-15 13:49:52 +05:30
Aravind Shankar
1ada6627b0
ci: add tests for cli-migrations image (#4396)
- Created new job test_and_build_cli_migrations which runs after test_and_build_cli
- Build the cli-migrations and cli-migrations-v2 and save the images as tar image.
- Run the test defined in each workflow v1 and v2.
- Load the image that was built earlier in deploy step
2020-04-15 07:26:00 +05:30
Aravind Shankar
21a4dff993
cli(squash): add set_table_is_enum metadata type (close #4394) (#4395) 2020-04-14 16:39:41 +05:30
Karthikeyan Chinnakonda
a23c633bd7
unlock inflight events when gracefully shutdown (close #3548) (#4214)
* unlock the locked-events during graceful shutdown

* Some events can still be delivered multiple times due to
  ungraceful shutdown

* modify the preparevents documentation

* modify the prepareEvents doc

* update changelog

Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-14 11:31:50 +05:30
Shraddha Agrawal
a1796c2c9f
cli: update docs to remove realize specific instructions (#4398) 2020-04-14 08:42:53 +05:30
ShahAnuj2610
cba85cd4a8
console: redirect to /:table/browse from /:table (close #4330) (#4374) 2020-04-13 19:52:32 +05:30
Rishichandra Wawhal
61d58906e7
console: recover from SDL parse in actions type definition editor (fix #4385) (#4389) 2020-04-13 18:22:07 +05:30
Rishichandra Wawhal
9b66724b41
console, cli, cli-ext: query support for actions (close #4032) (#4318)
Co-authored-by: Aravind Shankar <aravind@hasura.io>
2020-04-13 15:51:53 +05:30
Aravind Shankar
491a50b1e9
cli: link cli-ext plugin with cli version (close #4105) (#4280) 2020-04-13 08:46:06 +05:30
Tirumarai Selvan
76fbe90b60
type is not required for jwk_url in JWT config (#4334)
* type is not required for jwk_url

* remove type from JWTConfig

* Omit type field in JWTConfig serialization if jwk_url is provided

* remove type from jwk_url test suite

* add changelog

* fix docs with new format

Co-authored-by: Alexis King <lexi.lambda@gmail.com>
2020-04-10 19:25:59 +05:30
Brandon Simmons
8b85c86ebe Fix erroneous error logging in WebSocket.onStop 2020-04-10 12:55:43 +05:30
Brandon Simmons
1fbf647c0d dev.sh: generate coverage report after dev.sh graphql-engine exit 2020-04-10 12:55:43 +05:30
Aravind Shankar
029c77416f
ci: fix cli-migrations-v2 build process (#4273) 2020-04-10 08:25:14 +05:30
Aravind Shankar
53e4f994d2
cli: event trigger retry_conf support to squash (close #4296) (#4324) 2020-04-10 08:22:41 +05:30
Alexis King
4698f054e0
gh: make all hge-server team members code owners (#4361) 2020-04-10 07:30:40 +05:30
nizar-m
0e666a9203
Fix catalog version for v1.1.1 (close #4354) (#4355)
* Fix catalog version for v1.1.1

* Remove entries of removed tables from hdb_catalog

While downgrading catalog version from 32 -> 31, not removing entries
in hdb_table and hdb_relationship for the tables that are removed in
the downgrade, results in incosistent schema, when the server with
downgraded version is started. This should probably be handled in
a better fashion.

With the change in this commit, the server is able to successfully
start with downgraded catalog version 31.

* Test downgrade command along with upgrade tests
2020-04-09 19:57:59 -05:00
Rikin Kachhia
c08171ac89
console: set coookie policy for API calls to same-origin (#4336) 2020-04-09 16:03:29 +05:30
Aravind
14b5d10dfb
cli: refactor ec to allow setting hge api headers (#4347) 2020-04-09 15:00:47 +05:30
Aravind
e1b0562fd8
cli: clarify flags on migrate create (#4316) 2020-04-09 14:35:05 +05:30
Tirumarai Selvan
ca15ef8c96
Refactor initialisation and relax tx isolation levels where possible (#3901)
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
2020-04-09 02:41:24 -05:00
Tirumarai Selvan
ebb3bb3910
unlock event if event trigger info is not found in cache (#4213)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
2020-04-09 12:03:33 +05:30
Aravind Shankar
995e198d0a
cli: show env vars for the flags in command help (close #4263) (#4326) 2020-04-08 17:25:42 +05:30
Aravind Shankar
21b61af109
cli: allow customization of server api paths (close #4016) (#4174) 2020-04-08 16:29:21 +05:30
Francisco Sales
b02cd336d0
server: Don’t expose DB implementation in error message (#4294) 2020-04-08 02:36:56 -05:00
Anon Ray
b948e26751
server: Add a Haskell style guide (#2175)
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
2020-04-08 02:31:30 -05:00
Aravind Shankar
325771e406
cli: remove migration files if api returns error (close #4312) (#4319)
When using console from CLI and a migration is created, the files are written first and an API call is made to Hasura to execute that migration. There was a bug which caused this file to remain when the API call to Hasura failed. This commit fixes the bug by deleting the files if Hasura API call fails and propagates the error to console.
2020-04-08 10:54:47 +05:30
Aravind Shankar
d5e61716f8
cli: add support for multiple versions of plugin (close #4105) (#4135) 2020-04-07 19:42:14 +05:30
Aravind Shankar
d0870a85f8
cli: update makefile to include pkger (#4320) 2020-04-07 18:35:00 +05:30
Aleksandra Sikora
f615efd37d
console: decouple row fetch and count queries in data browser (close #3793) (#4269) 2020-04-07 16:47:13 +05:30
Aravind
de41438e8a
cli: refactor console command (#4150) 2020-04-07 14:53:20 +05:30
Tirumarai Selvan
24c072939b
docs: add json path example in query docs (#4087) 2020-04-07 12:46:10 +05:30
Aleksandra Sikora
b1f8b656a7
console: set allow-js compiler flag for type checker (#4290) 2020-04-06 20:19:35 +05:30