Commit Graph

343 Commits

Author SHA1 Message Date
Gil Mizrahi
352d8ff09c validate logical models custom return type against postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8563
GitOrigin-RevId: 462a608e0e90d1923bc1d735257f4506825f5db1
2023-04-04 14:02:59 +00:00
Daniel Harvey
9c99bcb6f8 chore(server): move perms to custom return types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8604
GitOrigin-RevId: ff024429b3f06e4867334665f35d4bd404a85cba
2023-04-04 12:46:51 +00:00
Daniel Harvey
cb9f822fc0 chore(server): move user-defined-functions into Hasura.Function.*
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8595
GitOrigin-RevId: b3b7dec8504fe4daf324125e4017fa7d1945b3ca
2023-04-03 10:20:20 +00:00
Tom Harding
7e06b30e4d Add metadata commands for custom return type permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8587
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 660f2eda9cf1c7c612d66745064b3998c77804e0
2023-03-31 16:29:24 +00:00
Daniel Harvey
79682e0598 chore(server): move custom types out of logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8565
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 38bf56cc420a6c818a9ca7d6f846f5018535c808
2023-03-31 15:35:13 +00:00
Jesse Hallett
bd9f93eaef server: codecs for backend configs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8269
GitOrigin-RevId: 34330f383ca82fb159842a171a763c178b462788
2023-03-30 15:53:55 +00:00
Daniel Harvey
7227e96278 feature(server): custom return types as discreet metadata entity
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8556
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: b7dcbcf378279c3bf4c8d223174b90c2cb4b9e53
2023-03-30 15:15:11 +00:00
Daniel Chambers
e9c697aaa9 Fix "limit" from permissions being incorrectly applied to aggregates in Data Connectors
[GDC-1064]: https://hasurahq.atlassian.net/browse/GDC-1064?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8345
GitOrigin-RevId: 9ef91944ba6408e1030a47de58f3271145433ee2
2023-03-20 04:02:23 +00:00
Jesse Hallett
1ad37eff31 server: codecs for network config, graphql introspection
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8132
GitOrigin-RevId: 6b800f35a76b6d38817862a4678644b8bf230a95
2023-03-17 17:46:16 +00:00
Gil Mizrahi
021e769235 Logical models: check that specified named columns are returned from query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8312
GitOrigin-RevId: fc7c7a14115c0b228abc2f48d3cfac51d2852277
2023-03-16 10:45:46 +00:00
paritosh-08
91552a1a05 server: move apollo-federation to GA
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8163
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: d971720e79d5e08d1e68b31f7475c0eb6f06cac8
2023-03-15 08:15:51 +00:00
Jesse Hallett
17a96a0fc6 server: codecs for open telemetry configuration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8317
GitOrigin-RevId: 36dbe374164712167d7a4a31ea0509850060df36
2023-03-15 02:19:51 +00:00
Jesse Hallett
583e59fbe2 server: codecs for api limits
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8065
GitOrigin-RevId: 4a14f72fa4f832f1cc6cb7f5be8d146b4f00dd44
2023-03-15 01:38:52 +00:00
paritosh-08
b36971f637 server: webhook auth token caching
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7925
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: eae1f4023a9e9144c9eb230529c214cb4327e44f
2023-03-14 18:28:56 +00:00
Philip Lykke Carlsen
1bad75e3d8 feat(logical models): Add validation of types and parameters
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8267
GitOrigin-RevId: 827852edf074eb72c95ac379fe3ac5d095fd26ab
2023-03-13 18:15:27 +00:00
Antoine Leblanc
cf531b05cb Rewrite Tracing to allow for only one TraceT in the entire stack.
This PR is on top of #7789.

### Description

This PR entirely rewrites the API of the Tracing library, to make `interpTraceT` a thing of the past. Before this change, we ran traces by sticking a `TraceT` on top of whatever we were doing. This had several major drawbacks:
- we were carrying a bunch of `TraceT` across the codebase, and the entire codebase had to know about it
- we needed to carry a second class constraint around (`HasReporterM`) to be able to run all of those traces
- we kept having to do stack rewriting with `interpTraceT`, which went from inconvenient to horrible
- we had to declare several behavioral instances on `TraceT m`

This PR rewrite all of `Tracing` using a more conventional model: there is ONE `TraceT` at the bottom of the stack, and there is an associated class constraint `MonadTrace`: any part of the code that happens to satisfy `MonadTrace` is able to create new traces. We NEVER have to do stack rewriting, `interpTraceT` is gone, and `TraceT` and `Reporter` become  implementation details that 99% of the code is blissfully unaware of: code that needs to do tracing only needs to declare that the monad in which it operates implements `MonadTrace`.

In doing so, this PR revealed **several bugs in the codebase**: places where we were expecting to trace something, but due to the default instance of `HasReporterM IO` we would actually not do anything. This PR also splits the code of `Tracing` in more byte-sized modules, with the goal of potentially moving to `server/lib` down the line.

### Remaining work

This PR is a draft; what's left to do is:
- [x] make Pro compile; i haven't updated `HasuraPro/Main` yet
- [x] document Tracing by writing a note that explains how to use the library, and the meaning of "reporter", "trace" and "span", as well as the pitfalls
- [x] discuss some of the trade-offs in the implementation, which is why i'm opening this PR already despite it not fully building yet
- [x] it depends on #7789 being merged first

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7791
GitOrigin-RevId: cadd32d039134c93ddbf364599a2f4dd988adea8
2023-03-13 17:38:39 +00:00
Jesse Hallett
3ee6b54962 server: codecs for metrics, roles, allow list
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8114
GitOrigin-RevId: 1a1f8b6360edbdddad5cf364b533a255c15e2f4a
2023-03-09 23:11:08 +00:00
Daniel Chambers
dc83352863 Support for using Data Connectors as the target of remote relationships
[GDC-487]: https://hasurahq.atlassian.net/browse/GDC-487?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[GDC-488]: https://hasurahq.atlassian.net/browse/GDC-488?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8182
GitOrigin-RevId: 712953666e1a5ea07500f1e1aed669f27650f7a4
2023-03-07 01:33:26 +00:00
Puru Gupta
4e7fbbc2d6 server: use only server context and app env for dependent functions (remove passing of ServeOptions)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7920
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 6ebc4d0429fdfecf93950879b69e8b5f8f56b502
2023-02-28 09:11:27 +00:00
Gil Mizrahi
625e41cd77 rename naqi to logimo part 3 - data types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8068
GitOrigin-RevId: 435527a98e645ed69c9be484ff0bd21af8181d69
2023-02-22 13:46:54 +00:00
Gil Mizrahi
2b0e9ea14c rename NativeQuery module hierarchy to LogicalModel
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8063
GitOrigin-RevId: 0ed0cee7fb1d77f166770caae21cc05d5dd30b75
2023-02-22 09:23:54 +00:00
Gil Mizrahi
b761add3c4 rename naqi to logimo part 1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8037
GitOrigin-RevId: 4839410ba836d4b69fd1ee30875bca9b46decc66
2023-02-21 13:46:44 +00:00
Jesse Hallett
37100138b6 server: codecs for rest endpoint definitions in metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8030
GitOrigin-RevId: 0980502c535ab308e2458a98cebfd166fa55f8b6
2023-02-20 18:37:55 +00:00
Jesse Hallett
99a982d4dd server: codecs for the metadata Action type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7898
GitOrigin-RevId: 4211854f656ab02bb058b2d0831637477b3d4767
2023-02-20 17:10:19 +00:00
Jesse Hallett
8640346b4f server: codecs for cron triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8029
GitOrigin-RevId: c26308782618c760921a0eff3e4bd87702bd3eb2
2023-02-20 02:52:00 +00:00
Solomon
4d3e80a0b5 [Gardening] Eliminate boolean blindness in rsoWebSocketCompression
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7818
GitOrigin-RevId: cb3b8b8ebf7bd296c88c782c8bc457397a88f8ea
2023-02-08 04:15:01 +00:00
Solomon
9b6b44c888 [Gardening] Eliminate boolean blindness in soAllowList
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7815
GitOrigin-RevId: 6768abb39e7ab6b12be8989702223500119169de
2023-02-08 03:36:45 +00:00
Solomon
97dc0408d1 [Gardening] Eliminate boolean blindness in soDevMode
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7814
GitOrigin-RevId: 593b8e764a8dca5aa9b4a9008d341a5d814f28fc
2023-02-08 02:58:32 +00:00
Solomon
807be5f2bf [Gardening] Eliminate Boolean Blindness in soEnableTelemetry option
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7812
GitOrigin-RevId: 0b25624cb600a6d9976737b524c8cd60d160f174
2023-02-08 01:47:56 +00:00
Solomon
caad80ab7f [Gardening] Eliminate boolean blindness in so soWsReadCookie
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7813
GitOrigin-RevId: 6aae2eda1765e302a08c676988b6a7f9432e9977
2023-02-08 00:57:41 +00:00
Solomon
7027af5a05 [Gardening] Eliminate Boolean Blindness in soEnableConsole option
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7810
GitOrigin-RevId: 69f84d52e5f61e88b668abb3898344ccfbc0d26d
2023-02-07 05:59:45 +00:00
Jesse Hallett
2d513ace63 server: codecs for CustomTypes
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7838
GitOrigin-RevId: 09a9be0cee748226321f0cf09401b18c2f31e930
2023-02-07 03:47:35 +00:00
Solomon
d8ff0329a0 Eliminate Template Haskell from Hasura.RQL.Types.Common
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7819
GitOrigin-RevId: bf5d1616a90a771e1c72321b64b38d9c153b0e94
2023-02-06 22:03:02 +00:00
Daniel Chambers
7a4bde9652 Added result_type property to SingleColumnAggregate
[GDC-756]: https://hasurahq.atlassian.net/browse/GDC-756?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7793
GitOrigin-RevId: b8201615984a71a9f41bed4195e2435e362cf383
2023-02-06 04:20:17 +00:00
Auke Booij
e6db044ecc server: fix some hspec tests
- One test suite wasn't getting picked up due to it not satisfying the [criteria](https://hspec.github.io/hspec-discover.html) for `hspec-discover`
- One test was broken ever since it was introduced in hasura/graphql-engine-mono#5181. This wasn't picked up due to the module not satisfying `hspec-discover`'s criteria until more recently.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7801
GitOrigin-RevId: fd5c31ccf12d6d0c4be0dc7bf99f14d63caccc83
2023-02-03 14:09:19 +00:00
Daniel Harvey
d32e734310 [server] Pass parameters to native queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7727
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: ddca3d962c05024913ce6ec4c6b4ea4a0f4a6a8c
2023-02-03 11:16:29 +00:00
Tom Harding
18b346bf44 Extract Hasura.Incremental into lib/hasura-incremental
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7534
GitOrigin-RevId: 85863cee836d348e8e314f8af1b50bb5cd912b46
2023-02-01 12:25:33 +00:00
Daniel Harvey
17dbc7bc32 [server] parser for interpolated SQL queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7726
GitOrigin-RevId: 4b6ad28aa8a4d75bfcf6ce1ec4d89324f7f1ae74
2023-01-31 12:54:11 +00:00
Gil Mizrahi
e7d5b989ab add omit_request_id flag
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7697
GitOrigin-RevId: 6716b263526fd97609f33cd78ec254a24c14b679
2023-01-31 00:28:50 +00:00
Philip Lykke Carlsen
70c8bc8700 Integrating Native Query metadata and schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7657
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: d5047559e3560f5d7870eac6e07c89704146ccab
2023-01-30 16:06:34 +00:00
Solomon
7842bc34ee Refactor/move namingcase default into arg merging
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5289
GitOrigin-RevId: 39c5a5b839534dc5416d62ca20c5051ae4d8ef57
2023-01-30 05:00:54 +00:00
Jesse Hallett
b5e6f48d99 server: codecs for query collections
This is the complete set of codecs to cover the top-level `query_collections` field of `Metadata`.

Ticket: https://hasurahq.atlassian.net/browse/GDC-523

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7351
GitOrigin-RevId: 7a1a46e5006e1c5e25fba6ea4775270c70bc2785
2023-01-28 00:07:20 +00:00
Daniel Chambers
354f7593d9 Custom update column operator support for Data Connectors [GDC-688]
[GDC-688]: https://hasurahq.atlassian.net/browse/GDC-688?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7548
GitOrigin-RevId: 861638d6cc69803776640b50ffe1646b3cf0a7db
2023-01-19 04:22:58 +00:00
Lyndon Maydwell
8d6b9f70f1 Datasets implementation for dataconnectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7502
GitOrigin-RevId: 7ca9a16aa2b27f4efb1263c6415e5a718ca8ced8
2023-01-17 05:49:10 +00:00
Daniel Chambers
bfdeaf0334 Data Connectors insert mutations support [GDC-609]
[GDC-609]: https://hasurahq.atlassian.net/browse/GDC-609?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7513
GitOrigin-RevId: cb401e3ed84c5b60ec59b63dc478a1162b360135
2023-01-17 00:35:22 +00:00
Daniel Harvey
06b284cf33 [server] metadata API for native access
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7476
Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com>
GitOrigin-RevId: 781c29666e92004dc82918c2292fdacc27fded4c
2023-01-16 17:21:22 +00:00
David Overton
a9f77acb32 Remove builtin scalar types from Data Connector backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7167
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 926e7282b908e3a9669ac39d625aa54971e11c37
2023-01-11 02:37:26 +00:00
Daniel Chambers
57607f5295 Refactor Update IR to generalize Update vs Update Many across backends - compositional approach [GDC-687]
[GDC-687]: https://hasurahq.atlassian.net/browse/GDC-687?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[GDC-687]: https://hasurahq.atlassian.net/browse/GDC-687?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7355
GitOrigin-RevId: fa02a83c0c594abe05c1071d0de5054478c32e56
2023-01-10 01:56:14 +00:00
Puru Gupta
f047b7dd17 server: update the jwt refresh thread to poll
## Description
This PR updates the JWK refresh thread to poll every second instead of the previous behaviour where the thread used to sleep based on the expiry time in `Cache-Control`/`Expires` response headers.

## Motivation
As a part of dynamically updating environment variables on cloud without restart the user projects, we want to implement a mechanism which makes HGE aware of any changes in the user configuration by updating a shared variable data type which can be accessed by relevant threads/core functionality before their execution.

The above updates requires us to make the threads polling in nature such that before executing their code, any change in the user config is captured and the appropriate behaviour is channelised. In the case of JWK updating thread, the thread used to sleep for the time as mentioned in the `Cache-Control` or `Expires` headers which make the thread unware of any new changes in the user config in that period of time, hence requiring a restart to propogate the new changes.

To solve this problem we have now updated the JWK update thread to poll every second for change in `AuthMode`(from a shared variable in subsequent changes to implement the dynamic env var update feature) and update the JWK accordingly such that it does not use any stale configurations and works without HGE restart.

### Related Issues
https://hasurahq.atlassian.net/browse/GS-300

### Solution and Design
- We store the expiry time in the `JWTCtx`
- On every poll check whether the current time exceeds the expiry time, in which case we call the JWK url to fetch the new JWK and expiry.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7177
Co-authored-by: Krushan Bauva <31391329+krushanbauva@users.noreply.github.com>
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: bc1e44a8c3823d7554167a7f01c3ce085646cedb
2023-01-06 06:40:40 +00:00
Daniel Harvey
9a59204525 [server/tests] Round trip tests for BigQuery types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7310
GitOrigin-RevId: aaff93e6288ca933770d9ecfa6c5350ebf8177b3
2022-12-21 13:58:58 +00:00