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

291 Commits

Author SHA1 Message Date
Philip Lykke Carlsen
5d76f9cabf Feat: No feature flags for Native Queries and Stored Procedures
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9541
GitOrigin-RevId: 81a33de3a35405c6e45cb5bad160ad00871745eb
2023-06-14 13:21:37 +00:00
hasura-bot
0a418040c3 feat(server): optional args GQL argument
GITHUB_PR_NUMBER: 9497
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/9497

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8340
Co-authored-by: Wsevolod <31807671+kraftwerk28@users.noreply.github.com>
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: e436b171d88991b814cc6c7b3ed47df75795ac64
2023-06-13 14:16:40 +00:00
Gil Mizrahi
9458893bc1 test stored procedures dont work in oss
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9517
GitOrigin-RevId: a33f9a0f0ad2ae82715269256fe997ad98bb1b72
2023-06-13 10:42:33 +00:00
Daniel Harvey
0c38a693ac chore(ci): Use hlint github action
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9434
GitOrigin-RevId: 2205da4c6384b89d31f830a5119514154019566d
2023-06-06 16:00:22 +00:00
Brandon Simmons
440a8664de server: Upgrade the HGE server to GHC 9.4.5
Upgrade to GHC 9.4.5, and update any tests.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8954
Co-authored-by: Mohd Bilal <24944223+m-Bilal@users.noreply.github.com>
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 5261126777cb478567ea471c4bf5441bc345ea0d
2023-06-06 13:29:30 +00:00
Daniel Harvey
0aeb48992e chore(testing): index all queries for Native Query tests by backend type
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9416
GitOrigin-RevId: 7b10bd1f8e2cbb98ec86646d9f54b18ad42bf85c
2023-06-05 13:06:03 +00:00
Gil Mizrahi
d8a4d254f6 chore(tests): add a flag to trace the graphql commands sent to the server during a test.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9409
GitOrigin-RevId: 46d0c48b519bf32ddb9869a8a7af81aad302532b
2023-06-05 08:22:53 +00:00
Daniel Harvey
39396c50b8 feature(server): comparable computed field aggregations for Postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9300
GitOrigin-RevId: 92e4afaf2c029304e9ddb1d9541aa78c2b9b3027
2023-05-25 12:55:29 +00:00
Tom Harding
3492484034 Implement get_table_info for Postgres, Citus, and Cockroach
[NDAT-621]: https://hasurahq.atlassian.net/browse/NDAT-621?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9201
GitOrigin-RevId: 91886f5f8d125d49c35647cfbfc3c6621d932761
2023-05-25 09:32:12 +00:00
Daniel Chambers
7e4c24aea0 Fix WebSockets api-tests breaking for Data Connector backends
[GDC-1024]: https://hasurahq.atlassian.net/browse/GDC-1024?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9291
GitOrigin-RevId: f7a2306268fc1a22744dd9393ac17648551434b0
2023-05-25 07:06:28 +00:00
Tom Harding
e0c0043e76 Upgrade Ormolu to 0.7.0.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9284
GitOrigin-RevId: 2f2cf2ad01900a54e4bdb970205ac0ef313c7e00
2023-05-24 13:53:53 +00:00
David Overton
e5f88d8039 Nested array support for Data Connectors Backend and MongoDB
## Description

This change adds support for querying into nested arrays in Data Connector agents that support such a concept (currently MongoDB).

### DC API changes

- New API type `ColumnType` which allows representing the type of a "column" as either a scalar type, an object reference or an array of `ColumnType`s. This recursive definition allows arbitrary nesting of arrays of types.
- The `type` fields in the API types `ColumnInfo` and `ColumnInsertSchema` now take a `ColumnType` instead of a `ScalarType`.
- To ensure backwards compatibility, a `ColumnType` representing a scalar serialises and deserialises to the same representation as `ScalarType`.
- In queries, the `Field` type now has a new constructor `NestedArrayField`. This contains a nested `Field` along with optional `limit`, `offset`, `where` and `order_by` arguments. (These optional arguments are not yet used by either HGE or the MongoDB agent.)

### MongoDB Haskell agent changes

- The `/schema` endpoint will now recognise arrays within the JSON validation schema and generate corresponding arrays in the DC schema.
- The `/query` endpoint will now handle `NestedArrayField`s within queries (although it does not yet handle `limit`, `offset`, `where` and `order_by`).

### HGE server changes

- The `Backend` type class adds a new type family `XNestedArrays b` to enable nested arrays on a per-backend basis (currently enabled only for the `DataConnector` backend.
- Within `RawColumnInfo` the column type is now represented by a new type `RawColumnType b` which mirrors the shape of the DC API `ColumnType`, but uses `XNestedObjects b` and `XNestedArrays b` type families to allow turning nested object and array supports on or off for a particular backend. In the `DataConnector` backend `API.CustomType` is converted into `RawColumnInfo 'DataConnector` while building the schema.
- In the next stage of schema building, the `RawColumnInfo` is converted into a `StructuredColumnInfo` which allows us to represent the three different types of columns: scalar, object and array. TODO: the `StructuredColumnInfo` looks very similar to the Logical Model types. The main difference is that it uses the `XNestedObjects` and `XNestedArrays` type families. We should be able to combine these two representations.
- The `StructuredColumnInfo` is then placed into a `FIColumn` `FieldInfo`. This involved some refactoring of `FieldInfo` as I had previously split out `FINestedObject` into a separate constructor. However it works out better to represent all "column" fields (i.e. scalar, object and array) using `FIColumn` as this make it easier to implement permission checking correctly. This is the reason the `StructuredColumnInfo` was needed.
- Next, the `FieldInfo` are used to generate `FieldParser`s. We add a new constructor to `AnnFieldG` for `AFNestedArray`. An `AFNestedArray` field parser can contain either a simple array selection or an array aggregate. Simple array `FieldParsers` are currently limited to subfield selection. We will add support for limit, offset, where and order_by in a future PR. We also don't yet generate array aggregate `FieldParsers.
- The new `AFNestedArray` field is handled by the `QueryPlan` module in the `DataConnector` backend. There we generate an `API.NestedArrayField` from the AFNestedArray. We also handle nested arrays when reshaping the response from the DC agent.

## Limitations

- Support for limit, offset, filter (where) and order_by is not yet fully implemented, although it should not be hard to add this
- Support for aggregations on nested arrays is not yet fully implemented
- Permissions involving nested arrays (and objects) not yet implemented
- This should be integrated with Logical Model types, but that will happen in a separate PR

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9149
GitOrigin-RevId: 0e7b71a994fc1d2ca1ef73bfe7b96e95b5328531
2023-05-24 08:02:43 +00:00
Daniel Chambers
f77b6aaa1d Data Connectors: Support using array literals in permission checks
[GDC-868]: https://hasurahq.atlassian.net/browse/GDC-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9238
GitOrigin-RevId: 93593f79a4a6a92eec1d0dc10fd8e5bb21bd123e
2023-05-24 04:42:02 +00:00
Tom Harding
ec63ea6ed0 Use the backend-agnostic get_table_info for GDCs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9186
GitOrigin-RevId: 08f0772139f155918cbc136392cf9869db4c6332
2023-05-23 16:49:45 +00:00
Daniel Harvey
680b41bcb5 chore(server): more accurate return types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9271
GitOrigin-RevId: 87547d3dc3a8d7327f5fa6762828adfdda46f3cc
2023-05-23 16:18:48 +00:00
Tom Harding
84ff37f8fb Numeric Aggregation of Postgres Computed Fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9210
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: c9f7f36e4a93ac2a2669590fe9ba83bb63a1f7ea
2023-05-23 14:48:03 +00:00
Daniel Harvey
a73a009031 chore(server): more expressive logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9197
GitOrigin-RevId: 3471c68d4e59310bdb62ecb3694ab30a2094916e
2023-05-19 16:14:20 +00:00
Lyndon Maydwell
cb8e6feb2e Adding UDF (user-defined-functions) support to Data Connectors - GDC-820
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8121
GitOrigin-RevId: ceb3e29e330bba294061f85c1f75700974d01452
2023-05-19 04:48:46 +00:00
Daniel Chambers
605f0281dc Add untrack_tables metadata API
[GDC-1198]: https://hasurahq.atlassian.net/browse/GDC-1198?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9181
GitOrigin-RevId: 0ff4acae990476f93d11829173e0e4f31e8db04e
2023-05-17 15:31:56 +00:00
Philip Lykke Carlsen
3c7fa7cca1 feat(tests-harness): Support api-tests using postgres-agent data connector
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9188
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 3eda64bcfcaebfb3fcef6783a88a1a4d36dade43
2023-05-17 14:44:06 +00:00
Tom Harding
6695204d90 Implement get_table_info for GDC backends
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9176
GitOrigin-RevId: 88e75233b0c0fe2fa5077f1d1f4b2b2cbc0b6b37
2023-05-17 08:04:55 +00:00
Philip Lykke Carlsen
e73f997284 feat(test-harness): Maintain pools of hge processes
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9158
GitOrigin-RevId: 243e2d771cd8c31852b8b1959b006f27440f079d
2023-05-16 10:05:12 +00:00
Daniel Chambers
c664e1fbba Add track_tables metadata API
[GDC-1198]: https://hasurahq.atlassian.net/browse/GDC-1198?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9120
GitOrigin-RevId: bb86acaf8b06529a34113a80c3fe2409c3d69a63
2023-05-16 04:05:02 +00:00
Philip Lykke Carlsen
53841c98c9 refactor(test-harness): Make admin secret injectable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9147
GitOrigin-RevId: e12138ad59fb690261e5b8e474d959623bce0826
2023-05-15 18:27:52 +00:00
Daniel Chambers
89e3cca8b3 Use sets instead of lists in the Data Connector API types where the order of the list is irrelevant
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9089
GitOrigin-RevId: 292f68a4b44ed75ae6e336da57f02f40e6ded26f
2023-05-09 16:51:10 +00:00
Daniel Chambers
09d14cfc9d Disable Snowflake agent's relationships capability
[GDC-1189]: https://hasurahq.atlassian.net/browse/GDC-1189?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8934
GitOrigin-RevId: 2fa754f1a38b1b7c00ef1754354172f78eb18590
2023-05-09 01:15:47 +00:00
Samir Talwar
bc8c7406df Remove native MySQL dependencies and code wherever I found it.
This includes:

  - CI scripts
  - Cabal dependency lists
  - Dockerfiles
  - Docker Compose files
  - server test harness code

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9066
GitOrigin-RevId: 509d7931693c4755509d5b8e5bcf50b42cc24769
2023-05-05 22:20:55 +00:00
Daniel Harvey
285a200a87 chore(server): delete MySQL native backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9050
GitOrigin-RevId: 1515fb0efdb1baa05ffe3ff7cf6f230acd0cde29
2023-05-05 10:32:56 +00:00
Tom Harding
7617355aa9 Remove feature flag on logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8998
GitOrigin-RevId: 2cde88c5d595860aa97a5c8480442a1ff64a4360
2023-05-04 12:09:39 +00:00
Samir Talwar
c1705a09df api-tests: Fix the error messages to match those reported by Citus v11.3.0.
I also pinned Citus to v11.3. This should hopefully stop us from being surprised with random test failures in the future. We will need to bump this every now and again.

I have updated the Makefile to standardize Docker commands, and made sure we start all the containers even when running tests for a single database, as we need to test cross-DB remote joins. This ensures `make test-citus` actually works and runs all tests.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9035
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 9c36ab65eb05206bfddd639c257d6c5c5cedd2bd
2023-05-03 20:22:26 +00:00
Philip Lykke Carlsen
c7d4117964 fix: Properly scope root-table references in relations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8976
GitOrigin-RevId: bbb54468f04e1df1d595691ccb21a9d28a4eb010
2023-05-03 10:30:23 +00:00
Daniel Harvey
a0b1d69392 chore(server): make native queries pro-only
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8926
GitOrigin-RevId: 68d2091c97ed80e86f851d656749eab865f73ec4
2023-04-27 14:31:53 +00:00
Tom Harding
4885a3fd9a Import J, not Aeson, A, JSON, Yaml...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8948
GitOrigin-RevId: d70c4a50b94ffe7d42a1fb1017051d351f236acc
2023-04-26 17:30:24 +00:00
Daniel Harvey
107db24caf chore(tests): Move Native Queries and Logical Models tests to api-tests-pro
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8936
GitOrigin-RevId: 9c170f2ce2de68818a9efe52266b47e87a7c4726
2023-04-26 11:05:32 +00:00
Daniel Chambers
cb80942e4f Disable use of local relationships in metadata if Data Connector agents don't declare relationships capability
[GDC-489]: https://hasurahq.atlassian.net/browse/GDC-489?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8862
GitOrigin-RevId: cfff2d9c688185e00f4a830dbdbe173dba4ce7f0
2023-04-26 06:49:36 +00:00
Daniel Harvey
15ce4818b2 chore(server): fix Logical Model permissions for nested fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8889
GitOrigin-RevId: c86f5328170aaa40cc5bf469f5cbb98e01ac521d
2023-04-25 11:59:48 +00:00
paritosh-08
b158aae73b server: check for event triggers before throwing source-cleanup-failed warnings
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8885
GitOrigin-RevId: 7e02829608c6838f5db8226b532b436dd97f1b22
2023-04-24 19:52:50 +00:00
Tom Harding
3151dd0074 Extract hasura-extras from graphql-engine
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8848
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: 4a667e2760f866e57e0e7d804815153571b413e6
2023-04-21 13:15:27 +00:00
Daniel Harvey
59244eac85 feature(server): basic array relationships on Native Queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8752
GitOrigin-RevId: adea2941e01c4037b74f6e8c9150ff0819729fae
2023-04-21 11:57:42 +00:00
Tom Harding
52c21832d8 Add an alias for EXISTS clauses in queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8537
GitOrigin-RevId: d931e4f32bef75dcba7cf8d370caa7539a7d3d8a
2023-04-20 12:34:51 +00:00
Gil Mizrahi
2635ed46bd sqlserver: implement native queries as CTEs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8818
GitOrigin-RevId: 78d84c3558b2cc27e1c1a6c025de4c5035a9cafe
2023-04-19 14:54:56 +00:00
Philip Lykke Carlsen
983fc2ad47 Rename "Custom Return Types" → "Logical Models"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8800
GitOrigin-RevId: e5e10f31c6cc8953a8ee947441a7f80b0e9b5e5e
2023-04-19 09:05:25 +00:00
Daniel Chambers
91c88b2109 Properly return schema information about views and PK mutability from the Super Connector
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8786
GitOrigin-RevId: b7cd0dd5736a408a269819ea76dfbe53455060ee
2023-04-18 17:24:51 +00:00
Gil Mizrahi
5ed9fcc0a3 bugfix(NativeQueries): fix validation failed on name with uppercase on postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8790
GitOrigin-RevId: f3b9b041fd96c6087ff4bd3379ef6283befcdc54
2023-04-18 16:09:45 +00:00
Daniel Harvey
2fd3f91398 chore(server): metadata changes for array relationships for Native Queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8670
GitOrigin-RevId: c23e23e3cf48013ab76fc2fa98c8b8b800c6cee6
2023-04-17 11:31:59 +00:00
Tom Harding
4c25eafc52 bulk_keep_going
[NDAT-604]: https://hasurahq.atlassian.net/browse/NDAT-604?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8770
GitOrigin-RevId: 597dbb1448794c0ac25496d6b6f759d5aaccc2fb
2023-04-13 17:00:45 +00:00
Philip Lykke Carlsen
0346224444 Rename "Logical Models" → "Native Queries"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8769
GitOrigin-RevId: 66f2cbfb620d641e672a4074554d9d324a18c591
2023-04-13 16:12:20 +00:00
Tom Harding
d60136b4fb Create a schema dependency from logical models to their types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8746
GitOrigin-RevId: 969685c87e7fcd3458da87a37a0a4589d6f85bc5
2023-04-13 09:56:29 +00:00
Daniel Chambers
56db8ec358 Data Connectors: Fix track_table not working if the table was created after schema cache was built
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8732
GitOrigin-RevId: e11a0ef6979d1d58a0b39dcd8fff48d446d3420f
2023-04-13 01:30:50 +00:00
Tom Harding
168037df02 Add a test for multiplexing logical models
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8720
GitOrigin-RevId: da435a5700929592eb95d49dbaa9b4531c10042e
2023-04-11 16:59:41 +00:00