Commit Graph

1668 Commits

Author SHA1 Message Date
Lyndon Maydwell
ff6aac31b8 Adding multiple jwt secrets (incorporating provenance requirements)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3173
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 395a5d5854896f866b612895d6f41e29376c2caa
2022-02-13 23:34:39 +00:00
Auke Booij
47315b78d6 Add Note explaining type collection
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3588
GitOrigin-RevId: f46d06e9476b22fe7abc699a5236ffefd23c1935
2022-02-10 18:14:01 +00:00
jkachmar
89714a85f6 Fixes 'Harness.Quoter' link typo
Just what it says on the tin.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3640
GitOrigin-RevId: 021f76720846f82ab893b206293681f1e0bfcacf
2022-02-10 16:09:35 +00:00
Daniel Chambers
dd403f92e2 Customization of table GraphQL schema descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3570
GitOrigin-RevId: f642a4d9efdd26a344951fcab6c1bbbc1253dfa3
2022-02-10 06:32:44 +00:00
Kirill Zaborsky
773870f443 BigQuery hspec tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3435
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 78f698becb83bd9732eddbe419361aff2799dd2c
2022-02-09 15:30:13 +00:00
paritosh-08
4d2a5dba51 server: fix multiple calls to database on startup
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3569
GitOrigin-RevId: 820d56a7af7faa05292ef65734d5d40fe3dd4641
2022-02-09 05:14:29 +00:00
Gil Mizrahi
efec0bf9ca server/postgres: LIMIT 1 on object relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3489
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: f09a75508545cdbc34cf8728fad95bbb00bde018
2022-02-08 17:40:24 +00:00
Swann Moreau
8bd34b4a51 server, pro: add support for per-role allowlists
spec: https://github.com/hasura/graphql-engine-mono/pull/2278

Briefly:
- extend metadata so that allowlist entries get a new scope field
- update `add_collection_to_allowlist` to accept this new scope field,
  and adds `update_scope_of_collection_in_allowlist` to change the scope
- scope can be global or role-based; a collection is available for every
  role if it is global, and available to every listed role if it is role-based
- graphql-engine-oss is aware of role-based allowlist metadata; collections
  with non-global scope are treated as if they weren't in the allowlist

To run the tests:
- `cabal run graphql-engine-tests -- unit --match Allowlist`
- py-tests against pro:
  - launch `graphql-engine-pro` with `HASURA_GRAPHQL_ADMIN_SECRET` and `HASURA_GRAPHQL_ENABLE_ALLOWLIST`
  - `pytest test_allowlist_queries.py --hge-urls=... --pg-urls=... --hge-key=... --test-allowlist-queries --pro-tests`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2477
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
GitOrigin-RevId: 01f8026fbe59d8701e2de30986511a452fce1a99
2022-02-08 16:54:49 +00:00
Evie Ciobanu
9337edf096 Evie/postgres/module docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3563
GitOrigin-RevId: e35aafbd210d526ed53db7088e1a47f89f0b9c44
2022-02-08 09:25:35 +00:00
Gil Mizrahi
8432407156 Add a tip on how to benchmark a query on postgres
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3593
GitOrigin-RevId: ebc3d05f788f45fd0b1cdebc40c090c7163824ad
2022-02-08 08:29:22 +00:00
Karthikeyan Chinnakonda
8d2acc833d server: add a note about experimental features
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3598
GitOrigin-RevId: e7f8d2f8d1b9490f0e28e59073f7b6a62447c04c
2022-02-08 07:52:24 +00:00
paritosh-08
b75706dd12 server: validate REST endpoint queries after metadata change
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2338
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: 9cd6bb940ba74fe41bdf2db3c4f35e89c4fb0577
2022-02-08 04:47:52 +00:00
Auke Booij
c4ef2d21f8 Make optimize_permission_filters an --experimental-features flag
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3589
GitOrigin-RevId: 5e102e5dd348e170ebe10f04ff9598fdc4167522
2022-02-07 18:05:39 +00:00
Rakesh Emmadi
793aede022 server/mssql: improve database exception handling and better API errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3487
GitOrigin-RevId: d3f696072e8290b45c2f81509ce31cb5c13a4aef
2022-02-07 14:12:55 +00:00
Daniel Chambers
ba5b7fedd4 Try to make JWK refresh integration tests more reliable in CI
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3577
GitOrigin-RevId: a5f8f6e3dc373e8f2b44fcfdcb6b97696d8c62b5
2022-02-07 09:13:09 +00:00
Antoine Leblanc
aaadd2c81f Build schema cache for relationships from remote schemas
## Description

This PR is a subset of #3069, that does roughly that #3031 was aiming to do: add the schema cache building phase for relationships from remote servers. This PR does not change any of the code that *uses* remote relationships, meaning we ignore the added schema cache information. It also contains dependency-tracking code, which was originally missing from #3031; in turn, this pulls some of the metadata API as well, since we identify remote relationships by how they were created.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3540
GitOrigin-RevId: ed962b6d07fd4adbf0a71e0d79736a4e8b422fea
2022-02-03 18:59:32 +00:00
Auke Booij
c4cdacf989 First attempt at deduplicating permission filters
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3362
Co-authored-by: Chris Parks <592078+cdparks@users.noreply.github.com>
GitOrigin-RevId: 802c099c26ff024e6cf594ea0317480e260486e9
2022-02-03 16:14:44 +00:00
Solomon
9d78ba5ddd Fixes env var error reporting in Webhook Debug Endpoint
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3549
GitOrigin-RevId: c0b48735ea50bf3782bfdcab2a1eeaa582f0c3b6
2022-02-03 14:57:30 +00:00
Philip Lykke Carlsen
e1918adb52 Replace "identity column" with "column mutability" data for all backends
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3373
GitOrigin-RevId: bf08cc9008a4b0b3ece4952528c15c45e57fc74c
2022-02-03 14:15:35 +00:00
Antoine Leblanc
bd2fce3691 Stable sort of extracted notes
## Description

This PR updates the notes-extracting script, to allow for a stable sort across runs:
- files are now treated in alphabetical order of the full file name:
  - within a file, notes are treated in order
  - that order is reflected in the generated index file
- within a note, references are sorted by file, then by line number

Additionally it fixes(?) a note whose format was unexpected.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3352
GitOrigin-RevId: 2b2b57ec0aa2657d75a88e4951e6b19bb2d665e3
2022-02-03 13:33:09 +00:00
Auke Booij
b4c56f26e1 Derive a few instances for PGMetadataStorageAppT
Use GHC's "deriving via" mechanism to obtain a few type class instances for free.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3382
GitOrigin-RevId: 43df1e2e3f770d07f8bc7101cc47b80fc7a34915
2022-02-02 17:26:27 +00:00
Vishnu Bharathi
f4007596fb tag release v2.2.0
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3558
GitOrigin-RevId: b4ba6830be191aac6ce9e8e5bef974bd5322260d
2022-02-02 12:49:55 +00:00
Robert
0c17f238a2 server: report duplicate entries in metadata lists using ToTxt instead of Show
This change is because in https://github.com/hasura/graphql-engine-mono/pull/2477, errors come out as
```
multiple declarations exist for the following allowlist : [CollectionName {unCollectionName = NonEmptyText {unNonEmptyText = "collection_1"}}]'
```
which is awfully messy. This changes it to
```
multiple declarations exist for the following allowlist: collection_1
```

This should improve error messages across the board -- e.g. `RoleName` has a nice `ToTxt` instance, while we used to use a derived `Show` instances. However, there might just be instances where the `Show` instance was better, bit hard to be sure based on scanning the code since we don't have test coverage for these errors.

Broken out of the allowlist PR since it affects more than just the allowlist.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3470
GitOrigin-RevId: 7a2c29f17d9f15d840cb2f89caefcdd3aae44d25
2022-02-01 11:30:58 +00:00
Antoine Leblanc
3525e60021 Deploy server documentation to github page in CI
_(This PR is on top of #3352.)_

## Description

This PR overhauls our documentation CI steps to push all generated server documentation to the `gh-pages` branch of the OSS repo. The goal of this PR is to arrive in the situation where `https://hasura.github.io/graphql-engine/server/` is automatically populated to contain the following:
  - all the markdown files from `server/documentation`, copied verbatim, no transformation applied
  - all the notes, collected from the code by the `extract-notes.sh` script, in `server/notes`
  - the generated haddock documentation for each major release or branch in `server/haddock`.

To do so, this PR does the following:
  - it includes the script to extract notes from #3352,
  - it rewrites the documentation checking CI step, to generate the notes and publish the resulting "server/documentation" folder,
  - it includes a new CI step to deploy the documentation to the `gh-pages` branch

Of note:
  - we will generate a different haddock folder for each main branch and release; in practice, that means the _main_, _stable_, _alpha_, _beta_ branches, and every build tagged with a version number
  - the step that builds the haddock documentation checks that ALL projects in the repo build, including pro, but the deploy only deploys the graphql-engine documentation, as it pushes it to a publicly-accessible place

## Required work

**DO NOT MERGE THIS PR IT IS NOT READY**. Some work needs to go into this PR before it is ready.

First of all: the `gh-pages` branch of the OSS repo does NOT yet contain the documentation scaffolding that this new process assumes. At the bare minimum, it should be a orphan branch that contains a top-level README.md file, and a _server_ folder. An example of the bare minimum required can be previewed [on my fork](https://nicuveo.github.io/graphql-engine/server/).

The content of the `server/documentation` folder needs to be adjusted to reflect this; at the very least, a `README.md` file needs to be added to do the indexing (again, see the placeholder [on my fork](https://nicuveo.github.io/graphql-engine/server/) for an example).

This way of publishing documentation must be validated against [proposed changes to the documentation](https://github.com/hasura/graphql-engine-mono/pull/3294). @marionschleifer what do you think?

~~The buildkite code in this branch is currently untested, and I am not sure how to test it.~~

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3380
GitOrigin-RevId: b24f6759c64ae29886c1f1b481b172febc512032
2022-01-31 13:16:29 +00:00
Daniel Chambers
3c74f91a1c Add default User-Agent header for Action requests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3505
GitOrigin-RevId: fe74349d1ca699dc0edca1e5a829fd658226a5ee
2022-01-31 06:50:13 +00:00
Chris Done
e97f93e02e server/tests: run Haskell integration tests in CI
This PR introduces a BuildKite pipeline step to run the new hspec tests in CI.

Closes https://github.com/hasura/graphql-engine-mono/issues/2866

Relates to https://github.com/hasura/graphql-engine/issues/7760

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2987
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Kirill Zaborsky <70110+qrilka@users.noreply.github.com>
GitOrigin-RevId: 48cea2b81394ff1c4b19bd178ca10bbcb200f33e
2022-01-28 12:22:09 +00:00
Daniel Chambers
4d9417fac4 server: Refresh JWKs maximum once per second
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3429
GitOrigin-RevId: 123fe33f026a36282ee1137eeefd612191ff4844
2022-01-28 00:18:56 +00:00
Antoine Leblanc
d66d2d81fd server: use placeholder to prevent empty query roots
### Description

The GraphQL spec has to conflicting requirements:
1. an object must contain at least one field: the schema may not contain empty objects
2. the _query_root_ must always be present

Given _1_, the schema generation code removes from the schema all fields that would result in empty objects, such as a table for which a user does not have select permissions. But, as a result, our code also potentially removes _query_root_ if it is empty, breaking _2_.

This PR introduces a dummy "placeholder" field in the query root if it's empty, to ensure we never remove it from the schema.

### Remaining work

- [x] changelog entry
- [x] tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/148
GitOrigin-RevId: bfd6bfcc2f3de92900b6ba566012f093399ca037
2022-01-27 18:08:11 +00:00
Antoine Leblanc
a023a3259d Prevent uses of unsafeMkName whenever possible.
### Description

This PR is the result of a discussion in #3363. Namely, we would like to remove all uses of `unsafeMkName`, or at the very least document every single one of them, to avoid similar issues. To do so, this PR does the following:
- it adds a hlint suggestion not to use that function:
  - suggestions don't mark the PR as failed, but will be shown at review time
  - it is possible to disable that hint with `{- HLINT ignore myFunction "unsafe" -}`
- wherever possible, it removes uses of `unsafeMkName` in favour of `mkName`
- it adds a comment with a tracking issue for the two remaining uses:
  - #3478
  - #3479

### Remaining work

- discuss whether this hint should make the linter step fail, since the linter step isn't required to merge anyway, and there is a way to disable the hint wherever we think the use of that function is acceptable
- check that none of those uses were load-bearing and result in errors now

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3480
GitOrigin-RevId: 0a7e3e9d1a48185764c04ab61e34b58273af347c
2022-01-27 15:13:37 +00:00
Antoine Leblanc
81d9071948 Fix remote relationship invalid type name issue (fix hasura/graphql-engine#8002)
## Description

When setting up a remote relationship to a remote schema, values coming from the left-hand side are given as _arguments_ to the targeted field of the remote schema. In turn, that means we need to adjust the arguments to that remote field; in the case of input objects, it means creating a brand new input object in which the relevant fields have been removed.

To both avoid conflicts, and be explicit, we give a pretty verbose name to such an input object: its original name, followed by "remote_rel", followed by the full name of the field (table name + relationship name). The bug there was introduced when working on extending remote relationships to other backends: we changed the code that translates the table name to a graphql identifier to be generic, and use the table's `ToTxt` instance instead. However, when a table is not in the default schema, the character used by that instance is `.`, which is not a valid GraphQL name.

This PR fixes it, by doing two things:
- it defines a safe function to translate LHS identifiers to graphql names (by replacing all invalid characters by `_`)
- it doesn't use `unsafeMkName` anymore, and checks at validation time that the type name is correct

## Further work

On this PR:
- [x] add a test
- [x] write a Changelog entry

Beyond this PR, we might want to:
- prioritize #1747
- analyze all calls to `unsafeMkName` and remove as many as possible

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3363
GitOrigin-RevId: fe98eb1d34157b2c8323af453f5c369de616af38
2022-01-27 14:34:01 +00:00
Gil Mizrahi
084a9f2f7b Reorganize Harness.Quoter.Yaml and add shouldReturnOneOfYaml
- I've made some stylistic changes to `Harness.Quoter.Yaml` so that the exposed API will appear at the top
- I've added a new expectation `shouldReturnOneOfYaml`, which can be helpful in testing non-deterministic results (by specifying all the possible valid results). Can be useful for https://github.com/hasura/graphql-engine-mono/issues/3458

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3492
GitOrigin-RevId: 71c1fe490f8a0717f2729efa2750d5d0034cec86
2022-01-27 13:15:28 +00:00
Karthikeyan Chinnakonda
56e40e1d0e server: add a new metadata API to return all the cron triggers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3464
GitOrigin-RevId: 97b043ec0b4194cde83f2d78c3dc963cf0414c29
2022-01-27 06:44:37 +00:00
Daniel Chambers
bd6f7cd756 Fixed GQL aliases not being respected in the OpenAPI schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3484
GitOrigin-RevId: 0f49dd7f64e80dfe6940d673afa76f12f6599126
2022-01-27 05:55:55 +00:00
Gil Mizrahi
9d2ac22365 tests-hspec - custom finally and readme toc
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3471
GitOrigin-RevId: 4a1477b7e7f175bf7b4c81405747588980c43d7b
2022-01-26 12:18:22 +00:00
Antoine Leblanc
dfe9a046f6 Factor backends' metadata in hspec tests.
## Description

This PR adds a `defaultSourceMetadata` expression to each backend's harness file, and introduces `setSource` and `setSources` to factor out all the calls to `replace_metadata` in the tests.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3425
GitOrigin-RevId: 5eacb156ffa198123262759eb2bbdebe8ab09fd7
2022-01-25 16:35:44 +00:00
Antoine Leblanc
472d5df5ae Add documentation scaffolding for first sync-up.
## Description

This PR adds a basic README file to `server/documentation`, in order to get something somewhat decent when we run the first automatic sync.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3468
GitOrigin-RevId: 10c3afc1ea02ee3eb914009e3b9ad22065c1db50
2022-01-25 13:18:22 +00:00
Daniel Chambers
c861f0b09d Fix REST endpoints with path segments not showing correctly in the OpenAPI spec
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3443
GitOrigin-RevId: 92ab7ccc004fedb149f336b0585e6f002e08e2a9
2022-01-25 06:28:47 +00:00
David Overton
8eca322b94 Fix for customized remote schema input object types in query variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3417
GitOrigin-RevId: a4d3e59f5177f971a64a2b9e62fd1acaa8079a6b
2022-01-24 04:46:46 +00:00
Evie Ciobanu
dc113cc2b8 server: add tests for transaction commit/rollback
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3418
GitOrigin-RevId: fde6ce718cebabed53c90369215358c248a9658f
2022-01-21 12:49:12 +00:00
Gil Mizrahi
abefdd31d0 update contributing and compiling on m1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3431
GitOrigin-RevId: fe899b33ca9f3d128b125e40a58dfee0407826a5
2022-01-21 11:21:49 +00:00
Gil Mizrahi
b091c75372 Add README.md to tests-hspec and reorganize module namespace
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3421
GitOrigin-RevId: 8802d7e6a360edee62011ef371cc8930f36b25b1
2022-01-21 07:49:31 +00:00
paritosh-08
00558666b1 server: add analyzeGraphqlQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3288
GitOrigin-RevId: a5fd39acc8039f2e6ec5090adfc984ac09281d6b
2022-01-21 05:40:20 +00:00
Evie Ciobanu
ab829b4355 test: have dev.sh pass through CLI options for unit tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3420
GitOrigin-RevId: eba7ac0bb609cf83ac1e636c24907601ffcd3651
2022-01-20 15:40:34 +00:00
Anon Ray
137b81c84f server/gardening: rename mkMgr to mkHttpManager
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3394
GitOrigin-RevId: 87ba91ced1d8c408ea8ebacef3f7660952b9fdf4
2022-01-19 12:33:45 +00:00
Rakesh Emmadi
34c2fb2b66 server: cleanup references to "pgCol" in common and non-postgres backend code
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3393
GitOrigin-RevId: b45cd83f7c3fbc1656011ee888968743b0bbb736
2022-01-19 08:38:48 +00:00
Evie Ciobanu
9297a2e09d server: mssql transactions: rearrange, export less, improve docs, hlint
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3387
GitOrigin-RevId: 904fcf8349ab0626b64ff86cd8b076dd08abff8e
2022-01-19 05:26:49 +00:00
Solomon
4b792abdcc Feature/webhook response transforms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3074
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 006c5c9b71cdca1c2f47962230e6189e09557fab
2022-01-19 04:47:36 +00:00
Rakesh Emmadi
fbfdf9a04d server/mssql: restrict "count" aggregate query on multiple columns
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3354
GitOrigin-RevId: d9890782ff8e3ea40ec52c0da82e43ecf5c36d2b
2022-01-18 14:54:46 +00:00
Kirill Zaborsky
47b9321ba4 BigQuery operators: like/nlike, geography
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2924
GitOrigin-RevId: 3748411cb4419a21a58283836adb5cb39d351d19
2022-01-18 13:37:12 +00:00
Auke Booij
a7dbe95666 Hlint all Haskell code
So far we've only used `hlint` to lint the OSS code. This moves some things around to lint the Pro code as well.

Note that the CI action only runs `hlint` on Haskell files that are _changed_ by a PR, relative to its merge-base (usually `main`).

As a reminder, you can use the `ignore-server-hlint-checks` label to prevent this from blocking a merge.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3383
GitOrigin-RevId: d5779c63d780f526a1d58ae4107f0d5262a23ec1
2022-01-18 04:06:15 +00:00
Rakesh Emmadi
f45130bc39 server/mssql: move mssql_run_sql test cases from v1/run_sql to v2/mssql/run_sql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3370
GitOrigin-RevId: dfeb6e2dfda3fbe6ec2d318909dc793042b86d04
2022-01-18 02:21:04 +00:00
Kirill Zaborsky
7beb15b4a3 distinct_on for BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3191
GitOrigin-RevId: e9f1c814b2caf09946389c4bcb30a0c42277abaf
2022-01-17 10:02:17 +00:00
Vamshi Surabhi
2e1be1d2c5 bump python test suite dependencies
This PR upgrades some of the pinned dependencies do not build with python 3.10 - cffi, ruamel, py. Further, it upgrades other packages where the effort is minimal.

For the reviewers: Please review it commit by commit.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3367
GitOrigin-RevId: c5401fe289d3185a79c4d382297f86fbde139825
2022-01-17 07:40:56 +00:00
Rakesh Emmadi
08f1725698 server/mssql: expand transactions to GraphQL queries and mssql_run_sql API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3286
GitOrigin-RevId: 0b37767e271dfa43d36fa7f7cc9928ba6a22964d
2022-01-14 14:09:22 +00:00
Gil Mizrahi
ac8f9daaa9 Use hspec-discover for hspec-tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3328
GitOrigin-RevId: 5f1cfc43434d971083b32e992e40f348bbf75ecd
2022-01-13 21:14:53 +00:00
Kirill Zaborsky
560daa63a8 BigQuery: fix support for joins in nodes of aggregate queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3233
GitOrigin-RevId: a3a4624d5cd0c4c562e27d1e3605882e7f5a3d0d
2022-01-13 15:09:52 +00:00
Evie Ciobanu
db22401e4f server: document python integration test suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3350
GitOrigin-RevId: 47dcebbfa84ed3681da40b3ea52e9b849b2fe8e4
2022-01-13 14:29:10 +00:00
Rakesh Emmadi
42a2787290 server/mssql: update odbc git reference to the commit which has error message fix
## Description

I come across a flaky test due to inconsistent error messages from the odbc lib we use for MSSQL database interactions.
```
cabal new-run -- test:graphql-engine-tests mssql
Up to date

Database.MSSQL.TransactionSpec
  runTx
    runs command in a transaction
    commits a successful transaction, returning a single field
    commits a successful transaction, returning multiple fields
    an unsuccesful transaction, expecting Int
    a successfull query expecting multiple rows
    an unsuccesful transaction; expecting single row
    displays the SQL Server error on an unsuccessful transaction FAILED [1]
    rolls back an unsuccessful transaction

Failures:

  src-test/Database/MSSQL/TransactionSpec.hs:60:15:
  1) Database.MSSQL.TransactionSpec.runTx displays the SQL Server error on an unsuccessful transaction
       expected: UnsuccessfulReturnCode "odbc_SQLExecDirectW" (-1) "[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The definition for column 'INVALID_SYNTAX' must include a data type.[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The definition for column 'INVALID_SYNTAX' must include a data type."
        but got: UnsuccessfulReturnCode "odbc_SQLExecDirectW" (-1) "[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The definition for column 'INVALID_SYNTAX' must include a data type.[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The definition for column 'INVALID_SYNTAX' must include a data type.\DEL"

  To rerun use: --match "/Database.MSSQL.TransactionSpec/runTx/displays the SQL Server error on an unsuccessful transaction/"

Randomized with seed 1101559172

Finished in 0.2140 seconds
8 examples, 1 failure
```
From above, we got a error message with `\DEL` appended. It is also driving the tests to fail in the CI on random PRs.

We brought this into notice of "fpco", the authors of the library and they got us a [quick fix](https://github.com/fpco/odbc/pull/43), which also improves the errors by removing the redundancy of the error message.

In this PR
- We update the `odbc` library git reference to fc5b592a60
- Update the error messages in tests to conform with improved error messages from `odbc`

## Related issues
Closes https://github.com/hasura/graphql-engine-mono/issues/3340

## Changelog

-  `CHANGELOG.md` is updated with user-facing content relevant to this PR.

## Affected components
-  server
-  tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3345
GitOrigin-RevId: a5694e8afb58b5ad71b9c9635a80dea1ec449f51
2022-01-13 11:15:01 +00:00
Evie Ciobanu
e30d51ee38 server: bump pytest version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3348
GitOrigin-RevId: b1fd23da3c8af59e28575438ebffe75f6fb79428
2022-01-13 10:30:55 +00:00
Gil Mizrahi
fe41fbabbd mssql: Test upserts with permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3280
GitOrigin-RevId: 861d4db59f75c83daef975fb3471b3c07889c9bc
2022-01-11 13:36:56 +00:00
Naveen Naidu
d097aea394 server/mssql: Add omitNothingFields to MSSQLConnConfiguration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3325
GitOrigin-RevId: 09f11073a9ef37f10281b778c6884fa420dece20
2022-01-11 09:52:00 +00:00
Evie Ciobanu
463a303390 server: add MSSQL module haddocks
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3293
GitOrigin-RevId: 3062d5b1f41ce1fb18afc78773a2c947d8765309
2022-01-10 22:55:48 +00:00
Chris Done
14bf8ba1be hspec: Tests for MySQL equivalent to the ones from the Python suite. close hasura/graphql-engine#7757
This fills in the gaps specified in this comment: https://github.com/hasura/graphql-engine/issues/7757#issuecomment-979948890 From the issue regarding fleshing out all MySQL tests that we already had in the python suite.

I'll push commits here.

Closes https://github.com/hasura/graphql-engine/issues/7757

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3271
GitOrigin-RevId: 9f68ed1c2b81cae1d479f9482c975f18a699c93a
2022-01-07 17:52:53 +00:00
Gil Mizrahi
59ab1bbe57 refactor Hasura.Backends.MSSQL.Instances.Execute
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3265
GitOrigin-RevId: f7faa22be30ecc5a876dc40ad93cb8d2452de65e
2022-01-06 09:49:58 +00:00
Philip Lykke Carlsen
304ec36c3a (Fix #3154) Remove occurrences of Text in MSSQL IR in favor of dedicated data types.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3264
GitOrigin-RevId: 923ea2794bef9850f1aa5714b610890d02165882
2022-01-05 11:10:39 +00:00
Rakesh Emmadi
f49bb2b180 server/mssql: rollback a transaction based on the transaction state
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3247
GitOrigin-RevId: 70307d8723a63b9314b6ff4d897dcac6e8e93fb9
2022-01-05 08:03:59 +00:00
Naveen Naidu
3a8fadb22b server/mssql: support read replicas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2578
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 88a02f8a617006853b350f48f4317c78ab97435b
2022-01-04 11:54:56 +00:00
Kirill Zaborsky
71f2d04b4f Disable pretty printing in BigQuery responses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3222
GitOrigin-RevId: 03cf0670d949efa7cdd16ee55124925fd54a31c0
2022-01-04 10:57:15 +00:00
Gil Mizrahi
f919c27ba4 Add docstrings to the module headers of a few selected mssql modules
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3241
GitOrigin-RevId: 582a2e77c8120ad2dc818d5f0b51cf56afc79bc5
2022-01-03 17:17:18 +00:00
Brandon Simmons
265470b08c ci: misc. cleanup, naming
GitOrigin-RevId: 253c326e0c873bfa875a13f1d44a605a5fa11476
2022-01-03 06:26:39 +00:00
Brandon Simmons
736236a904 ci: combine pro/oss build jobs
The motivation here is:
- save some CI resources
- make it cleaner/more sensible to do library caching

Since OSS is a dependency of pro, and at the same time the various
executables can be built in parallel, doing this all in the same job
probably is more sensible.

Future improvements: there are separate pro and oss pipelines and one or
the other of those will need to wait unnecessarily while everything
finishes. In practice, currently this isn't a big deal, but we could use
the BuildKite blocking job API to get more fine-grained downstream
triggering.

GitOrigin-RevId: aa917996cbfc678becaaafca490d6edc7de89b1f
2022-01-03 06:26:26 +00:00
Gil Mizrahi
a5f2161e1c server/mssql: upsert - sql generation and execution
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3207
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 92a4aa3cf802bc76858c4be4273a2f6a7d4aa395
2021-12-31 10:56:58 +00:00
Chris Done
15071a3bc9 Add SQL Server & Citus to hspec test suite harness and a BasicFields test for each
Relates to https://github.com/hasura/graphql-engine/issues/7755

This includes:

1. SQL Server
2. Citus

And removes the persistent-based testing in favor of duplicating the schema setup, data insertion and teardown.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3030
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: ab03e68436d2ae07a9ddeb5a499ff41e48d0e2d6
2021-12-30 11:01:43 +00:00
Kirill Zaborsky
a2bf2fdc8f Fix aggregates for comparable types in BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3211
GitOrigin-RevId: 1a63b0835fc5af687f6caca187968edc9efbb821
2021-12-30 10:00:47 +00:00
Rakesh Emmadi
549a5a31f0 server/mssql: fix pytest class names for update mutations
**TLDR**: Rename the pytest class names for update mutations by suffixing with `MSSQL` instead of `Mssql`.

We run the pytest in the CI using option `-k "MSSQL or Common"` which runs the test classes having `Common` or `MSSQL` in their name. Assuming the option `-k` to be case insensitive I named the update mutation test classes ending with `Mssql`. To confirm whether the CI is running the update mutation tests, I opened this PR with a commit making a test to fail and it is not reflected in the CI (all tests are passing!). I renamed the test classes with `MSSQL` as suffix. Now, the CI is able to capture the failing test as expected. Finally, the failing test is fixed.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3227
GitOrigin-RevId: 65b2b2bfbaca64c44ff7607148c32eb0c15e4956
2021-12-29 18:03:46 +00:00
Kirill Zaborsky
234a5385cd Fix support for FLOAT64 in BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3209
GitOrigin-RevId: e7e981bcd043f0daab4b70344afb684484361758
2021-12-29 17:16:44 +00:00
Evie Ciobanu
393662c0e1 server: Add string interpolation support for the graphql QQ for integration tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3220
GitOrigin-RevId: 07cc2c0ae026b2a009f491b89625fd2a7085d729
2021-12-29 15:50:51 +00:00
Philip Lykke Carlsen
33a107d371 Improvements to Update Operators api docs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3225
GitOrigin-RevId: 8f8123353249efb5acaab00681988171e44fae02
2021-12-29 03:52:01 +00:00
Evie Ciobanu
babdd61ad7 server: Document and update HIE file for haskell integration suite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3215
GitOrigin-RevId: 006789ae185f31a34740780d6ddeb0a68bcdbb5d
2021-12-23 16:52:21 +00:00
Rakesh Emmadi
60183df1ea server/mssql: use temporary tables for insert mutation execution
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3205
GitOrigin-RevId: ff889ce43ed613c283edefa68992eab7c36db18c
2021-12-22 11:05:29 +00:00
David Overton
02aef27a75 Add request body to OpenAPI
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2632
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 067e182effaed255ff047abeee309d65a9fb191c
2021-12-22 08:31:14 +00:00
jkachmar
63cff8b731 Experimental backend adapter
This commit introduces an "experimental" backend adapter to the GraphQL Engine.

It defines a high-level interface which will eventually be used as the basis for implementing separate data source query generation & marshaling services that communicate with the GraphQL Engine Server via some protocol.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2684
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Chris Parks <592078+cdparks@users.noreply.github.com>
GitOrigin-RevId: 4463b682142ad6e069e223b88b14db511f634768
2021-12-22 00:11:28 +00:00
Vamshi Surabhi
cca3831180 simplified schema cache representation of remote relationships
This PR pretty much does the same thing to remote relationship types in schemacache as what #2979 did to remote relationship types in the IR. On main remote relationships are represented by types of form `T from to`.  This PR changes it to `T from` which makes it a lot more reusable.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3037
GitOrigin-RevId: 90a5c9e2346c8dc2da6ec5b8c970d6c863d2afb8
2021-12-21 23:15:50 +00:00
Swann Moreau
5760d9289c server: introspection cleanups
this pr modifies the representation chosen for introspection parsers, "pushing down" the `Schema` input so it is not required to build the parser anymore. instead, the value produced when the parser is evaluated becomes a function that consumes a schema:
```diff
-schema :: MonadParse n => Schema -> FieldParser n (          J.Value)
+schema :: MonadParse n =>           FieldParser n (Schema -> J.Value)
 ```

this addresses points (1) and (2) of #2833 and is intended to make #2799 easier: we will need to enforce permissions when generating introspection objects, hiding fields the user is not allowed to see, so if we can pass the schema _later_, we can build this parser once, evaluate it once to (morally) obtain a function `Schema -> Value`, and simply run that single `Schema -> Value` function on different role-based schemas.

(we really need some terminology to be fixed here: "parser" is already not the best name, and then we have parser vs value/function "returned" by parser vs...)

however, we have immediate benefits: we no longer _need_ a `Schema` object to build the introspection parsers! this means we can remove the bogus "degenerate case" schema that is currently constructed in `emptyIntrospection` (and indeed we remove that binding altogether).

(fun fact: the diff for this pull request has a negative line count despite adding a lot of comments. @abooij says i have bragging rights in perpetuity now, à la @nicuveo)

changes:
- internal changes to the operation of the server, invisible outside of a small number of `GraphQL.Schema.*` modules
- no user-facing changes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2835
Co-authored-by: Auke Booij <164426+abooij@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: 9990f53b8f5c733424c4d71a24d94c13dee842ba
2021-12-21 17:29:54 +00:00
Philip Lykke Carlsen
c221d749dd Produce errors if permissions are set on non-mutable columns
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3195
GitOrigin-RevId: 1c1d326742fa626ad34241cb4e745ba168556bc2
2021-12-21 09:43:47 +00:00
Chris Parks
1913f6c763 Avoid overlapping legacy/unified formats when parsing RemoteRelationshipDefinition (closes #3171)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3184
GitOrigin-RevId: 5827f065c918e4d6f7a89247b68d18bac264440f
2021-12-20 19:32:13 +00:00
Auke Booij
e805fc01f3 Avoid NonNullableType
This refactors the AST of GraphQL types so that we don't need `NonNullableType`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3178
GitOrigin-RevId: 6513c8ea0a3cf4ad3ca7d8ef9ca996912fd5eedc
2021-12-20 17:03:28 +00:00
Auke Booij
2c3277e0a7 Refactor InputFieldInfo
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3143
GitOrigin-RevId: a374e07216f3f7d7dee61b222a2758d3ebeb98bb
2021-12-20 15:53:45 +00:00
Evie Ciobanu
974113c80e server: Improve code readability around OnConflict clauses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3181
GitOrigin-RevId: 0ded0f2776fcbaaf51420f796673cf132b8cc248
2021-12-20 11:16:46 +00:00
Abby Sassel
6c6bb678f8 server: Include column mutability data in the schema generation code
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3182
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: ba9d31f5443aa936b1d5b58b0f4e10abf0064a7e
2021-12-17 17:26:51 +00:00
Brandon Simmons
175391bb88 pytest: fix nondeterminism in bigquery/nested_array_relationships.yaml
Noticed this triggered in https://buildkite.com/hasura/graphql-engine-mono/builds/2770#93c45308-2178-479b-ba61-a81488b77ce5

closes https://github.com/hasura/graphql-engine-mono/issues/3168

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3160
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: e2146ca249264aa5c089d1cd7805e401167e22b2
2021-12-17 14:31:17 +00:00
Vishnu Bharathi
26a69b3821 tag release v2.1.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3175
GitOrigin-RevId: 702444a8adba2817540382396704bcfbad0df228
2021-12-17 12:38:06 +00:00
Antoine Leblanc
bacadc30da Fix several issues with remote relationships.
## Remaining Work

- [x] changelog entry
- [x] more tests: `<backend>_delete_remote_relationship` is definitely untested
- [x] negative tests: we probably want to assert that there are some APIs we DON'T support
- [x] update the console to use the new API, if necessary
- [x] ~~adding the corresponding documentation for the API for other backends (only `pg_` was added here)~~
  - deferred to https://github.com/hasura/graphql-engine-mono/issues/3170
- [x] ~~deciding which backends should support this API~~
  - deferred to https://github.com/hasura/graphql-engine-mono/issues/3170
- [x] ~~deciding what to do about potentially overlapping schematic representations~~
  - ~~cf. https://github.com/hasura/graphql-engine-mono/pull/3157#issuecomment-995307624~~
  - deferred to https://github.com/hasura/graphql-engine-mono/issues/3171
- [x] ~~add more descriptive versioning information to some of the types that are changing in this PR~~
  -  cf. https://github.com/hasura/graphql-engine-mono/pull/3157#discussion_r769830920
  - deferred to https://github.com/hasura/graphql-engine-mono/issues/3172

## Description

This PR fixes several important issues wrt. the remote relationship API.

- it fixes a regression introduced by [#3124](https://github.com/hasura/graphql-engine-mono/pull/3124), which prevented `<backend>_create_remote_relationship` from accepting the old argument format (break of backwards compatibility, broke the console)
- it removes the command `create_remote_relationship` added to the v1/metadata API as a work-around as part of [#3124](https://github.com/hasura/graphql-engine-mono/pull/3124)
- it reverts the subsequent fix in the console: [#3149](https://github.com/hasura/graphql-engine-mono/pull/3149)

Furthermore, this PR also addresses two other issues:
- THE DOCUMENTATION OF THE METADATA API WAS WRONG, and documented `create_remote_relationship` instead of `<backend>_create_remote_relationship`: this PR fixes this by adding `pg_` everywhere, but does not attempt to add the corresponding documentation for other backends, partly because:
- `<backend>_delete_remote_relationship` WAS BROKEN ON NON-POSTGRES BACKENDS; it always expected an argument parameterized by Postgres.

As of main, the `<backend>_(create|update|delete)_remote_relationship` commands are supported on Postgres, Citus, BigQuery, but **NOT MSSQL**. I do not know if this is intentional or not, if it even should be publicized or not, and as a result this PR doesn't change this.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3157
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
GitOrigin-RevId: 37e2f41522a9229a11c595574c3f4984317d652a
2021-12-16 20:29:19 +00:00
paritosh-08
40678855d0 server: add support for nested object type in action
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2788
Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: f8ed9741e95b6864a48af7db338f3f619617483a
2021-12-15 23:52:43 +00:00
Philip Lykke Carlsen
37ecb0e3b2 server/mssql: Generate upsert mutation schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3056
GitOrigin-RevId: 8d58ae983c4d3ad55dfeff744c891d77c7c6de1a
2021-12-15 17:08:26 +00:00
Kirill Zaborsky
279f22ed08 Fix support for multiple array relationships in BigQuery
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3003
GitOrigin-RevId: 7a9bf10be6436da2d87d5555f589e23c40c76dd6
2021-12-15 15:19:49 +00:00
Rakesh Emmadi
f00404e0f6 server/mssql: update mutation, SQL generation and execution
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3059
GitOrigin-RevId: 4ed0cbf54ac2a7103cb2b7adc97b2dfdf9994c4f
2021-12-15 13:56:34 +00:00
Evie Ciobanu
aff1ebb060 server: add more MSSQL tests to CI
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3129
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: 1e8fc7ed2426fc07f64ca042c9a0be005cc9d052
2021-12-15 10:44:09 +00:00
Vishnu Bharathi
291de84179 tag release v2.1.0
GitOrigin-RevId: 3456e09d2c096a3a89866f9e92c86605237b9693
2021-12-14 15:38:26 +00:00
Anon Ray
4121c1dd3d Revert "Feature/multiple jwt secrets"
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3136
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
GitOrigin-RevId: aa41817e39f932f909067f2effca9d9973a5fb94
2021-12-14 14:29:52 +00:00
Vamshi Surabhi
0728a9e60e fixes remote relationships format in metadata (fixes graphql-engine-mono/issues/3108)
## Description

This PR fixes two issues:
  - in [#2903](https://github.com/hasura/graphql-engine-mono/pull/2903), we introduced a new metadata representation of remote relationships, which broke parsing a metadata blob containing an old-style db-to-rs remote relationship
  - in [#1179](https://github.com/hasura/graphql-engine-mono/pull/1179), we silently and mistakenly deprecated `create_remote_relationship` in favour of `<backend>_create_remote_relationship`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3124
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
GitOrigin-RevId: 45481db7a8d42c7612e938707cd2d652c4c81bf8
2021-12-14 06:46:11 +00:00
Lyndon Maydwell
36a987811e Fix interpreting urls from environment in the TestWebhookTransform endpoint
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3127
GitOrigin-RevId: 0e5ceaa01f3f27275accd828647ae8587216c80f
2021-12-14 03:25:13 +00:00
Chris Parks
038a6113c3 Remove Identifier associated type family from Backend class (close #1758)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3096
GitOrigin-RevId: 03f218a76c5f333a77646a60c8c69767e2286ea6
2021-12-13 16:49:09 +00:00
Brandon Simmons
c415cd7c0d server benchmarks: add introspection queries
This excercises a different code path from regular queries and is
pretty slow. Motivated by https://github.com/hasura/graphql-engine-mono/pull/2835

We may need to break chinook up into two sets if it keeps growing or
becomes a bottleneck, but do that later.

GitOrigin-RevId: 5832aef520db85f694924e038c0f2c9a7dd17a13
2021-12-09 15:10:42 +00:00
Brandon Simmons
a94be908df benchmarks: add to interpretation guide docs
GitOrigin-RevId: 89ae86f688e0186960ae116ba05357c1eedde817
2021-12-09 15:10:37 +00:00
Evie Ciobanu
392dec868e server/gardening: change BackendInsert's kind to PostgresKind
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3100
GitOrigin-RevId: 9978969bad501d5792e23363b4808b2dbb5826fb
2021-12-09 14:17:47 +00:00
Vishnu Bharathi
a835d95b17 tag release v2.1.0-beta.3
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3099
GitOrigin-RevId: 7aa2926871bd44d80490768f86fab7bac02a7758
2021-12-09 11:28:19 +00:00
Vishnu Bharathi
6cfbde92e4 ci: add support for linux/arm64 docker image
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2933
GitOrigin-RevId: ceeab6164d8437703cd6e37e3dad9d63940ef966
2021-12-09 09:34:22 +00:00
Philip Lykke Carlsen
2fbcd783e7 Refactor XOnConflict and ExtraInsertData
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3055
GitOrigin-RevId: 06f7f92f0e09695f5f7bc02df457d3b96ac9f5f6
2021-12-09 09:06:56 +00:00
Solomon
e4064c9a90 Allows for mock env vars in test-webhook-transform endpoint
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3097
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
GitOrigin-RevId: f0cd00b8f972a1b96213bd098ea09d72b3aba723
2021-12-09 07:59:46 +00:00
pranshi06
dee86453ea server: fallback to unauthorised role when JWT is not found in cookie
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2882
GitOrigin-RevId: ad03fbd0572e00ffe7abea106388a4df4d12af2c
2021-12-08 18:29:29 +00:00
Naveen Naidu
3773ba98b0 multitenant: support for starting multitenant in read only mode
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2993
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: e598d340d81aa96a85bd1ec043f9b7ed847934ef
2021-12-08 06:27:49 +00:00
hasura-bot
1376293e40 make pg_table_metadata CockroachDB compatible
GITHUB_PR_NUMBER: 7788
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7788

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2805
Co-authored-by: Oliver Tan <3646147+otan@users.noreply.github.com>
GitOrigin-RevId: 9de4ddc4b13a9780edee5d1d12579d225ce3bffe
2021-12-07 17:25:33 +00:00
Vamshi Surabhi
23e1cb218a simplification of generalized joins execution
This PR simplifies the types that represent a remote relationship in IR so that they can be reused in other parts (in remote schema types) which could have remote relationships.

The comments on the PR explain the main changes.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2979
GitOrigin-RevId: 559c51d9d6ae79e2183ce4347018741b9096ac74
2021-12-07 13:12:57 +00:00
Solomon
0faa92337d Use transformed request body in event invocation logs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3057
GitOrigin-RevId: 7e001830f97c81289553e37c35098ccaeadbdf22
2021-12-06 22:40:31 +00:00
Robert
5473bfa952 tests: simplify command line of Haskell test suite
# Description

The tests were only being run with fully qualified postgresql and
mssql connection env vars anyhow. Makes it a bit simpler to run the
tests.

- the test suite now requires only plain connection strings as
  `HASURA_GRAPHQL_DATABASE_URL` (postgres) or
  `HASURA_MSSQL_CONN_STR` (mssql)
- update `CONTRIBUTING.md` for this change, and make it
  generally a bit less inaccurate

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3065
GitOrigin-RevId: b0b2f01ef867645d55c87a0e5c2bc1c0e94ee41f
2021-12-06 15:47:45 +00:00
Gil Mizrahi
2ac04384a0 Add tip for writing unit tests for SQL generation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3045
GitOrigin-RevId: a74947471dd2132582ab6be890e80887d272d3ff
2021-12-06 07:59:44 +00:00
Lyndon Maydwell
87426fdef4 Fixing REST Enpoints list variable bug
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3034
GitOrigin-RevId: af1c182879754359b253e630f1393d97d8bcfa2a
2021-12-03 21:57:25 +00:00
Solomon
4a33d6c979 Allows for env var use in test_webhook_transform mock request url
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3009
GitOrigin-RevId: e678cef69d3d4dcb47f80cd584aa0d3c25a091b8
2021-12-03 07:13:35 +00:00
Rakesh Emmadi
7194dc691c server/mssql: fix SQL generation for aggregation queries in sql server (fixes #7773 & #7871)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3024
GitOrigin-RevId: 30c0e7d713375d0c54ff7145d00985e3ade4f1a9
2021-12-02 14:22:42 +00:00
Solomon
f243760398 Feature/multiple jwt secrets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2765
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Aishwarya Rao <59638722+aishwaryarao712@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: awjchen <13142944+awjchen@users.noreply.github.com>
Co-authored-by: Martin Mark <74692114+martin-hasura@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: hasura-bot <30118761+hasura-bot@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Sibi Prabakaran <737477+psibi@users.noreply.github.com>
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Praveen Durairaju <14110316+praveenweb@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: b3b07c3b42da9f3daa450d6d9e5fbf0bf506c651
2021-12-02 05:36:46 +00:00
Auke Booij
caf9957aca Remove Unique from Definition
GraphQL types can refer to each other in a circular way. The PDV framework used to use values of type `Unique` to recognize two fragments of GraphQL schema as being the same instance. Internally, this is based on `Data.Unique` from the `base` package, which simply increases a counter on every creation of a `Unique` object.

**NB**: The `Unique` values are _not_ used for knot tying the schema combinators themselves (i.e. `Parser`s). The knot tying for `Parser`s is purely based on keys provided to `memoizeOn`. The `Unique` values are _only_ used to recognize two pieces of GraphQL _schema_ as being identical. Originally, the idea was that this would help us with a perfectly correct identification of GraphQL types. But this fully correct equality checking of GraphQL types was never implemented, and does not seem to be necessary to prevent bugs.

Specifically, these `Unique` values are stored as part of `data Definition a`, which specifies a part of our internal abstract syntax tree for the GraphQL types that we expose. The `Unique` values get initialized by the `SchemaT` effect.

In #2894 and #2895, we are experimenting with how (parts of) the GraphQL types can be hidden behind certain permission predicates. This would allow a single GraphQL schema in memory to serve all roles, implementing #2711. The permission predicates get evaluated at query parsing time when we know what role is doing a certain request, thus outputting the correct GraphQL types for that role.

If the approach of #2895 is followed, then the `Definition` objects, and thus the `Unique` values, would be hidden behind the permission predicates. Since the permission predicates are evaluated only after the schema is already supposed to be built, this means that the permission predicates would prevent us from initializing the `Unique` values, rendering them useless.

The simplest remedy to this is to remove our usage of `Unique` altogether from the GraphQL schema and schema combinators. It doesn't serve a functional purpose, doesn't prevent bugs, and requires extra bookkeeping.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2980
GitOrigin-RevId: 50d3f9e0b9fbf578ac49c8fc773ba64a94b1f43d
2021-12-01 16:21:35 +00:00
Evie Ciobanu
0a4194a1bc server: throw broken invariant on data loader error
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3010
GitOrigin-RevId: 3b09a7d61343d406d1ecc5d6aaab866564c9dff8
2021-12-01 12:50:38 +00:00
Philip Lykke Carlsen
4c1f3d0140 Adding ColumnMutability to column metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2962
GitOrigin-RevId: ee2687e84842dc5dd647ce9aa017c6051556d0e5
2021-12-01 11:34:16 +00:00
Antoine Leblanc
90d3192df2 Unified remote relationship metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2903
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 11fd6efe8cea246471e525cfb5bad66fa53ccaf9
2021-12-01 04:54:30 +00:00
Antoine Leblanc
f7071b3c93 Changed RemoteSchemaIntrospection's internal representation from a list to a hashmap.
### Description

This PR changes the internal representation of a parsed remote schema. We were still using a list of type definitions, meaning every time we were doing a type lookup we had to iterate through a linked list! 🙀 It was very noticeable on large schemas, that need to do a lot of lookups. This PR consequently changes the internal representation to a HashMap. Building the OneGraph schema on my machine now takes **23 seconds**, compared to **367 seconds** before this patch.

Some important points:
- ~~this PR removes a check for type duplication in remote schemas; it's unclear to me whether that's something we need to add back or not~~ (no longer true)
- this PR makes it obvious that we do not distinguish between "this remote schema is missing type X" and "this remote schema expects type X to be an object, but it's a scalar"; this PR doesn't change anything about it, but adds a comment where we could surface that error (see [2991](https://github.com/hasura/graphql-engine-mono/issues/2991))

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2963
GitOrigin-RevId: f5c96ad40f4e0afcf8cef635b4d64178111f98d3
2021-11-30 14:47:50 +00:00
Naveen Naidu
5cd6c5e43d multitenant: support for event disabling
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2900
GitOrigin-RevId: b2844fa433cfd8f8a29b7e98c6ec44773fd44a57
2021-11-30 12:32:26 +00:00
Auke Booij
29158900d8 Refactor type name customization
Source typename customization (hasura/graphql-engine@aac64f2c81) introduced a mechanism to change certain names in the GraphQL schema that is exposed. In particular it allows last-minute modification of:
1. the names of some types, and
2. the names of some root fields.

The above two items are assigned distinct customization algorithms, and at times both algorithms are in scope. So a need to distinguish them is needed.

In the original design, this was addressed by introducing a newtype wrapper `Typename` around GraphQL `Name`s, dedicated to the names of types. However, in the majority of the codebase, type names are also represented by `Name`. For this reason, it was unavoidable to allow for easy conversion. This was supported by a `HasName Typename` instance, as well as by publishing the constructors of `Typename`.

This means that the type safety that newtypes can add is lost. In particular, it is now very easy to confuse type name customization with root field name customization.

This refactors the above design by instead introducing newtypes around the customization operations:
```haskell
newtype MkTypename = MkTypename {runMkTypename :: Name -> Name}
  deriving (Semigroup, Monoid) via (Endo Name)

newtype MkRootFieldName = MkRootFieldName {runMkRootFieldName :: Name -> Name}
  deriving (Semigroup, Monoid) via (Endo Name)
```
The `Monoid` instance allows easy composition of customization operations, piggybacking off of the type of `Endo`maps.

This design allows safe co-existence of the two customization algorithms, while avoiding the syntactic overhead of packing and unpacking newtypes.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2989
GitOrigin-RevId: da3a353a9b003ee40c8d0a1e02872e99d2edd3ca
2021-11-30 09:52:53 +00:00
David Overton
5bfce057c6 Refactor remote schema customization
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2771
GitOrigin-RevId: 0c90136f956df3f4552140e6ca3d2f4766f8b3f5
2021-11-30 00:38:27 +00:00
Abby Sassel
3fc34aa028 server: deduplicate some pytests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2988
GitOrigin-RevId: 018903d81c6025da2d9eb78aad4762a78f1f6c69
2021-11-26 19:38:17 +00:00
Chris Done
12335bce91 Add a test of tests in common via persistent #2872
Dupe of https://github.com/hasura/graphql-engine-mono/pull/2872 with branch renamed so it doesn't break a tool.

prev pr: https://github.com/hasura/graphql-engine-mono/pull/2921

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2922
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 24af6a814dd106864a2fd3cb985edfe9a8ef5d61
2021-11-26 18:22:00 +00:00
Philip Lykke Carlsen
4f6831d76e Defining the MSSQL update schema using said components
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2923
GitOrigin-RevId: 732988f666f00b3c5eebf6089f9887ee5d679c11
2021-11-26 13:48:09 +00:00
Antoine Leblanc
e3d5c0217f Rename tables in metadata tests to avoid conflicts.
### Description

Tests are not run the same way locally and on CI, which means that tests that work on CI can fail locally. In this case, the setup for each test is creating and dropping a table named `author`; a lot of the tests were also creating a table named `author` in source `pg1`. If `pg1` is the same as the default source, which is the case locally, then all of those tests fail, while the tests that use a default `pg1` such as CI would succeed.

This PR fixes this by renaming `author` to `author_local` where appropriate.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2982
GitOrigin-RevId: 5bc0149bc5f6cb27de9864afaded8af071ade454
2021-11-26 11:40:23 +00:00
Philip Lykke Carlsen
63ee663626 Excise query tags from backend schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2960
GitOrigin-RevId: ff6418609117abc8e0410c0897f2af9779cecf16
2021-11-25 21:08:54 +00:00
Gil Mizrahi
f1cbe4e72b pass MSSQL_SA_PASSWORD to mssql container, and add MSSQL_HOST
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2969
GitOrigin-RevId: 42e4cdf36306148ea34ea19fd42ce5048a38dbbc
2021-11-25 10:23:53 +00:00
Abby Sassel
3166010ac1 server: belatedly address #2889 feedback
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2945
GitOrigin-RevId: 8ccb6479391c2b38af6a4c9ac209e29d4e26f65c
2021-11-24 21:40:44 +00:00
Kirill Zaborsky
a2afe4116b BigQuery remote joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2874
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 24b0304716795a28038629775238996c28b312a3
2021-11-24 16:22:55 +00:00
Gil Mizrahi
6dae132fce Add instructions for compiling graphql-engine natively on M1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2049
GitOrigin-RevId: 9f10c26eef5382fb7b8e750ad272a5797b4cd6d8
2021-11-24 09:59:10 +00:00
Chris Done
926da74819 Auto-launch graphql-engine (close hasura/graphql-engine#7801, hasura/graphql-engine#7827 )
Dupe of https://github.com/hasura/graphql-engine-mono/pull/2853 with branch renamed so it doesn't break a tool.

prev pr: https://github.com/hasura/graphql-engine-mono/pull/2911

next pr: https://github.com/hasura/graphql-engine-mono/pull/2922

This implements https://github.com/hasura/graphql-engine/issues/7801

Some points to keep in mind for review:

* How state is passed to the tests. Do we like how this works?
   * I quite like it, with the opaque type [`State`](68f33051ca/server/tests-hspec/Harness/State.hs (L17)), we can avoid churn when adding things.
   * The [setup/teardown](68f33051ca/server/tests-hspec/Spec.hs (L19-L31)) seems clean.
   * By using hspec's own means to pass and denote context, we avoid "getting new ideas" for how to structure the tests -- we use a standard. Hopefully, that means the tests' structure rarely change.
* The various flags passed in the [ServeOptions](68f33051ca/server/tests-hspec/Harness/Constants.hs (L123)) - if there are any causes for concern, raise them here. My thinking is that, there are lots. I've picked some "sane" defaults (mostly empty). The tests pass. I think as we add more complex tests, these flags will be scrutinised and updated as needed. I think it's valuable that all flags are explicitly listed here, though.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2921
GitOrigin-RevId: 2c2e70bf784ef571a48509a7e5006fd0f48773b5
2021-11-23 18:16:15 +00:00
Chris Parks
a79886bcda Use left join instead of lateral join to fetch foreign key constraints
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2939
GitOrigin-RevId: ed42b885e6e08e653b0888e0eb2012041361a41f
2021-11-23 15:19:49 +00:00
Rakesh Emmadi
4f32324759 server/mssql: refine and generalize mssql OUTPUT clause and temporary table syntax AST
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2931
GitOrigin-RevId: e6aef494a096ca119597dc92bcaf9f16e644a72a
2021-11-22 09:12:45 +00:00
Gil Mizrahi
69ae2a565f adding server/documentation/tips.md
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2920
GitOrigin-RevId: 769133fd546b4f1eb544193e6cdb3cb292bde3ad
2021-11-21 06:29:58 +00:00
Gil Mizrahi
39002bc572 Parse session variables to their correct type in mssql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2908
GitOrigin-RevId: d9d8811e0d0658f6396a7c94bce9b7d2deb5245e
2021-11-20 09:03:44 +00:00
Gil Mizrahi
0e65932355 server/mssql support delete mutations (close hasura/graphql-engine#7626)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2691
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 8b66cc30e8e036ee56a5267c1d2f308155951ae9
2021-11-19 17:06:01 +00:00
Abby Sassel
a7195155ab Add MySQL basic tests (close hasura/graphql-engine#7753)
dupe of @chrisdone's work https://github.com/hasura/graphql-engine-mono/pull/2852 with a branch rename

prev pr: https://github.com/hasura/graphql-engine-mono/pull/2901

next PR: https://github.com/hasura/graphql-engine-mono/pull/2921

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2911
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
GitOrigin-RevId: 81130e100c220a235d9869c89e90d63515e35f74
2021-11-19 15:14:46 +00:00
Philip Lykke Carlsen
84027dad04 Breaking up the Postgres implementation of the update-schema into reusable components
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2889
GitOrigin-RevId: 49c5d59a6f817832f11b1773b078aa24cc650ab5
2021-11-18 18:03:57 +00:00
David Overton
f7e13cb7c9 Skip test if databases are not distinct
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2890
GitOrigin-RevId: 3728c6c5d3e1e12bcff2726a9ee5238dcd3b004b
2021-11-17 23:59:28 +00:00
Abby Sassel
1f14781d15 Create integration testing environment (close hasura/graphql-engine#7752)
dupe of @chrisdone's work https://github.com/hasura/graphql-engine-mono/pull/2829 with a branch rename

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2901
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
GitOrigin-RevId: 8381e53a18242b75d7e17b18a2ba3b2d99dd1322
2021-11-17 19:51:47 +00:00
Robert
9d185ffa03 server: make /healthz action clearer
This is effectively a no-op, the `Left err` case can't actually happen.

- removes some unused logic
- refactors the /healthz endpoint to be clearer
- that includes logging the full QErr if checkMetadataHealth fails,
  but it actually can't because the existing Postgres implementation
  just lifts

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2849
GitOrigin-RevId: ac8abf51b6d869ad4048419e36012137c86e5abd
2021-11-17 17:59:39 +00:00
Robert
783cd678b7 benchmarks: skip failing remote_schema suite
This skips the failing benchmark suite `remote_schema` while it's broken, #2883.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2884
GitOrigin-RevId: 629031d4926452a669f08c924e0be61bcd92f559
2021-11-17 13:00:45 +00:00
pranshi06
81bf0e5429 [pro, server] Multiple Admin Secrets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2631
Co-authored-by: Solomon <24038+solomon-b@users.noreply.github.com>
GitOrigin-RevId: d89a38a9cd9ee7391ca5011b7a11c52e1668a31d
2021-11-17 07:33:33 +00:00
Lyndon Maydwell
7a913302ea Allow use of self signed for connections to lux logging and oauth flow
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2766
GitOrigin-RevId: 85ee7a7385047a209eeac7244cd05383e8ecde35
2021-11-16 08:15:25 +00:00
Anon Ray
b3464c9cb2 server: fix JSON path in error when parsing sources in metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2839
GitOrigin-RevId: 9c46f289b28082bacb0a05a47ead643369d866d3
2021-11-11 15:56:36 +00:00
Karthikeyan Chinnakonda
5d1733519c server: provide option to recreate event triggers of specific or all sources in reload_metadata
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2723
GitOrigin-RevId: 5f18021f4892632c1823543595a26ec7f3d8bc32
2021-11-10 14:35:21 +00:00
Evie Ciobanu
691b9233ce server: IR Selection basic generators
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2627
GitOrigin-RevId: a8a80bf90655db874d269efcf12e59eb9a46575c
2021-11-10 11:13:04 +00:00
Anon Ray
0b1ecbf0a9 server: creating gen_hasura_uuid function should be idempotent
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2625
GitOrigin-RevId: aff53bbfcf284d352848e06843ec4086d6e8ea6e
2021-11-10 07:59:31 +00:00
Rakesh Emmadi
95be515a60 server/mssql: fix table_by_pk query returning empty array
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2810
GitOrigin-RevId: ed8e694d491d7bd28da0b39da2b1f1150d2e3735
2021-11-10 05:32:41 +00:00
David Overton
ec60386f9c Allow "extensions" field in remote schema response
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2818
GitOrigin-RevId: 505e8bae6d3e11199c229bd2b86af09161eb8b66
2021-11-10 02:34:56 +00:00
Philip Lykke Carlsen
984955d194 (Fix #2795) Add haddock documentation to schema generation and helpers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2806
GitOrigin-RevId: 24005d471d469076f03390ca32442a6a3ebbce44
2021-11-10 00:38:40 +00:00
Karthikeyan Chinnakonda
adb20d1d7c server: log DB locking queries during source catalog migration
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2676
GitOrigin-RevId: f01574a30d3a6bf95467ce69bb8b5e69ce4cc057
2021-11-09 14:22:44 +00:00
Puru Gupta
504f13725f server: forward auth webhook set-cookies header on response
>

High-Level TODO:

* [x] Code Changes
* [x] Tests
* [x] Check that pro/multitenant build ok
* [x] Documentation Changes
* [x] Updating this PR with full details
* [ ] Reviews
* [ ] Ensure code has all FIXMEs and TODOs addressed
* [x] Ensure no files are checked in mistakenly
* [x] Consider impact on console, cli, etc.

### Description
>
This PR adds support for adding set-cookie header on the response from the auth webhook. If the set-cookie header is sent by the webhook, it will be forwarded in the graphQL engine response.

Fixes a bug in test-server.sh: testing of get-webhook tests was done by POST method and vice versa. To fix, the parameters were swapped.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [x] Docs
- [ ] Community Content
- [ ] Build System
- [x] Tests
- [ ] Other (list it)

### Related Issues
->
Closes [#2269](https://github.com/hasura/graphql-engine/issues/2269)

### Solution and Design
>

### Steps to test and verify
>
Please refer to the docs to see how to send the set-cookie header from webhook.

### Limitations, known bugs & workarounds
>
- Support for only set-cookie header forwarding is added
- the value forwarded in the set-cookie header cannot be validated completely, the [Cookie](https://hackage.haskell.org/package/cookie) package has been used to parse the header value and any unnecessary information is stripped off before forwarding the header. The standard given in [RFC6265](https://datatracker.ietf.org/doc/html/rfc6265) has been followed for the Set-Cookie format.

### Server checklist

#### Catalog upgrade

Does this PR change Hasura Catalog version?
- [x] No
- [ ] Yes
  - [ ] Updated docs with SQL for downgrading the catalog

#### Metadata

Does this PR add a new Metadata feature?
- [x] No

#### GraphQL
- [x] No new GraphQL schema is generated
- [ ] New GraphQL schema is being generated:
   - [ ] New types and typenames are correlated

#### Breaking changes

- [x] No Breaking changes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2538
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
GitOrigin-RevId: d9047e997dd221b7ce4fef51911c3694037e7c3f
2021-11-09 12:01:31 +00:00
Philip Lykke Carlsen
3f8013abcb Fix #2741: Mechanically excise updateOperators from class BackendSchema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2743
GitOrigin-RevId: c1e56bf66e5e0743e3c5b53a23a5b8a7d85ddf85
2021-11-08 18:13:16 +00:00
Tirumarai Selvan
1b43f0caaa tag release v2.1.0-beta.2
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2762
GitOrigin-RevId: 092e3fee604f9620198128a8c8aced434a20644e
2021-11-08 09:26:08 +00:00
Brandon Simmons
b167120f96 server: add explicit export lists in OSS server and enforce with warning
We'll see if this improves compile times at all, but I think it's worth
doing as at least the most minimal form of module documentation.

This was accomplished by first compiling everything with
-ddump-minimal-imports, and then a bunch of scripting (with help from
ormolu)

**EDIT** it doesn't seem to improve CI compile times but the noise floor is high as it looks like we're not caching library dependencies anymore

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2730
GitOrigin-RevId: 667eb8de1e0f1af70420cbec90402922b8b84cb4
2021-11-04 16:09:38 +00:00
hasura-bot
a886da2f21 server: address recent graphql-ws related bugs
GITHUB_PR_NUMBER: 7730
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7730

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2685
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: 55bafd4eb1576e95803350f3ba9c7920a21de037
2021-11-04 12:40:02 +00:00
Karthikeyan Chinnakonda
0c21100892 server: relocate some of the pre metadata separation source catalog migrations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2687
GitOrigin-RevId: 9fd1c9bdfdf8de1e0d39333368ec799ae92a9e71
2021-11-03 14:21:40 +00:00
Karthikeyan Chinnakonda
04527bca4f server:don't recreate event triggers unnecessarily when the metadata is reloaded
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2740
GitOrigin-RevId: 4888e2f3a69a5eb72440ca50da0b8cd5e3b2b29e
2021-11-03 01:20:39 +00:00
hasura-bot
197b66cc2b changing “ (unicode) for " (UTF-8)
GITHUB_PR_NUMBER: 7607
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7607

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2460
Co-authored-by: Thiago Damas <2286973+thiagodamas@users.noreply.github.com>
GitOrigin-RevId: 839bbdcccb865d2f5710b85478a95c38d258d48e
2021-11-01 11:05:01 +00:00
David Overton
aac64f2c81 Source typename customization (close graphql-engine#6974)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1616
GitOrigin-RevId: f7eefd2367929209aa77895ea585e96a99a78d47
2021-10-29 14:43:14 +00:00
Solomon Bothwell
ce052f0b1b Move Request Transform into the Action Definition
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2717
GitOrigin-RevId: 7c17fa41e5df2cfbc49e0ce2a1f78b3627de7051
2021-10-29 04:13:29 +00:00
Swann Moreau
33d242779f server: call auth webhook even if the request fails to parse
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2604
Co-authored-by: Anon Ray <616387+ecthiender@users.noreply.github.com>
GitOrigin-RevId: fbecc77a519212e00c766c82e6efd5338661de49
2021-10-28 18:43:47 +00:00
Solomon Bothwell
256b59f030 Updates kriti pin to 0.2.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2697
GitOrigin-RevId: 89705a3cc5a67c28cbf8d120df190fc4e42c24ff
2021-10-28 00:26:30 +00:00
Robert
503c220840 server: refactor GraphQL.Transport.HTTP.runGQ for readability
I was trying to figure out how to pipe some information from query
execution to the http log recently, and once again stumbled over the
mess that is `runGQ`. Here's an attempt to break it apart a little bit.

The result should by no means be considered final, but I hope it makes it
somewhate easier to understand what's going on in this function. E.g. now it's
once again somewhat visible how execution of queries and mutations differs.
Had to stop somewhere...

The PR is intended to have no functional change. It consists of individual
commits which should be "obviously" such.

Some thoughts and possible follow-up:
- It'd be good to get rid of the ad hoc `Result` data type again eventually,
  but for the moment I think it's better than the tuples that used to be.
- I think we're quite close to reducing the duplication with WebSocket. E.g.
  executeQueryStep and executeMutationStep might be reusable.
- It's tempting to change the caching API slightly, so that the uncached
  response headers don't have to be pulled from the cache lookup result.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2669
GitOrigin-RevId: ea414d24194509ce29469d74c62fd060b750488d
2021-10-26 11:45:27 +00:00
Sibi Prabakaran
9f35e660c0 server/mysql: Implement MySQL explain API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2367
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Aniket Deshpande <922486+aniketd@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 701c84a1ca5e4ab73a229a804381a7f5281090f1
2021-10-23 11:43:25 +00:00
Rakesh Emmadi
8e88e73a52 server/mssql: add cascade to mssql_run_sql
<!-- Thank you for ss in the Title above ^ -->

## Description
<!-- Please fill thier. -->
<!-- Describe the changes from a user's perspective -->
We don't have dependency reporting mechanism for `mssql_run_sql` API i.e when a database object (table, column etc.) is dropped through the API we should raise an exception if any dependencies (relationships, permissions etc.) with the database object exists in the metadata.

This PR addresses the above mentioned problem by
-> Integrating transaction to the API to rollback the SQL query execution if dependencies exists and exception is thrown
-> Accepting `cascade` optional field in the API payload to drop the dependencies, if any
-> Accepting `check_metadata_consistency` optional field to bypass (if value set to `false`) the dependency check

### Related Issues
<!-- Please make surt title -->
<!-- Add the issue number below (e.g. #234) -->
Close #1853

### Solution and Design
<!-- How is this iss -->
<!-- It's better if we elaborate -->
The design/solution follows the `run_sql` API implementation for Postgres backend.

### Steps to test and verify
<!-- If this is a fehis is a bug-fix, how do we verify the fix? -->
- Create author - article tables and track them
- Defined object and array relationships
- Try to drop the article table without cascade or cascade set to `false`
- The server should raise the relationship dependency exists exception

## Changelog

-  `CHANGELOG.md` is updated with user-facing content relevant to this PR.
  If no changelog is required, then add the `no-changelog-required` label.

## Affected components
<!-- Remove non-affected components from the list -->

-  Server
-  Console
-  CLI
-  Docs
-  Community Content
-  Build System
-  Tests
-  Other (list it)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2636
GitOrigin-RevId: 0ab152295394056c4ca6f02923142a1658ad25dc
2021-10-22 14:50:13 +00:00
Sameer Kolhar
631f39cadf server: fix flaky test_check_events_statuses test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2467
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: a6388397dae11e38962321915c06496cc57ffd64
2021-10-22 05:55:59 +00:00
Chris Done
459a7adbfb Add Types/FromIr changes for MySQL to work with the DataLoader
While it looks like a lot of work in FromIr.hs, you can rather review the type changes in `Hasura.Backends.MySQL.Types.Internal` and the changes to FromIr are only to reflect that. Essentially we're simplifying the FromIr code to not think about SQL-based joins: instead, FromIr produces fields necessary for the dataloader Plan/Execute to do their job properly.

I've done my best to ensure that all the hunks in the diff in this PR are minimal for slightly easier perusing.

I think future PRs will be more intentionally well structured, rather than created retroactively.

**Preceding PR:** #2549

**Next PR**: #2367

The tests have been run like this on my machine. I don't know more beyond that.

```
docker run -i -e "PYTEST_ADDOPTS=--color=yes" -e "TERM=xterm-256color" --net=host -v`pwd`:`pwd` -w`pwd`/server/tests-py chrisdone/hasura-pytest:b0f26f615 pytest  --hge-urls="http://localhost:8080"  --pg-urls="postgres://chinook:chinook@localhost:5432/chinook"  --backend mysql -k MySQL
```

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2608
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: a6483335c3036963360dde7d7d7eaf10859351cb
2021-10-21 23:51:17 +00:00
Solomon Bothwell
03aff6e82e Wrap string interpolations with double quotes on the backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2601
GitOrigin-RevId: 53c27dddd30968dd28325e3336721aa1a238815f
2021-10-21 13:32:49 +00:00
Abby Sassel
6246bd297f server/docs: link to STYLE from CONTRIBUTING
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2655
GitOrigin-RevId: b5a60ad43ab0e2f8e026b91c4fe0aa48883c7d41
2021-10-21 11:34:50 +00:00
awjchen
c49f913539 tests: Implement tests for DB-to-DB joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2645
GitOrigin-RevId: ab85f4911c5b3559ea7878e6682459fd8fc6a356
2021-10-21 03:40:17 +00:00
awjchen
67b4e1cc5b server/tests: initial work on a test suite for DB-to-DB joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2403
Co-authored-by: Kali Vara Purushotham Santhati <72007599+purush7@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Naveen Naidu <30195193+Naveenaidu@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: deaad7afa9df5d3e542cf699e57957de9254f347
2021-10-20 20:02:34 +00:00
Brandon Simmons
a10ec5c8d8 server: tune ghc unfolding/specialization flags for performance (closes #2610)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2629
GitOrigin-RevId: acb22a595cae672bdf5a0303094fb28fc5afcfb3
2021-10-20 16:14:54 +00:00
Tirumarai Selvan
bcb386e7fd tag release v2.0.10 (#2646)
Co-authored-by: Vishnu Bharathi <vishnubharathi04@gmail.com>
GitOrigin-RevId: d6a8802cf4db8f852bdabe92ffa81854fe594186
2021-10-20 09:55:17 +00:00
Chris Done
7553ca170b Add backend modules for MySQL
This is the next part in the series of MySQL PRs.

**Purpose**: Adds the modules related to the generic backend abstraction. This is the penultimate PR.

The final PR will be the more substantial change made to FromIr (and small tweaks to Execute) that will connect all the things together including Python tests.

**Preceding PR:** #2529

**Next PR**: #2608

After #2529 is merged, this can be repointed to `main`. For now it's aimed at #2529, because then the diff display is simpler.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2549
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 9d48ac38f4ac7c32c79ba521d3de40805c2a13bc
2021-10-18 16:05:26 +00:00
Philip Lykke Carlsen
c4536e801c Correctly translate permissions on functions to SQL, and simplify Bool Exp IR
Prior to this change, the SQL expression that resulted from translating permissions on functions would refer to the table of the function's return type, rather than the set of rows selected from the function being called.

Now the SQL that results from translating permissions correctly refer to the selected rows.

This PR also contains the suggested additions of https://github.com/hasura/graphql-engine-mono/pull/2563#discussion_r726116863, which simplifies the Boolean Expression IR, but in turn makes the Schema Dependency Discovery algorithm work a bit harder.

We are changing the definition of `data OpExpG`, but the format accepted by its JSON parser remains unchanged. While there does exist a generically derived `instance ToJSON OpExpG` this is only used in the (unpublished) `/v1/metadata/dump_internal_state` API.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2609
Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
GitOrigin-RevId: bb9a0b4addbc239499dd2268909220196984df72
2021-10-18 09:17:42 +00:00
Chris Done
4bbdb7a67d Add Plan part for the MySQL data loader
This is the next part in the series of MySQL PRs.

**Purpose**: Adds the Plan module for the data loader.

**Preceding PR:** #2511

**Next PR:** #2549

After #2511 is merged, this can be repointed to `main`. For now it's aimed at #2511, because then the diff display is simpler.

The `undefined` stubs in this PR have code already written, so they won't introduce a maintenance problem. They're only omitted for digestibility of the PR.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2529
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 691b35be247531d5e1ac855598e89f6dc1eca0b6
2021-10-14 17:07:56 +00:00
David Overton
63291f6de8 fix OpenAPI for mutiple methods on same REST endpoint path
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2603
GitOrigin-RevId: 32b3133f0bb1a9bf50e4db492bab1eabf5a9430c
2021-10-14 10:32:18 +00:00
Abby Sassel
ef2e1ae935 server: skip flaky test to unblock PRs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2592
GitOrigin-RevId: d56bb4d83b75010d39ffab997766fa5778d547ee
2021-10-13 18:18:57 +00:00
Robert
71af68e9e5 server: drop HasVersion implicit parameter (closes #2236)
The only real use was for the dubious multitenant option
--consoleAssetsVersion, which actually overrode not just
the assets version. I.e., as far as I can tell, if you pass
--consoleAssetsVersion to multitenant, that version will
also make it into e.g. HTTP client user agent headers as
the proper graphql-engine version.

I'm dropping that option, since it seems unused in production
and I don't want to go to the effort of fixing it, but am happy
to look into that if folks feels strongly that it should be
kept.

(Reason for attacking this is that I was looking into http
client things around blacklisting, and the versioning thing
is a bit painful around http client headers.)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2458
GitOrigin-RevId: a02b05557124bdba9f65e96b3aa2746aeee03f4a
2021-10-13 16:39:58 +00:00
Karthikeyan Chinnakonda
eb90c236ea server: recreate event triggers on startup only when the source catalog is migrated
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2572
GitOrigin-RevId: a01b3c5003dd921907e1ea0c2dc87464359de167
2021-10-13 13:01:38 +00:00
Lyndon Maydwell
9ecb3ebf31 Using escaped string for URL transform
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2520
Co-authored-by: Solomon Bothwell <24038+ssbothwell@users.noreply.github.com>
GitOrigin-RevId: 9a0bccb8f5fcfc33306dca27f057d0e1e8dca1dc
2021-10-13 03:38:01 +00:00
Lyndon Maydwell
788e5cb0c2 Include transformed request in errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2543
Co-authored-by: Solomon Bothwell <24038+ssbothwell@users.noreply.github.com>
GitOrigin-RevId: 1432a215cfc2c3e8345941b8072925f115f9259f
2021-10-13 00:29:49 +00:00
Abby Sassel
a9e3a1b4bd server/bigquery: improve test setup and documentation (close #2345)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2495
GitOrigin-RevId: ef250a0796200be6b75363b4275eb8a7ae780154
2021-10-12 17:59:44 +00:00
Abby Sassel
0e3fe2f647 server/misc: fix formatting with ormolu
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2576
Co-authored-by: Robert <132113+robx@users.noreply.github.com>
GitOrigin-RevId: 769f130f0e72729516c54d85cc10b20c68ddd841
2021-10-12 16:14:23 +00:00
Chris Done
47183e8a2c Add Execute part for the MySQL data loader
The Plan part is missing, because it needs support from FromIr. That'll come in a follow up commit.

**Next PR**: #2529

This is the result of splitting up the mega PR into more digestible chunks. This is the smallest subset I've been able to collect. Missing parts are noted in comments.

The code isn't reachable from Main, so it won't affect the test suite. It just gets compiled for now.

For context, this splits up work from https://github.com/hasura/graphql-engine-mono/pull/2332

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2511
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 00f30b0f494b56b3b7f8c1b0996377db4874c88d
2021-10-12 11:34:29 +00:00
Robert
3c3c048bb9 server: drop dependency on ghc-heap-view again for profiling builds (close #2554)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2557
GitOrigin-RevId: e392651861140bfefc65ce387d5cfbd6d3211f66
2021-10-12 09:34:08 +00:00
Robert
cfc4481bc2 ci: fix benchmark job for obsolete github auth
- fix use of github token, compare https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param
- update PR URL grep expression for Kodiak change
- try to make curl use a bit more robust

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2562
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: e902c04478f331e8f3eb16a4041e58b7ec369df3
2021-10-11 22:48:48 +00:00
pranshi06
be1395de31 [server] Allow Nullable action response
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2379
GitOrigin-RevId: eae2b0b401737ceb4e4885ba47c342e26f2026a1
2021-10-11 06:56:01 +00:00
Solomon Bothwell
f86378efb7 Fixes Aeson instances for UpdateAction
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2500
GitOrigin-RevId: 50d174d81dba0af18bc519110bef920ae64912cb
2021-10-07 23:35:36 +00:00
Solomon Bothwell
445a88aeac Rename session variable binder for webhook transforms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2539
GitOrigin-RevId: da8d847213f64cf2a5450c712dedff2f1bc4d8a7
2021-10-07 21:50:11 +00:00
Gil Mizrahi
42cd2e69c0 Add support for customising function root field names
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2468
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 5ff85bb02e4e651376a40914b7ae0aabc8524a05
2021-10-07 13:03:22 +00:00
Evie Ciobanu
2019ef3d29 server: Document the Postgres.Translate.Select module
Closes https://github.com/hasura/graphql-engine-mono/issues/2391

This is an attempt to improve the documentation of this module. There are follow-up issues raised, specifically https://github.com/hasura/graphql-engine-mono/issues/2475

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2486
GitOrigin-RevId: f3293dedf0f2e11cbf35faf928dbbb640b56915c
2021-10-06 14:48:49 +00:00
Puru Gupta
8b60122b9e [server] add openapi support
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1935
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: pranshi06 <85474619+pranshi06@users.noreply.github.com>
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
GitOrigin-RevId: 3e43b84d4e9e181b405855704112b49467dafdf9
2021-10-06 07:16:13 +00:00
Solomon Bothwell
49c07c79e5 Cleans up Request Transform JSON
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2512
GitOrigin-RevId: bd9d71257641276b805e7f0a2b1389c276d9c9cf
2021-10-06 00:09:35 +00:00
Abby Sassel
ddb1b09f45 server/tests: improve pytest error message where execute_query responds with 500
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2506
GitOrigin-RevId: 45b55fd20cc5fae6a3f55b24d6736a1a606684ae
2021-10-05 17:26:42 +00:00
Karthikeyan Chinnakonda
64e2201179 server: enable inherited roles by default
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2325
Co-authored-by: Nicolas Beaussart <7281023+beaussan@users.noreply.github.com>
GitOrigin-RevId: 8ad6fe25a3788892128c1d56b8fa0e8feed2caca
2021-10-05 12:29:32 +00:00
Solomon Bothwell
0a829f8762 Temp fix for pipes in URIs
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2502
GitOrigin-RevId: 041cd11f68b8dfc45526114f875a441eb0c9667e
2021-10-05 02:07:41 +00:00
Solomon Bothwell
74a392f530 TestWebhookTransform shouldn't increment Resource Version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2501
GitOrigin-RevId: d3cfb44d998e942dbe2dad01387b2be8c9dd8cf4
2021-10-04 23:50:47 +00:00
Abby Sassel
3a6f4e1737 server/bigquery: allow empty tables in replace_metadata. Default BigQueryField mode to Nullable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2466
GitOrigin-RevId: 1f3599d1317235a31c98d7ed1ece2db92d82e916
2021-10-01 18:30:01 +00:00
Rakesh Emmadi
09ae6af337 server/mssql: insert SQL generation and execution
>

### Description
>
Insert mutations for MSSQL backend. This PR implements execution logic.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [x] Tests

### Related Issues
->
Close https://github.com/hasura/graphql-engine-mono/issues/2114

### Steps to test and verify
>
Track a MSSQL table and perform the generated insert mutation to test.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2248
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 936f138c80d7a928180e6e7b0c4da64ecc1f7ebc
2021-10-01 12:53:15 +00:00
Rakesh Emmadi
6724b62719 server/postgres: add test case to test computed field with session argument in where expression
>

### Description
>
Add a simple test case to test behavior of computed fields with session argument in filter expression (`where`) of a graphql query.

### Changelog

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2465
GitOrigin-RevId: 25e287c7e7826350e93f2bebacd5d877568c9934
2021-09-30 11:27:37 +00:00
Sameer Kolhar
2a5d3a9432 server: skip TestScheduledEvent due to flakiness
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2473
GitOrigin-RevId: 2edf923f97aadf621cd9fc08163094c357f3beaa
2021-09-30 10:03:49 +00:00
Tirumarai Selvan
b0f723b201 tag release v2.1.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2472
GitOrigin-RevId: b18f755b8db82ee6376d9af02495fe55cfd93aa8
2021-09-30 09:48:30 +00:00
Robert
fbd1262ea6 server: operation timeout with postgres cancelling
### Description

This PR implements operation timeouts, as specced in #1232.

RFC: [rfcs/operation-timeout-api-limits.md](c025a90fe9/rfcs/operation-timeout-api-limits.md)

There's still some things to be done (tests and docs most notably), but apart from that it can
be reviewed. I'd still appreciate feedback on the RFC!

TODO:
- [x] break out the `ApiLimits` refactoring into a separate PR: #2103
- [x] finish the `pg-client-hs` PR: https://github.com/hasura/pg-client-hs/pull/39
- [x] remove configurability, after testing, prior to merging
- [ ] tests: #2390 has some tests that I've run locally to confirm things work on a fundamental level
- [x] changelog
- [x] documentation
- [x] fill in the detailed PR checklist

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [x] Docs
- [ ] Tests

### Related Issues

Product spec: #1232.

### Solution and Design

Compare `rfcs/operation-timeout-api-limits.md`.

### Steps to test and verify

Configure operation timeouts, e.g. by posting

```
{
  "type": "set_api_limits",
  "args": {
    "operation_timeout": {
      "global": 3
    }
  }
}
```

to `v1/metadata` to set an operation timeout of 3s. Then verify that
1. non-admin queries that take longer than 3s time out with a nice error message
2. that those queries return after ~3s (at least for postgres)
3. also that everything else still works as usual

### Limitations, known bugs & workarounds
- while this will cause slow queries against any backends to fail, it's only verified to actually interrupt queries against postgres
- this will only successfully short-cut (cancel) queries to postgres if the database server is responsive

#### Catalog upgrade
Does this PR change Hasura Catalog version?
- [x] No

#### Metadata

Does this PR add a new Metadata feature?
- [x] Yes
  - Does `run_sql` auto manages the new metadata through schema diffing?
    - [x] Not required
  - Does `run_sql` auto manages the definitions of metadata on renaming?
    - [x] Not required
  - Does `export_metadata`/`replace_metadata` supports the new metadata added?
    - [x] Yes

#### GraphQL
- [x] No new GraphQL schema is generated

#### Breaking changes

- [x] No Breaking changes

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/1593
GitOrigin-RevId: f0582d0be3ed9fadf89e0c4aaf96344d18331dc4
2021-09-29 16:21:05 +00:00
Lyndon Maydwell
22bc0e09df Ignore unexpected fields in action responses
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2459
GitOrigin-RevId: 9269fa6e71770cb31183d917595b704c5dee9713
2021-09-29 09:54:36 +00:00
Solomon Bothwell
4e05bdcaec Feature/request transform string interpolation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2443
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: d7d68984d0ae1403bb414572e9704c01ed27deab
2021-09-29 08:14:29 +00:00
Vishnu Bharathi
2bc9a3b92e ci: add server test jobs in buildkite
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2416
GitOrigin-RevId: 5c4b58255447135f7f1e91ef7b3cb1ef1a8f347f
2021-09-29 04:56:02 +00:00
Solomon Bothwell
a7cc5df95d Fixes update_action transform bug and updates Kriti pin
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2399
GitOrigin-RevId: 009ee6ec2a3834951e464c232eb517d636ab940a
2021-09-28 01:38:24 +00:00
Phil Freeman
fb1bfe9db3 server: interpTraceT docs and small changes
Adds documentation for `interpTraceT` and simplifies some call sites.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2434
GitOrigin-RevId: 77e18c6b3419430153481114a721f9192abd17b5
2021-09-25 04:00:34 +00:00
Antoine Leblanc
636960787e Fix haddock generation and introduce PR check
On `main`, currently, haddock generation is broken, due to some unrecognized comments. This PR fixes this, and changes our `build_oss_server` CI job to ensure that future PRs do not break haddock.

https://github.com/hasura/graphql-engine-mono/pull/2222

GitOrigin-RevId: 909bbcdc7b2d31c9a3e947ce6b7691e23f59b916
2021-09-24 17:02:33 +00:00
Sameer Kolhar
51ad8a18c6 document recommended node version info in README
https://github.com/hasura/graphql-engine-mono/pull/2171

GitOrigin-RevId: 35725e8b652564b1c500c81d9ae38e7f87652d57
2021-09-24 10:20:01 +00:00
Sameer Kolhar
4ca2c7554c server: support user comments for trackable functions
https://github.com/hasura/graphql-engine-mono/pull/2290

GitOrigin-RevId: 3d7cf89b7e1d545475bad44ccc233b6f11145a01
2021-09-24 09:19:40 +00:00
Robert
11a454c2d6 server, pro: actually reformat the code-base using ormolu
This commit applies ormolu to the whole Haskell code base by running `make format`.

For in-flight branches, simply merging changes from `main` will result in merge conflicts.
To avoid this, update your branch using the following instructions. Replace `<format-commit>`
by the hash of *this* commit.

$ git checkout my-feature-branch
$ git merge <format-commit>^    # and resolve conflicts normally
$ make format
$ git commit -a -m "reformat with ormolu"
$ git merge -s ours post-ormolu

https://github.com/hasura/graphql-engine-mono/pull/2404

GitOrigin-RevId: 75049f5c12f430c615eafb4c6b8e83e371e01c8e
2021-09-23 22:57:37 +00:00
Robert
a206d04062 server, CI: use ormolu as a formatter for Haskell sources
### Description

- sets up a Makefile target for running ormolu to format and check source code
- updates CI to run ormolu instead of stylish-haskell (and to check instead of format actively)

Compare #1679.

Here's the plan for merging this:
1. merge this PR; at this point, all PRs will fail CI unless they have the `ignore-server-format-checks` label set
2. merge follow-up PR #2404 that does nothing but actually reformats the codebase
3. tag the merge commit as `post-ormolu` (also on `graphql-engine`, for the benefits of community contributors)
4. provide the following script to any devs in order to update their branches:
   ```
   $ git checkout my-feature-branch
   $ git merge post-ormolu^
   $ make format
   $ git commit -a -m "reformat with ormolu"
   $ git merge -s ours post-ormolu
   ```
   (I'll put this in the commit message)

https://github.com/hasura/graphql-engine-mono/pull/2020

Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
Co-authored-by: Swann Moreau <62569634+evertedsphere@users.noreply.github.com>
GitOrigin-RevId: 130f480a6d79967c8d045b7f3a6dec30b10472a7
2021-09-23 21:23:21 +00:00
awjchen
f1daabab04 docs, tests: update Explain API docs
https://github.com/hasura/graphql-engine-mono/pull/2352

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: f9f5d1157524afbe418ba0ca3e3e1d6258eaf9e3
2021-09-23 20:00:07 +00:00
Naveen Naidu
3d95c67748 server/query-tags: implement new metadata specification and API
https://github.com/hasura/graphql-engine-mono/pull/2203

GitOrigin-RevId: 6169fcce0c6dccaec055bf8e723e9aa7c19a7f0c
2021-09-23 12:38:56 +00:00
Rakesh Emmadi
cfd76a36bf server/mssql: improve mssql transactions
>

### Description
>
Few improvements to mssql transactions.

### Changelog

- [ ] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [ ] Docs
- [ ] Community Content
- [ ] Build System
- [ ] Tests
- [ ] Other (list it)

https://github.com/hasura/graphql-engine-mono/pull/2324

GitOrigin-RevId: 808947188f5f3d196c7dfc4ebfa661629db5f8f7
2021-09-23 09:10:28 +00:00
Robert
bdacf1bd23 server: remove ApplicativeDo from default extensions
I spent half the day reducing a weird compile failure here https://github.com/hasura/graphql-engine-mono/pull/1593/files#r713102990 to this https://gitlab.haskell.org/ghc/ghc/-/issues/17768#note_378004. Seems ApplicativeDo makes a mess of non-applicative monadic do in some cases. Given our rather localized use of ApplicativeDo, seemed a good idea to remove it from the list of default extensions.

It appears that ApplicativeDo also buries some unused return value warnings, so this PR also silences those. We should check that none of those warnings were warranted though.

https://github.com/hasura/graphql-engine-mono/pull/2413

GitOrigin-RevId: 1874c1a82230431849265755b1407beebc947041
2021-09-22 15:35:54 +00:00
jkachmar
112d206fa6 Adds Remote Source Join Execution
https://github.com/hasura/graphql-engine-mono/pull/2038

Co-authored-by: Phil Freeman <630306+paf31@users.noreply.github.com>
GitOrigin-RevId: 0843bd0610822469f727d768810694b748fec790
2021-09-22 10:44:01 +00:00
Evie Ciobanu
1843ee7b0b [server] fix LIMIT optimization not respecting ORDER BY
https://github.com/hasura/graphql-engine-mono/pull/2239

Co-authored-by: Gil Mizrahi <8547573+soupi@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: fabc825239950b11d673cfd33e8075a01409bcf6
2021-09-21 10:40:24 +00:00
Antoine Leblanc
21254256a1 Improve error messages of Metadata API.
### Description

This PR improves error messages in our metadata API by displaying a message with the name of the failing command and a link to our documentation. Furthermore, it harmonizes our internal uses of `withObject`, to respect the convention of using the Haskell type name, now that the Aeson error message is displayed as an "internal error message".

https://github.com/hasura/graphql-engine-mono/pull/1905

GitOrigin-RevId: e4064ba3290306437aa7e45faa316c60e51bc6b6
2021-09-20 19:50:22 +00:00
pranshi06
e77b79ae02 [server] Add GraphQL query in the payload for Synchronous Actions
https://github.com/hasura/graphql-engine-mono/pull/2224

GitOrigin-RevId: 9eb1ab612f1a6cc8fe8490272be3d5a997b5b097
2021-09-20 18:20:33 +00:00
Karthikeyan Chinnakonda
ccf97ab6b0 server: improve event trigger logging
https://github.com/hasura/graphql-engine-mono/pull/2286

GitOrigin-RevId: b3232a08dd7ec2aa0c9e7a2fada0e05e34a1897b
2021-09-20 14:32:31 +00:00
Aniket Deshpande
d358d06e68 MSSQL: custom-check based permissions _exists uses wrong table graphql-engine#7429
https://github.com/hasura/graphql-engine-mono/pull/2317

GitOrigin-RevId: 2ea6c69811d06676c6ea7cf5371c28f021037d72
2021-09-20 10:27:14 +00:00
Karthikeyan Chinnakonda
5f79b5f102 server: generalize the event triggers codepath for all backends
https://github.com/hasura/graphql-engine-mono/pull/2189

Co-authored-by: hasura-bot <30118761+hasura-bot@users.noreply.github.com>
Co-authored-by: Martin Mark <74692114+martin-hasura@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <1618949+nicuveo@users.noreply.github.com>
Co-authored-by: Matt Hardman <28978422+mattshardman@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
GitOrigin-RevId: 97c71571656c6e0c57d06f2d38193833180901c0
2021-09-20 07:35:49 +00:00
Rakesh Emmadi
9ca0bc1e5c server: remove identity notion from table columns
>

### Description
>
While adding [insert mutation schema parser for MSSQL backend](https://github.com/hasura/graphql-engine-mono/pull/2141) I also included [identity](https://en.wikipedia.org/wiki/Identity_column) notion to table columns across all backends. In MSSQL we cannot insert any value (even `DEFAULT` expression) into Identity columns. This behavior of identity columns is not same in Postgres as we can insert values. This PR drops the notion of identity in the column info. The context of identity columns for MSSQL is carried in `ExtraTableMetadata` type.

### Changelog

- [x] `CHANGELOG.md` is updated with user-facing content relevant to this PR. If no changelog is required, then add the `no-changelog-required` label.

### Affected components

- [x] Server
- [ ] Console
- [ ] CLI
- [ ] Docs
- [ ] Community Content
- [ ] Build System
- [x] Tests
- [ ] Other (list it)

### Related Issues
->
Fix https://github.com/hasura/graphql-engine/issues/7557

https://github.com/hasura/graphql-engine-mono/pull/2378

GitOrigin-RevId: c18b5708e2e6107423a0a95a7fc2e9721e8a21a1
2021-09-17 09:03:06 +00:00
Swann Moreau
8bfcd9a55c server: add "extensions" field to action webhook error schema
https://github.com/hasura/graphql-engine-mono/pull/1698

GitOrigin-RevId: c3b6f1048b6702a53ebe6c49f23dedc0f1d88090
2021-09-17 07:44:37 +00:00
Robert
d900a65399 server: Reduce and localize CPP usage
Some of our use of CPP causes trouble for ormolu, compare https://github.com/tweag/ormolu/issues/774.
Specifically, for understandable reasons, it can't deal well with `#ifdef` use that is not at the top-level.

This PR removes the problematic usage in ways that I hope are also a net non-loss regardless of helping
out ormolu (or other tooling).

- The default value for enabled APIs moves to the top level, next to the command line help, so
  they'll stay in sync more easily.
- All the CPP around using `assertNFHere` is moved to one module.

https://github.com/hasura/graphql-engine-mono/pull/2361

GitOrigin-RevId: ed6e039e6d8960322fd8d1312df762ad197c29b1
2021-09-16 18:52:37 +00:00
Robert
260202e0fa build: use shared root cabal.project for ci-build targets
This change was prompted by how `make ci-build` in `./server` clobbered my
`cabal.project.local`. Addressing that more directly proved awkward, thus this
change, which makes both `ci-build` targets use a shared `/cabal.project.ci.*`
(via `--with-project-file`).

Also removes some pro targets/scripts which were definitely broken thus unused.

### Affected components
- [x] Build System

### Steps to test and verify

If CI still passes, this should be safe.

https://github.com/hasura/graphql-engine-mono/pull/2244

GitOrigin-RevId: 1494824cabd2fbe6415d050c19e27f37bb51b86b
2021-09-16 17:21:00 +00:00
Karthikeyan Chinnakonda
169a49f2bb server: export metadata V2 should not export cron triggers with included_in_metadata: false
https://github.com/hasura/graphql-engine-mono/pull/2366

GitOrigin-RevId: 88c3a5a1f10ea1cf0e2192c69da5cc4147f70ae3
2021-09-16 15:08:45 +00:00
Antoine Leblanc
07fd7324c3 server: enable StrictData by default (fix hasura/graphql-engine#3941)
## Description

Almost all our data structures use strictness annotations, following [our styleguide's principle](https://github.com/hasura/graphql-engine/blob/master/server/STYLE.md#dealing-with-laziness) of "by default, use strict data types and lazy functions". The very few cases where we actually need laziness were already explicitly labelled as lazy with the `~` prefix operator.

This PR simply globally enables `StrictData`, allowing us to express records without `!()` on every field, but makes no attempt at cleaning existing code.

https://github.com/hasura/graphql-engine-mono/pull/1869

Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: e65c6e2f89413188da250122f64c2173615946ec
2021-09-16 12:23:15 +00:00
Solomon Bothwell
af5ff07614 Request Transformations
https://github.com/hasura/graphql-engine-mono/pull/1984

Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
GitOrigin-RevId: 1767d6bdde48c156fe171b5a9b7e44d7f2eb4869
2021-09-16 11:03:57 +00:00
David Overton
7c77c81cf9 return original schema in introspect_remote_schema
https://github.com/hasura/graphql-engine-mono/pull/2364

GitOrigin-RevId: 99698aa977bf8ff85e29d67a0956ff1509cd30be
2021-09-16 09:07:18 +00:00
Antoine Leblanc
e2ce1972f6 Prevent empty subscription roots (fix hasura/graphql-engine#6898)
### Description

We always build a subscription root, even when there was no possible fields. This breaks some third party clients, as the spec does not allow empty types in the schema. This PR fixes this by changing the `buildSubscriptionParser` helper to return a `Maybe` value, and harmonizes / cleans places where we build the subscription root.

https://github.com/hasura/graphql-engine-mono/pull/2357

GitOrigin-RevId: 1aeae25e321eee957e7645c436d17e69207309fd
2021-09-16 07:42:46 +00:00
Antoine Leblanc
9bae641ac4 Always enable inherited roles tests
### Description

The inherited roles integration tests were behind a flag, and its corresponding fixture, presumably to avoid enabling the option globally. However, #2288 introduced a new test using inherited roles that was not gated behind the flag, which fails when run with `dev.sh`. However, that test works on CI... because inherited roles are globally enabled there.

Consequently, this PR:
- globally enables inherited roles in dev.sh
- removes the flag and the associated fixture

https://github.com/hasura/graphql-engine-mono/pull/2358

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: ebfa6754873324bed15b2cc5e37ec2d8008e8f8d
2021-09-16 06:24:54 +00:00
Robert
fe035125f4 server: drop LazyTxT newtype
This is a follow-up to #1959.

Today, I spent a while in review figuring out that a harmless PR change didn't do anything,
because it was moving from a `runLazy...` to something without the `Lazy`. So let's get
that source of confusion removed.

This should be a bit easier to review commit by commit, since some of the functions had
confusing names. (E.g. there was a misnamed `Migrate.Internal.runTx` before.)

The change should be a no-op.

https://github.com/hasura/graphql-engine-mono/pull/2335

GitOrigin-RevId: 0f284c4c0f814482d7827e7732a6d49e7735b302
2021-09-15 20:46:45 +00:00
Abby Sassel
9b7234b861 server/bigquery: add explicit order_by argument to fix non-deterministic test failures
https://github.com/hasura/graphql-engine-mono/pull/2355

GitOrigin-RevId: d2e088e1f1edd3c4bb2912b285fde8feeb3889ed
2021-09-15 15:44:45 +00:00
Antoine Leblanc
a5589c185b Fix nullability of nested objrel inserts (fix hasura/graphql-engine#7484)
### Description

During the PDV refactor that led to 2.0, we broke an undocumented and untested semantic of inserts: accepting _explicit_ null values in nested object inserts.

In short: in the schema, we often distinguish between _explicit_ null values `{id: 3, author: null}` and _implicit_ null values that correspond to the field being omitted `{id: 3}`. In this particular case, we forgot to accept explicit null values. Since the field is optional (meaning we accept implicit null values), it was nullable in the schema, like it was in pre-PDV times. But in practice we would reject explicit nulls.

This PR fixes this, and adds a test. Furthermore, it does a bit of a cleanup of the Mutation part of the schema, and more specifically of all insertion code.

https://github.com/hasura/graphql-engine-mono/pull/2341

GitOrigin-RevId: 895cfeecef7e8e49903a3fb37987707150446eb0
2021-09-15 13:11:48 +00:00
Antoine Leblanc
75d374bf26 Add new documentation folder and two documentation files
As discussed on Slack, we're thinking of updating the documentation that was in the old graphql-engine wiki, and bring it to the repo. This PR creates the new folder, and adds two pieces of documentation: a high-level overview of the system, and a description of our schema-building code (the so-called "PDV parsers").

One thing to be discussed: how do we do cross-file references? To an extent, this will depend on what tool we use for rendering them, to where we upload the generated files.

Another point is: we should update our CI to avoid running tests on changes in `server/documentation`.

Rendered:
- [high level overview](https://github.com/hasura/graphql-engine-mono/blob/nicuveo/server-docs/server/documentation/overview.md)
- [schema code](https://github.com/hasura/graphql-engine-mono/blob/nicuveo/server-docs/server/documentation/schema.md)

https://github.com/hasura/graphql-engine-mono/pull/2219

GitOrigin-RevId: f729616d28e8f2f30c0a07583b53460510bafd80
2021-09-15 10:04:24 +00:00
Karthikeyan Chinnakonda
982b5a3d15 server: log operation details for each query in a batch query execution
https://github.com/hasura/graphql-engine-mono/pull/2306

GitOrigin-RevId: 066a02fc57711b1faad447e6e448e3e004376c74
2021-09-15 08:30:32 +00:00