Commit Graph

4797 Commits

Author SHA1 Message Date
Matt Hardman
b88b3b9586 console (feat): create suggested relationship component
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4916
Co-authored-by: mattwhaleblue <97981123+mattwhaleblue@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 84c97049c809653049596976aa62cad60c4e1db8
2022-08-01 14:36:28 +00:00
Jesse Hallett
ab59be86c3 server: split metadata serialization helpers into new module
Moves code from `Hasura.RQL.Types.Metadata` that is specific to serialization into a new module, `Hasura.RQL.Types.Metadata.Serialization`.

I'm breaking up #5184 into smaller PRs. This is the third and final PR in that effort. This PR is stacked on #5210 and #5211.

The tracking issue is https://hasurahq.atlassian.net/browse/MM-35

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5212
GitOrigin-RevId: 6cde6d52173590fafe0969a06f2a3411db4fbc78
2022-08-01 13:55:32 +00:00
Jesse Hallett
b9ec9b78dd server: convert Metadata to DTO (smaller PR)
Introduces a new function, `metadataToDTO`, that converts a `Metadata` value to a `MetadataV3` DTO value. This is the next step in the alternative serialization path for metadata that comes with a generated OpenAPI specification.

This PR carves up the existing `metadataToOrdJSON` function so that helpers previously embedded in the `where` block of that function can also be used in the implementation of `metadataToDTO`. If I did everything correctly `metadataToOrdJSON` should behave exactly as before.

In a followup PR I will move the extracted helpers to a new submodule, `Hasura.RQL.Types.Metadata.Serialization`, since they add up to several hundred lines of code.

I'm breaking up #5184 into smaller PRs, and this is the second PR in that effort. This PR is stacked on #5210.

The tracking issue is https://hasurahq.atlassian.net/browse/MM-35

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5211
GitOrigin-RevId: 2596ed5312d7b1232c47ae1d08a51d8ead11fcb8
2022-08-01 12:50:00 +00:00
Tom Harding
08c47b7568 Move and refactor the Directives tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5267
GitOrigin-RevId: ec37b8bcea8f50b97fca4008dec7575929ed1841
2022-08-01 12:05:56 +00:00
Tom Harding
b85b018108 Remove GEq and GCompare for (:~~:)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5266
GitOrigin-RevId: 0457b30bf10f1176f3ba7b21d6754dd0c4af75e6
2022-08-01 10:11:16 +00:00
Gil Mizrahi
b70f2a1434 Remove strictness annotations from data types in the Hasura.RQL hierarchy
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5253
GitOrigin-RevId: ab9dd99ce654cda299504bfe6be2f3240c2f82e2
2022-08-01 09:33:35 +00:00
Stefano Magni
ec2549095d console: Link the most important resources in the README
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4949
GitOrigin-RevId: d29aba0140d74bdbd5e04f34ca9eb3b0cd208389
2022-08-01 08:19:20 +00:00
Daniel Chambers
8197d72523 server: Added a complex Data Connector agent test scenario
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5245
GitOrigin-RevId: 0592872eb66a84b286de0b4de9566b83514255a7
2022-08-01 00:41:58 +00:00
Solomon
4769837775 Remove template haskell from Init/Config.hs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5226
GitOrigin-RevId: 96f39fad25c726a0d9b64a4a83fbb32b92f09241
2022-07-30 01:05:34 +00:00
Jesse Hallett
4ed1fdb859 server: move Metadata code to avoid circular dependencies in upcoming work
A following PR moves serialization-related code out `Hasura.RQL.Types.Metadata` into a specialized submodule. To avoid circular dependencies a number of other definitions also need to be moved into their own submodule. This PR does that extra moving first so that we can keep each PR as small, and as easy to review as possible.

There are a lot of changed lines; but it's all moving code from one module to another.

I'm breaking up #5184 into smaller PRs, and this is the first PR in that effort.

The tracking issue is https://hasurahq.atlassian.net/browse/MM-35

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5210
GitOrigin-RevId: 6fb6e29a967ab5ad4724006c8e0addd2d63a3946
2022-07-30 00:15:18 +00:00
Nicolas Inchauspe
bc2480fb98 console: add horizontal variants for form fields wrapper CON-403
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5147
GitOrigin-RevId: 83b13be7fc969687e5d7ea2f0ad9f56b0ca9947b
2022-07-29 18:12:59 +00:00
Samir Talwar
07328fd9fc server: Automate generation and verification of Cabal files from hpack.
We currently use `hpack` to generate the Cabal files from _package.yaml_
files for the two small libraries in _server/lib_. While this is more
convenient, we also check the Cabal files into the repository to avoid
needing an extra step upon pulling changes.

In order to ensure that the Cabal files do not get out of sync with the
hpack files, this introduces a few improvements:

1.  Makefile targets to automatically generate the Cabal files without
    needing to know the correct incantation. These targets are a
    dependency of all build targets, so you can simply run
    `make build-all` and it will work.
2.  An extra comment at the top of all generated Cabal files that
    explains how to regenerate it.
3.  A `lint-hpack` Makefile target that verifies that the Cabal files
    are up-to-date.
4.  A CI job that runs `make lint-hpack`, to stop inconsistencies
    getting merged into trunk.

Most of these changes are ported from #4794.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5217
GitOrigin-RevId: d3dfbe19ec00528368d357b6d0215a7ba4062f68
2022-07-29 16:22:12 +00:00
Antoine Leblanc
0a69db81c9 Move RoleName into SchemaContext.
### Description

I am not 100% sure about this PR; while I think the code is better this way, I'm willing to be convinced otherwise.

In short, this PR moves the `RoleName` field into the `SchemaContext`, instead of being a nebulous `Has RoleName` constraint on the reader monad. The major upside of this is that it makes it an explicit named field, rather than something that must be given as part of a tuple of arguments when calling `runReader`.

However, the downside is that it breaks the helper permissions functions of `Schema.Table`, which relied on `Has RoleName r`. This PR makes the choice of passing the role name explicitly to all of those functions, which in turn means first explicitly fetching the role name in a lot of places. It makes it more explicit when a schema building block relies on the role name, but is a bit verbose...

### Alternatives

Some alternatives worth considering:
- attempting something like `Has context r, Has RoleName context`, which would allow them to be independent from the context but still fetch the role name from the reader, but might require type annotations to not be ambiguous
- keeping the permission functions the same, with `Has RoleName r`, and introducing a bunch of newtypes instead of using tuples to explicitly implement all the required `Has` instances
- changing the permission functions to `Has SchemaContext r`, since they are functions used only to build the schema, and therefore may be allowed to be tied to the context.

What do y'all think?

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5073
GitOrigin-RevId: 8fd09fafb54905a4d115ef30842d35da0c3db5d2
2022-07-29 15:38:44 +00:00
Tom Harding
178e452b6b Use witherable, remove catMaybes/mapMaybe
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5250
GitOrigin-RevId: 5f0a582b3a853d2dbcce20e88c17970290625fc6
2022-07-29 14:53:16 +00:00
Gil Mizrahi
d64940f615 Remove strictness annotations from data types in the Hasura.Backends hierarchy
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5252
GitOrigin-RevId: e2c4098a06c674fa62118d0c1bdbc82c7d5b954e
2022-07-29 14:06:23 +00:00
Varun Choudhary
9dcf73daee console: add custom names for streaming subscriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5243
GitOrigin-RevId: 08932303b6e411e306b29f0052c9f141a794b3f9
2022-07-29 11:15:40 +00:00
Gil Mizrahi
34fd7b9f61 hspec: update to 2.10.0 and use custom ghc-options
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5232
GitOrigin-RevId: 24dfd5742a93445cb86cf2dd0500f9420b21b406
2022-07-29 10:16:37 +00:00
Daniel Chambers
4831c75d4b server: Refactor Data Connector Agent tests to remove duplicate code and test data
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5241
GitOrigin-RevId: 04b0031b81110d978f3f0e502dbe22485d54f950
2022-07-29 08:08:12 +00:00
Solomon
5ad2829b3c Remove Sources of Boolean Blindness in RawServeOptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5225
GitOrigin-RevId: 7c6095d016052c920b11491bf916cd6eec68b038
2022-07-29 00:47:06 +00:00
Solomon
c4d1eed49c Introduce WithEnvT transformer for OSS/Pro Env Parsing
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5209
GitOrigin-RevId: 7d29170cf36e6f3a6a2f614a0087bbafbf0cd63b
2022-07-28 16:52:09 +00:00
Sean Park-Ross
42a317b2d2 Docs: Fix schema/postgres/naming-convention.mdx overwrites from restructure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5233
GitOrigin-RevId: 3804293ff1e637f1d827df5d0b0b96895939fad8
2022-07-28 12:23:32 +00:00
Rob Dominguez
7d797e1b34 Docs: incorporates updates for pg requirements and opentelemetry (closes #4811 and closes #4812)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5207
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 5b435e34a695ec6c8573467e2e9513e64d313666
2022-07-28 12:20:03 +00:00
Rob Dominguez
654c3c178a Docs: updates styles for tbody globally
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5164
GitOrigin-RevId: 706857ce1bec316e58b97e8f540fe431c40b5982
2022-07-28 12:17:15 +00:00
Abhijeet Khangarot
b0bd7883cc feature (console): add cron triggers new UI with rest connectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4933
GitOrigin-RevId: a3c44c370cac016e0d1287ed4c86390f63bd67db
2022-07-28 12:13:26 +00:00
Tom Harding
0494ef3f2b Remove SerializationSpec, move to BigQuery-specific tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5218
GitOrigin-RevId: 3e14e7cefb02d21aa1c938185043e3af428d5190
2022-07-28 10:18:59 +00:00
Tom Harding
3dc17c3f77 Remove PostgresTypesSpec, create Test.Postgres.TimestampSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5220
GitOrigin-RevId: eb892113ea1a9491c6cb793102ad5f56ae2713fb
2022-07-28 09:42:43 +00:00
Tom Harding
f7392a26e3 Move UpdateManySpec into Test.Mutations.MultiplePerRequest
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5206
GitOrigin-RevId: a3f1d37de38c40c2e08506ed30eb0a56ce3bb45e
2022-07-28 08:54:35 +00:00
Daniel Chambers
94ddf10df6 server: Remove multiple column count aggregate support from Data Connectors [GDW-207]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5224
GitOrigin-RevId: be62ad21ed60cf5c9fb05cda8454b99a0c024866
2022-07-28 07:25:23 +00:00
Daniel Chambers
ac4f3d8ed0 server: Aggregates support for Data Connectors [GDW-187]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5194
GitOrigin-RevId: f0f4f0974710af943b1e47d07d199a277156285d
2022-07-28 05:40:53 +00:00
Nicolas Inchauspe
770a16c22d Replace :focus with :focus-visible for new form components
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5203
GitOrigin-RevId: bb9d39b6a0049d8f24aa985040a5184629811b53
2022-07-27 15:52:56 +00:00
Daniel Harvey
b2f1d1e0c6 server: add BigQuery dataset insert and delete functions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5061
GitOrigin-RevId: 541236f915a0fe2d159068ca68ec92b0fa13f5e7
2022-07-27 14:25:36 +00:00
Samir Talwar
4f85976155 server: Get make test-backends working and somewhat speedy.
* Fix `make start-sqlserver` so it can find `sqlcmd`.
* Start the DC reference agent when testing all backends.
* Start backends in parallel so it doesn't take so long to spin them up. This is achieved by splitting all `start-*` tasks into `spawn-*` and `wait-for-*`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5176
GitOrigin-RevId: ea483a755daa3fa6a8701f9d3dd0f393bc56510f
2022-07-27 13:30:14 +00:00
Sooraj
1f574c6eaf console: show correct GQL query when user click on "Open In GraphQL" from REST endpoints
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5216
GitOrigin-RevId: 00516b3f5067c82b2ea2ccb60fae97766f503c5a
2022-07-27 12:58:18 +00:00
Samir Talwar
f01c7f4ee6 server: Remove QErr and Code dependencies from the schema parsers.
In the process of decoupling the schema parsers from the GraphQL Engine, we need to remove dependencies on `Hasura.Base.Error`.

First of all, we have avoided using `QErr` in schema parsers code, instead returning a more appropriate data type which can be converted to a `Hasura.Base.Error.QErr` later.

Secondly, we create a new `ParseErrorCode` type to represent parse failure types, which are then converted to a `Hasura.Base.Error.Code` later.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5181
GitOrigin-RevId: 8655e26adb1e7d5e3d552c77a8a403f987b53467
2022-07-27 12:26:44 +00:00
pranshi06
5203559173 server: Add warning log for no admin secret
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5034
GitOrigin-RevId: 82498837c38c66882aa1cc7c78131aa965fe70ac
2022-07-27 11:47:32 +00:00
Tom Harding
63cc498619 Move PrimaryKeySpec into the new test structure
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5182
GitOrigin-RevId: 26dafbf95ff6d2cf2f7d3e9d9eec2441f2ef02ce
2022-07-27 11:04:16 +00:00
Vishnu Bharathi
61bc9c498b ci: tag release v2.9.0 and v2.10.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5214
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 93adb002a5a7d9c3983738d9719e83918a571160
2022-07-27 10:16:23 +00:00
Tom Harding
bd1fde3d8b Create and organise OffsetSpec, remove LimitOffsetSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5186
GitOrigin-RevId: 08687b3e77a6e8663cf0ec59e638aa917a334574
2022-07-27 09:46:55 +00:00
Tom Harding
04887f00de Remove Test.OrderingSpec, create Test.Queries.SortSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5188
GitOrigin-RevId: 8d5ca048a838a29991ca4b4425ce0439c60f94b1
2022-07-27 09:08:20 +00:00
Tom Harding
9a55b50d0e Remove the BasicFieldsSpec module, reorganise its contents
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5189
GitOrigin-RevId: f68baca8cc5c0b52135141191bbbee5771d791e1
2022-07-27 08:33:59 +00:00
Naveen Naidu
b69182f4fe server: delete hasura SQL triggers when tables are untracked
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5130
GitOrigin-RevId: c8bec0c5ac0eb9c576e86a218311b5c0503ee400
2022-07-27 07:58:11 +00:00
Lyndon Maydwell
607497f82f Increase timeout for DC Agents
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5172
GitOrigin-RevId: 1d286447901e34a77518e062315b80f4f775eebf
2022-07-27 07:19:44 +00:00
Naveen Naidu
e4dad73adb server/pro: log when rate limits and time limits are hit
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5170
GitOrigin-RevId: fe07b0bf48804c6b4af3d5887d853ffcfde6207d
2022-07-27 06:40:21 +00:00
David Overton
a6dca587d2 Update autodocodec
Updates to the latest version of autodocodec and uses the new features, in particular `discriminatedUnionCodec`.
This allows us to remove the `ValueWrapper*` types and `sumTypeCodec`. Sum types are now encoded as discriminated unions.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5155
GitOrigin-RevId: 20bfdc12b28d35db354c4a149b9175fab0b2b7d2
2022-07-27 05:28:47 +00:00
Samir Talwar
87456360ad server: Move ErrorMessage to its own package.
This is now the sole in-universe dependency of the schema parsers. As
such, we need to extract it as a library before we can extract the
schema parsers as a library.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5202
GitOrigin-RevId: fbe571855768e56dc8b8e259b8efe900de3ecc54
2022-07-27 04:38:12 +00:00
paritosh-08
12064dd24c docs: apollo federation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5146
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: dbd8f3bc08ff847b4925867623417b6a70361d5a
2022-07-27 04:05:08 +00:00
Samir Talwar
a471c5080b Nix: Upgrade Python to the latest version.
There's no reason to pin it to v3.7. This wasn't causing the Docker
Compose issues; it's a dependency version issue.

We actually don't need to install `docker-compose` at all. It's now a
Docker plugin (and is bundled in Docker Desktop) since Docker Compose
v2. You can run it with `docker compose`.

This also fixes a bug in _dev.sh_ due to a moved `make` target.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5197
GitOrigin-RevId: 638b2eb39c99e7a990e7a6c66388831438aed45f
2022-07-26 16:47:18 +00:00
Matt Hardman
a71007566b console: update relationships forms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4955
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: e0e54a54293779c9e1d66d1aa4ad6b24b55e0ddc
2022-07-26 15:05:45 +00:00
Tom Harding
b1bf07db34 Absorb SelectSpec into ObjectQueriesSpec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5196
GitOrigin-RevId: ee1f2c53225904b63f3bd0c33aeecbdd5cb02f36
2022-07-26 14:18:58 +00:00
Tom Harding
307071840f Add the basic limit query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5183
GitOrigin-RevId: 76e1f59c3e5212f69b4b13e431627cfff141a8b5
2022-07-26 13:32:16 +00:00