Daniel Harvey
48bb73ecb4
[server/tests] create new Postgres DB for each test
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6741
GitOrigin-RevId: 0fa10ff8e3ab0ca9c36b1146ebf70434836f2531
2022-11-08 11:44:13 +00:00
Samir Talwar
9ab4eb3994
server/api-tests: Only export spec
from all test modules.
...
This ensures that tests don't accidentally share setup/teardown code.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6755
GitOrigin-RevId: 51551dfbc0668fcd884e7055ee3790c6f465bbf8
2022-11-08 03:54:52 +00:00
Daniel Harvey
e6c3113a43
[server]: feature flag to remove _stream
fields from schema
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6698
GitOrigin-RevId: d2b80900d06353647505256fc351a07e6f7cd5f7
2022-11-04 13:10:35 +00:00
Abby Sassel
8bb537e73b
NDAT-72 CRDB Support for Value of Derived Field
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6707
GitOrigin-RevId: 8fab832a8ca225080d2797013f93d122e6424e35
2022-11-04 11:53:48 +00:00
Philip Lykke Carlsen
6720d77cd9
Perform fixture setup spec-by-spec
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6708
GitOrigin-RevId: ac4b7350f6c0e9719f8b5973b267d72e3e4e444c
2022-11-03 20:27:02 +00:00
Philip Lykke Carlsen
1fa7f9b881
server/tests: Move 'emptySetupAction' to its single usage site
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6704
GitOrigin-RevId: 9adac1913fff3735b44c89c206e92544c9aa760b
2022-11-03 16:29:28 +00:00
Philip Lykke Carlsen
5b2877bc8f
server/tests: Move subscriptions harness to a separate module
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6664
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: f5d7793606a50fb10f871ae757748fe5c21e50c8
2022-11-03 10:58:32 +00:00
Samir Talwar
342391f39d
Upgrade Ormolu to v0.5.
...
This upgrades the version of Ormolu required by the HGE repository to v0.5.0.1, and reformats all code accordingly.
Ormolu v0.5 reformats code that uses infix operators. This is mostly useful, adding newlines and indentation to make it clear which operators are applied first, but in some cases, it's unpleasant. To make this easier on the eyes, I had to do the following:
* Add a few fixity declarations (search for `infix`)
* Add parentheses to make precedence clear, allowing Ormolu to keep everything on one line
* Rename `relevantEq` to `(==~)` in #6651 and set it to `infix 4`
* Add a few _.ormolu_ files (thanks to @hallettj for helping me get started), mostly for Autodocodec operators that don't have explicit fixity declarations
In general, I think these changes are quite reasonable. They mostly affect indentation.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6675
GitOrigin-RevId: cd47d87f1d089fb0bc9dcbbe7798dbceedcd7d83
2022-11-02 20:55:13 +00:00
Tom Harding
aaf8e9a8c1
Add tests for streaming subscriptions
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6650
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 415f7904b591d2c4e32ec320570d1b8e0bef1719
2022-11-02 13:23:47 +00:00
Gil Mizrahi
60bd73e8d9
add a test for subscriptions with variables
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6653
GitOrigin-RevId: b7d7f7392c50e983183812b270af3516c831d859
2022-11-02 12:47:04 +00:00
Daniel Harvey
11ff01f3e9
[server] Fix CockroachDB live queries
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6551
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: e78ce17d3ff5c677360b2927dca04a91e144952e
2022-11-02 11:41:02 +00:00
Tom Harding
7df6198b68
Add multiplexed subscription testing
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6637
GitOrigin-RevId: a92b333b88c548ba514e69598a86098d8f6243cc
2022-11-02 09:39:47 +00:00
Solomon
f5c68ee49e
Fixes chinook table/column customizations to have consistent casing
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6642
GitOrigin-RevId: 629879fa057c3860aac1c3a83d2dfd199edb44e1
2022-11-01 22:08:59 +00:00
Daniel Harvey
cc87b25373
[tests] - allow Postgres source DB port to be overwritten in api-tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6646
GitOrigin-RevId: b96a68c5eab1ac33a226d2d89141e0de9eaeff93
2022-11-01 21:05:00 +00:00
Tom Harding
fbcf90d56f
Add a test for Distinct
queries
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6426
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 65387489ab0cabe0cb520799821380732ecef3e7
2022-11-01 19:58:46 +00:00
Daniel Harvey
8ad0c65051
[tests] api-tests
use separate metadata database
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6573
GitOrigin-RevId: baa425216fc7394d01d0e2923d7c7e54598da40b
2022-10-27 19:08:45 +00:00
Daniel Harvey
b3471f27b8
[server] enable Cockroach subscriptions and re-add CustomFieldsSpec test
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6568
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 678c4fcb55a576d52cdb8f40dcfe2bf7948e8863
2022-10-27 17:27:32 +00:00
Tom Harding
78f3754953
Add Cockroach and Postgres to DataValidation
tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6343
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 9f5d98e180721eaf12fd4c4e60a42b6dee6b5cca
2022-10-27 12:20:41 +00:00
David Overton
9921823915
GDC-189 custom aggregations
...
>
## Description
->
This PR allows DC agents to define custom aggregate functions for their scalar types.
### Related Issues
->
GDC-189
### Solution and Design
>
We added a new property `aggregate_functions` to the scalar types capabilities. This allows the agent author to specify a set of aggregate functions supported by each scalar type, along with the function's result type.
During GraphQL schema generation, the custom aggregate functions are available via a new method `getCustomAggregateOperators` on the `Backend` type class.
Custom functions are merged with the builtin aggregate functions when building GraphQL schemas for table aggregate fields and for `order_by` operators on array relations.
### Steps to test and verify
>
• Codec tests for aggregate function capabilities have been added to the unit tests.
• Some custom aggregate operators have been added to the reference agent and are used in a new test in `api-tests`.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6199
GitOrigin-RevId: e9c0d1617af93847c1493671fdbb794f573bde0c
2022-10-27 00:44:06 +00:00
Philip Lykke Carlsen
064095abdb
server/tests: Add ability to test subscriptions in test-harness
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6494
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: d773139d59e590a5dbbc1c596958e2731dff3e76
2022-10-25 09:06:45 +00:00
Gil Mizrahi
d12827561b
NDAT-207 fix unique constraints and indexes for cockroachdb
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6444
GitOrigin-RevId: 2baf2c954aeead47b82396cafe703e41e0f201a2
2022-10-21 14:03:55 +00:00
Gil Mizrahi
9c3bd2f0d0
server/postgres: fix the schema types conflict between aggregation predicates and table selection aggregates
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6452
GitOrigin-RevId: ed43442c7ade298659bdc42ff76e8e229825f0f1
2022-10-21 13:28:43 +00:00
Daniel Harvey
ac4b15c07b
CI: reject unused imports
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6466
GitOrigin-RevId: 157a51f338e4e80dffedb8b0dcf57173ba6bd126
2022-10-21 11:12:53 +00:00
Daniel Harvey
be9c3e5a66
tests: remove unused imports
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6456
GitOrigin-RevId: 563ce912236552c4bf75dc7f7f506b7dced25118
2022-10-20 13:14:00 +00:00
Daniel Chambers
84b84a78e1
Add column scalar type information Data Connector query API request [GDC-493]
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6433
GitOrigin-RevId: c5f5e0c2e25c6820d9f73a1e90699cf18dc4cd47
2022-10-20 03:24:53 +00:00
Antoine Leblanc
49d0594759
[server] prune join fields of remote relationships to remote schema ( close hasura/graphql-engine#8345 )
...
## Description
This PR fixes hasura/graphql-engine#8345: when creating the final representation of a remote relationship to a remote schema (a `RemoteJoin`), we would mistakenly label ALL join fields in the selection set as being relevant to that one relationship: if there are more than one remote relationship to process in that selection set, that would be the union of all their join fields. The problem with this error is that, when processing remote relationships, we correctly ignore all the ones for which at least one join key is null. Consequently, this error would result in us ignoring remote relationships for which an _unrelated_ join key was null, resulting in that data missing in the final JSON result.
This PR simply ensures that the aggregation of fields that are passed to `createRemoteJoin` is pruned to only contain the fields relevant to the join being created. This is a very small change, and the bulk of this PR is the regression tests.
## Changelog
__Component__ : server
__Type__: bugfix
__Product__: community-edition
### Short Changelog
fix remote relationship to remote schema sometimes being erroneously null when multiple relationships are defined on the same table / graphql object ([#8345 ](https://github.com/hasura/graphql-engine/issues/8345 ))
### Long Changelog
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6420
GitOrigin-RevId: eb54462724b007f80b674dcf234adf6d9cfaaf79
2022-10-20 00:11:51 +00:00
Gil Mizrahi
c6fdb44388
Test on_conflict on cockroachdb.
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6423
GitOrigin-RevId: 58e1c3f60934332720cadb74c8cb29730e797287
2022-10-19 08:51:49 +00:00
Gil Mizrahi
666f34d564
Add cockroach to default and on_conflict tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6412
GitOrigin-RevId: 637abad70096a06c39a13b9c8683444e2bebdecf
2022-10-18 19:48:27 +00:00
Philip Lykke Carlsen
d81571f928
Add support for explain in CockroachDB
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6415
GitOrigin-RevId: d60363d6f466a764b79c887631f9e3f094946440
2022-10-18 16:49:03 +00:00
Tom Harding
346640fdf1
Add tests for query variables
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6383
GitOrigin-RevId: 87345b60ca2206aac097740109fedfeff045598a
2022-10-18 15:55:22 +00:00
Tom Harding
17ea024884
Add tests for query fragments
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6385
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 2cb3255cf9c1aea9e010affecc5f038ea6aa6ab9
2022-10-18 09:17:41 +00:00
Tom Harding
c1b66d7243
Add tests for query aliases
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6384
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 331baf9ec41bc6b2d618362e87defa44ca39da40
2022-10-18 08:11:06 +00:00
Solomon
1e8846d27d
Refactor GDC Fixture Modules for Hspec Tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6358
GitOrigin-RevId: 19b63d1db75998875463eb2a88e938eba688ecb0
2022-10-18 05:33:46 +00:00
Solomon
15ac95d446
Adds GDC Fixture to query specs
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6352
GitOrigin-RevId: 2abba0743648e7f24baddd7591eee737ba795869
2022-10-18 02:48:33 +00:00
Solomon
5e85b0c534
Mutable Sqlite GDC Fixture - GDC-455
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6351
GitOrigin-RevId: bdcb3cfa694dda6a0d1473331bc689aae418a5bb
2022-10-17 22:53:14 +00:00
Tom Harding
a4a7d06000
Add (failing) remote relationship test for CockroachDB
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6315
GitOrigin-RevId: dd15b1743343d8d1156cc18462b24535f5e05f56
2022-10-17 15:19:03 +00:00
Daniel Harvey
4e23afed8d
tests: disable stringifyNumbers in tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6338
GitOrigin-RevId: d3819dfda342af2b70df00d49edfc05dfa9582f5
2022-10-13 12:19:32 +00:00
Tom Harding
9242aea138
Add Delete
tests for Cockroach
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6283
GitOrigin-RevId: 25c075741afbc7730cf13cd79c8838e812eb8cff
2022-10-12 15:03:32 +00:00
Daniel Harvey
557bbe0327
server: remove unused imports
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6314
GitOrigin-RevId: 7e22264c0d6159cb446af28bf9834f6abda3ab03
2022-10-12 11:30:29 +00:00
Tom Harding
2f94bcf6c7
Add Update
tests for Cockroach
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6271
GitOrigin-RevId: ecb38e084f433e29e3ae4e2a6f2039907afcf6d3
2022-10-11 15:18:56 +00:00
Tom Harding
4237c56419
Add more Cockroach tests to api-tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6189
Co-authored-by: Daniel Harvey <4729125+danieljharvey@users.noreply.github.com>
GitOrigin-RevId: fb03fc2f21ef392f63a5d0d4164ff75cc215692c
2022-10-11 14:48:38 +00:00
Gil Mizrahi
3a73997555
server/cockroach: fix long identifiers tests for cockroach
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6257
GitOrigin-RevId: 94aa7e59159db2130718285221db88f20ca7079a
2022-10-11 12:59:51 +00:00
Tom Harding
d7d83d26d6
Add simple Insert
tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6269
Co-authored-by: Samir Talwar <47582+SamirTalwar@users.noreply.github.com>
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
Co-authored-by: Erik Magnusson <32518962+ejkkan@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
Co-authored-by: hasura-bot <30118761+hasura-bot@users.noreply.github.com>
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Manas Agarwal <5352361+manasag@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: e522df6409137aca2209e4e686f673a389abd546
2022-10-11 11:18:26 +00:00
Lyndon Maydwell
d54bb30d3b
Structured Error Protocol for Data Connectors Agents - GDW-137
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6061
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 855d96378030f4e01b0c74b00e20e592e51e7a49
2022-10-11 00:26:24 +00:00
Daniel Harvey
ad53402d1d
test: Check CockroachDB can query into JSONB values with a path
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6124
GitOrigin-RevId: 3de6b6c602d41d4d340c355171c10ac33582b9a5
2022-10-06 13:03:03 +00:00
Gil Mizrahi
d8452bf11c
server: remove ghc libs from freeze file, update guides
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6231
GitOrigin-RevId: d877e46d7130217cd95eb9c507921e76a0009151
2022-10-06 12:27:09 +00:00
Samir Talwar
6a586cdaa0
api-tests: Sort and uniquify test module names in the Cabal file.
...
The duplicates make Cabal 3.8.x choke.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6206
GitOrigin-RevId: 7c6c69c721aed659a19db7b9124749dd6566d5dc
2022-10-05 12:38:48 +00:00
Tom Harding
f05f746b94
Extract the test harness from the Hspec tests
...
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6095
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 51693f7324e62e201a2bdc701255cf6c730745e2
2022-10-04 08:31:26 +00:00