Commit Graph

926 Commits

Author SHA1 Message Date
Vishnu Bharathi
bf6c91c7c7 ci: tag release v2.5.0 and v2.6.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4257
Co-authored-by: Alberto Francesco Motta <36401353+afmotta@users.noreply.github.com>
GitOrigin-RevId: 6dbed1919a8b5bd521aa76a16d460fc11bfc5fcc
2022-04-13 08:49:28 +00:00
Vijay Prasanna
2811490a67 console: allow users to create bigquery-to-RS and mssql-to-RS relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4244
Co-authored-by: Alberto Francesco Motta <36401353+afmotta@users.noreply.github.com>
GitOrigin-RevId: 996709ddbc7504b143f46379dd91c117729c771e
2022-04-13 07:22:09 +00:00
Auke Booij
4a7bd4edcd Update hasura/pool to avoid a resource leak
See hasura/pool#7

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4253
GitOrigin-RevId: 6e88870d05339ed5f466cce13ba6add3cb755d78
2022-04-12 14:30:34 +00:00
Matt Hardman
1f1749a230 console: allow RS-to-DB edit & delete [CON-99]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4229
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 3c06ecfb14137e7314518821ccc56ba53f92ee6d
2022-04-12 13:36:17 +00:00
Naveen Naidu
bdff49fd55 server: redact sensitive info from logs for metadata queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4072
GitOrigin-RevId: 8e6043878ec4b4f073744614ddc9c7046ca93c82
2022-04-11 17:50:22 +00:00
Vijay Prasanna
fd0f10f589 console: enable bigquery as an option in RS-to-DB remote joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4233
GitOrigin-RevId: 9ca1006d200b18f8dfeb37475b7e0df0a05fc8c9
2022-04-11 16:56:07 +00:00
Alberto Francesco Motta
e1443981d4 [CON-130] Add a feature flag for RS relationships tab
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4184
GitOrigin-RevId: d96a64571bdbe52fd96b0a1a92cd883dbbb27d28
2022-04-11 14:58:23 +00:00
Abhijeet Khangarot
99878d9c00 console: enable mssql for db-to-remoteDb and RS-to-DB relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4243
GitOrigin-RevId: fe0f7e5d8f562ec0fae5204facd289f6a32346a5
2022-04-11 14:01:18 +00:00
Naveen Naidu
d10b862b61 server: fix bugs in clear_metadata code path
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3927
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
Co-authored-by: Karthikeyan Chinnakonda <15602904+codingkarthik@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 6f3457698029af94e9157c23b552ac2034f9c740
2022-04-11 11:25:13 +00:00
Rakesh Emmadi
d561024254 server/postgres/citus: fix inserting values into columns with case sensitive enum types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4196
GitOrigin-RevId: bbb9e565bc7143080eb1c50ade86b0e47b751387
2022-04-11 08:05:25 +00:00
Vamshi Surabhi
bafd5be2b2 enable remote relationship metadata APIs on SQLServer
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4187
GitOrigin-RevId: 3e2a7734198df7758fc75610f4bcbd8e65a1c9de
2022-04-07 15:48:49 +00:00
Sooraj
419b19c9e7 Integrate the RS-to-RS form into Remote Schema Relationship tab [CON-98]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4107
Co-authored-by: Matt Hardman <28978422+mattshardman@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 32a21e0733fbaeb82a0870bdabbe0122f9382d96
2022-04-07 13:27:35 +00:00
hasura-bot
4c1c4cd773 fix(console): actions search case insensitive (close #6351)
GITHUB_PR_NUMBER: 8368
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8368

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4144
Co-authored-by: Alex Parra <10448714+alex-parra@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Alberto Francesco Motta <36401353+afmotta@users.noreply.github.com>
GitOrigin-RevId: ea782e59e9e1a7ded032aa3821012dfaa2aa34db
2022-04-06 09:21:21 +00:00
Evie Ciobanu
42480ee902 server: X -> MSSQL remote joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4097
GitOrigin-RevId: f39b82bac26f6ade83bd4f5e996dc26f5e048365
2022-04-06 07:20:10 +00:00
Auke Booij
dfd09159ec Fix JSON encoding issue (fix hasura/graphql-engine#7543 and hasura/graphql-engine#8200)
`encJFromAssocList` is broken since it does not appropriately escape the keys of the JSON dictionaries. Presumably it should.

This is a hotfix for a JSON encoding issue. Longer-term solutions are being discussed in hasura/graphql-engine-mono#3736.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4139
GitOrigin-RevId: 27afff319d268a4ec017c8eafd694cc17c2fd7f0
2022-04-05 19:11:30 +00:00
Rakesh Emmadi
3f36b7c956 server/mssql: fix SQL generation for check constraints with relationships (fix #8225)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4136
GitOrigin-RevId: 5fe54fe2118ac0309f5ed39696214f9b22768edf
2022-04-05 10:10:32 +00:00
Tirumarai Selvan
8ef270404a support for graphql-ws is considered GA
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4155
GitOrigin-RevId: 40033eb41849e88fc1b7a84a607ae9ce4abccf0b
2022-04-05 08:50:57 +00:00
Rikin Kachhia
bdd76adc74 console: remove need for clicking Modify before editing remote schema
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4092
Co-authored-by: hasura-bot <30118761+hasura-bot@users.noreply.github.com>
GitOrigin-RevId: b318e4d8f7c3d94a4b0aa5b55db9847e66cb6004
2022-04-05 06:06:20 +00:00
Vijay Prasanna
d850086479 console: add RS-to-DB (only postgres & citus) relationships feature to remote schemas tab [CON-96]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4123
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 23c897b33d9051046ecf8a8837489318dd822c20
2022-04-04 19:37:16 +00:00
Antoine Leblanc
b4f7e96665 Rewrite GraphQL.Analysis
### Motivation

While we strive to write clear code, we have historically struggled at Hasura with having very different styles and standards across the codebase. There's been efforts to standardize our coding style, we have an official styleguide that isn't maintained as closely as it should... We still have some work in front of us.

However, in the last ~year or so, there's been a huge push towards incrementally improving the situation. As part of this we've been blocking PRs that don't add enough comments, or don't improve the files that they touch.

While looking at `Hasura.GraphQL.Analyse`, it became apparent that this file did not meet the engineering standards that I would expect to see addressed during a code review. Some ways in which I think it falls short:
- lack of documentation
- no clear distinction between public / internal components
- "unidiomatic" Haskell code (such as using `Either Result Error`)

While there's no problem with a file looking like this during development, those issues should have been caught at review time. The fact that they weren't indicates a problem in our process that we will need to address: code quality and maintainability is paramount, and we all need to do our part.

### Description

This PR rewrites all of `Hasura.GraphQL.Analyze`, and adapts `Hasura.Server.OpenAPI` accordingly where needed. I've attempted to clarify names and add documentation based on my understanding of the code, and to clean what was unused (such as field variables). I don't think this PR is good enough as is, and I welcome criticism where I got my comments wrong / am happy to help y'all add more.

This PR makes one small change in the way error messages are reported (and adjusts the corresponding test accordingly); each error message is now prefixed with the path within the selection set:
```
⚠️ $.test.foo.bar.baz.mizpelled: field 'mizpelled' not found in object 'Baz'
```

### Note

This PR is currently **on top of #3962**. You can preview the changes in isolation by [diffing the branches](https://github.com/hasura/graphql-engine-mono/compare/nicuveo/clean-rest-endpoint-inconsistency-check..nicuveo/rewrite-analysis).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3963
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 5ec38e0e753f0c12096a350db0737658495e2f15
2022-04-04 05:54:59 +00:00
Aravind K P
e46777b7ea cli: fix formatting errors in query collection metadata
closes https://github.com/hasura/graphql-engine/issues/7616
closes https://github.com/hasura/graphql-engine/issues/8205

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3955
GitOrigin-RevId: dc97e23e78d522cb7ac4d57ad825526eaa90a4de
2022-03-31 14:02:49 +00:00
Rikin Kachhia
127bdcdf5c console: enable mssql aggregation query permissions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4125
GitOrigin-RevId: c57c1f6cff409033ec8e73297ddcc8235cf71d52
2022-03-31 12:39:19 +00:00
Aravind K P
649ef41e3c cli: fix remote schema formatting errors in metadata
closes https://github.com/hasura/graphql-engine/issues/7608
closes https://github.com/hasura/graphql-engine/issues/7459

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3951
GitOrigin-RevId: bad3505c79fab10453580a6a43ad7e71bc2d3753
2022-03-31 08:28:30 +00:00
Rakesh Emmadi
22a5ebf287 server/bigquery: improve throwing upstream exceptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4095
GitOrigin-RevId: e19ffe058aaffa1cfa8d155f2e3a6ecafd6aab13
2022-03-30 13:54:18 +00:00
Vishnu Bharathi
a3c707b718 ci: tag release v2.4.0 and v2.5.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4106
GitOrigin-RevId: 83594358cf511e7b5e1cd7d48a28e3e397a20682
2022-03-30 07:33:44 +00:00
Rikin Kachhia
cb75226cf1 update changelog for v2.5.0-beta
<!-- Thank you for ss in the Title above ^ -->

## Description ✍️
<!-- Please fill this se-->
<!-- Describe the changes from a user's perspective -->

update changelog

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4099
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 5ac6a6bd36f2d0ebf7bd6873a0ea1d297fb92fe1
2022-03-30 04:03:19 +00:00
Daniel Chambers
5873429e54 console: Improved computed field comment support [CON-94]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3946
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: dfedf0f76c008b958630f66b58a59530e567a23d
2022-03-29 09:21:28 +00:00
Vijay Prasanna
9ba1e3993e console: Fix REST live preview malformed request
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4005
GitOrigin-RevId: 0c16c3804a047061f3a798f48024161c07323c48
2022-03-25 09:56:06 +00:00
Sooraj
df23bdb5f0 console: redirect to metadata status page on conflicting inherited role [CON-95]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4063
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: cdf5f835f9bf641f2f8d8e356403e3bfd2352f5a
2022-03-24 08:15:10 +00:00
Daniel Chambers
cb1722694e console: Support custom comments for root fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3930
Co-authored-by: Martin Mark <74692114+martin-hasura@users.noreply.github.com>
GitOrigin-RevId: 91c71d8ab2c4886b395f5237ca71cace9ec61d1a
2022-03-24 00:30:52 +00:00
Vishnu Bharathi
1a60d4f7f4 ci: tag release v2.4.0-beta.3 and v2.4.0-beta.3-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4052
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 99c03ed16d624f50bc71cd47417f024c1c7586d9
2022-03-23 11:18:22 +00:00
Alberto Francesco Motta
121f183231 Add Feature Flags section in Settings
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4018
GitOrigin-RevId: 418fe0c10b5f1ce17a984399a3f773a9a76f83ea
2022-03-23 10:57:17 +00:00
Vishnu Bharathi
fac5e0b2c3 ci: produce ubuntu and centos flavoured graphql-engine images
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3597
GitOrigin-RevId: f1fded72524f28f41433eea6819276932ee0b5cb
2022-03-22 12:03:25 +00:00
Antoine Leblanc
5920134dcb Decouple Analyse and OpenAPI from remote schema introspection and internal execution details.
### Motivation

#2338 introduced a way to validate REST queries against the metadata after a change, to properly report any inconsistency that would emerge from a change in the underlying structure of our schema. However, the way this was done was quite complex and error-prone. Namely: we would use the generated schema parsers to statically execute an introspection query, similar to the one we use for remote schemas, then parse the resulting bytestring as it were coming from a remote schema.

This led to several issues: the code was using remote schema primitives, and was associated with remote schema code, despite being unrelated, which led to absurd situations like creating fake `Variable`s whose type was also their name. A lot of the code had to deal with the fact that we might fail to re-parse our own schema. Additionally, some of it was dead code, that for some reason GHC did not warn about? But more fundamentally, this architecture decision creates a dependency between unrelated pieces of the engine: modifying the internal processing of root fields or the introspection of remote schemas now risks impacting the unrelated `OpenAPI` feature.

### Description

This PR decouples that process from the remote schema introspection logic and from the execution engine by making `Analyse` and `OpenAPI` work on the generic `G.SchemaIntrospection` instead. To accomplish this, it:
- adds `GraphQL.Parser.Schema.Convert`, to convert from our "live" schema back to a flat `SchemaIntrospection`
- persists in the schema cache the `admin` introspection generated when building the schema, and uses it both for validation and for generating the `OpenAPI`.

### Known issues and limitations

This adds a bit of memory pressure to the engine, as we persist the entire schema in the schema cache. This might be acceptable in the short-term, but we have several potential ideas going forward should this be a problem:
- cache the result of `Analyze`: when it becomes possible to build the `OpenAPI` purely with the result of `Analyze` without any additional schema information, then we could cache that instead, reducing the footprint
- caching the `OpenAPI`: if it doesn't need to change every time the endpoint is queried, then it should be possible to cache the entire `OpenAPI` object instead of the schema
- cache a copy of the `FieldParsers` used to generate the schema: as those are persisted through the GraphQL `Context`, and are the only input required to generate the `Schema`, making them accessible in the schema cache would allow us to have the exact same feature with no additional memory cost, at the price of a slightly slower and more complicated process (need to rebuild the `Schema` every time we query the OpenAPI endpoint)
- cache nothing at all, and rebuild the admin schema from scratch every time.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3962
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: a8b9808170b231fdf6787983b4a9ed286cde27e0
2022-03-22 07:37:49 +00:00
Philip Lykke Carlsen
23520f67d0 (Fix #8267) Handle subscriptions in MSSQL when results exceed 2048 characters
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3959
GitOrigin-RevId: ea037c9dc4392d1b98ee086f6c87f79ce8ea5c8f
2022-03-21 12:16:14 +00:00
Gil Mizrahi
f06bff4008 server/mssql: respect custom field names in delete, insert and update mutations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3987
GitOrigin-RevId: c1c4e32c7553e9f1febd55cd4ed49d8c1a83ea03
2022-03-18 10:05:49 +00:00
Antoine Leblanc
ccea1da1d5 Enable and test remote relationships from remote schemas.
### Description

This is it! This PR enables the Metadata API for remote relationships from remote schemas, adds tests, ~~adds documentation~~, adds an entry to the Changelog. This is the release PR that enables the feature.

### Checklist
- [ ] Tests:
  - [x] RS-to-Postgres (high level)
  - [x] RS-to-RS (high level)
  - [x] From RS specifically (testing for edge cases)
  - [x] Metadata API tests
  - [ ] Unit testing the actual engine?
- [x] Changelog entry
- [ ] Documentation?

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3974
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
GitOrigin-RevId: c9aebf12e6eebef8d264ea831a327b968d4be9d2
2022-03-17 20:54:57 +00:00
Vishnu Bharathi
59be818d3a ci: tag release v2.3.1 and v2.4.0-beta.2
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3989
Co-authored-by: Tom Skawinski <98830547+tomhasura@users.noreply.github.com>
GitOrigin-RevId: 65a992e9d44093596d72fbd64acc37518b8ca911
2022-03-17 07:44:42 +00:00
Varun Choudhary
7eb59330b1 console: call dependentSQLGenerator while adding column to a table from modify tab
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3995
GitOrigin-RevId: 5acba7950cdccd2cc1f8a2f8c6b4b16153cd06f0
2022-03-16 13:41:58 +00:00
Sooraj
d1cdb9f0ae console: disable search indexing with HTML meta tag [CON-28]
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3948
GitOrigin-RevId: 5af852fd7c9c131fc85c05f97c601058c99e6dcc
2022-03-16 05:51:47 +00:00
Gil Mizrahi
4cd72d738a Improve changelog entry for 8221
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3985
GitOrigin-RevId: c1c2a56ff1e73be09ec43e1a1469a73f3c8a6bcb
2022-03-15 15:17:18 +00:00
Daniel Chambers
69501b2657 server: Use max-age when refreshing JWKs if must-revalidate is present
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3979
GitOrigin-RevId: 5f5ebfb25ff9729e34397084d86b0fe968099b25
2022-03-15 07:36:43 +00:00
David Overton
2a934df0bc Fix bad changelog merge after v2.2.2 release
Fix changelog merge from 2.2.2

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3977
GitOrigin-RevId: 19f0d9b4362cf988c0b156a7b7125969f4ce984f
2022-03-15 05:34:22 +00:00
Gil Mizrahi
92ab93775f server/mssql: Implement column presets
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3856
GitOrigin-RevId: 8527749c33df1a5bdde29338630714e673e308ab
2022-03-14 15:35:15 +00:00
Rishichandra Wawhal
bd05e242d5 console: data sidebar table search
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3826
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: a7de40686c9d3f1551e84aeec376ff143935a97a
2022-03-14 13:49:44 +00:00
Solomon
ca85acbfe3 Feature/improved webhook debug endpoint errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3782
Co-authored-by: Abhijeet Khangarot <26903230+abhi40308@users.noreply.github.com>
GitOrigin-RevId: 404197e766efa94a1814e8a0287cd55d9175f2a7
2022-03-10 23:23:55 +00:00
Vishnu Bharathi
2e04bd5ac2 cli: add support for customization field in sources metadata
closes https://github.com/hasura/graphql-engine/issues/8292

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3954
GitOrigin-RevId: cc27dcffbb71579136a3cae7d99ecd239eb37ed2
2022-03-10 16:47:03 +00:00
Aravind K P
2ff0f25e08 cli: refactor metadataobject package
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3943
GitOrigin-RevId: 4cc8f67dd8b6ba0e78f1c35d415f89bd1b901705
2022-03-10 08:13:50 +00:00
hasura-bot
4ec9229f15 add jsonb to string cast support for postgres (fix #6577, #2602)
GITHUB_PR_NUMBER: 7818
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7818

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2898
Co-authored-by: Teo Stocco <9053709+zifeo@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 1100f3ce44ea07867a2d7de5b6bb059510f100e1
2022-03-10 07:32:59 +00:00
Daniel Chambers
a8424c48a1 Customize column GraphQL schema descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3888
GitOrigin-RevId: 027c319a66671a44fc6e5506bdfc9d2c10a8569f
2022-03-09 06:35:46 +00:00
Rakesh Emmadi
aa19f1e0d0 server/postgres: improve fetching tables' and functions' metadata (from database)
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3778
GitOrigin-RevId: 13bb97bdb7afad265db899f368c74d9f240b214a
2022-03-08 13:03:14 +00:00
paritosh-08
0775c00b0d server: add validation for query collections
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3658
GitOrigin-RevId: 3c644da15c92cac16356985d0fe0c6adb7001862
2022-03-08 09:49:18 +00:00
David Overton
2792f515d4 Traverse variables in action remote joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3864
GitOrigin-RevId: 0fb624260db46474056ee323638d9be7d074b3fc
2022-03-08 08:23:20 +00:00
Solomon
d67d4e2310 Webhook Transform Cleanup / Refactor
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3624
GitOrigin-RevId: 849e6dd70d6fe3d84056a485b20928ff813881d4
2022-03-08 00:43:08 +00:00
Rakesh Emmadi
878f6108e6 server/bigquery: apply 'order by' to 'array_agg' projection inside an array relationship join sub-query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3824
GitOrigin-RevId: b1739c35fb2c387152729d3ff72c6ff7ef9b9118
2022-03-07 10:13:02 +00:00
Vishnu Bharathi
e73f187db4 ci: tag release v2.2.2 and v2.2.2-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3889
GitOrigin-RevId: 84abcfe6070e39ae3a85a3ff0098eff18d93e278
2022-03-07 08:35:13 +00:00
Auke Booij
2abe02c672 Fix #3635
In hasura/graphql-engine#5144, we noticed that having remote relationships in the schema is problematic for Relay. In particular, we don't support remote schemas in Relay at all, and because of this, remote relationships were also broken.

The fix was easy: when we're building the schema for Relay, whenever we encounter a remote relationship in our configuration, we simply skip building that field. The implementation was easy: (see hasura/graphql-engine#5145)
```diff
-    SFRemoteRelationship info -> pure $ mkRemoteRelationshipFld info
+    SFRemoteRelationship info ->
+      -- https://github.com/hasura/graphql-engine/issues/5144
+      if isRelay then [] else pure $ mkRemoteRelationshipFld info
```
A test case was added in that PR to prevent us from accidentally re-including remote relationships in the Relay schema. (However, it now looks like that test case does not function correctly.)

The above code was later refactored in #3037, making use of the `MaybeT` effect. However, this effect was not used correctly, so that the result of the check was ignored.

This fixes the code to use the `MaybeT` effect correctly.

CC @0x777 @rakeshkky

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3868
GitOrigin-RevId: e528303e01eacf60173cba1eec1898986cf12359
2022-03-03 15:01:25 +00:00
paritosh-08
a0c83b8e99 server: add inconsistency information in reload_metadata API call
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3860
GitOrigin-RevId: 02d1963946d69fdf6886aa61806eb71db60f8931
2022-03-03 13:34:44 +00:00
David Overton
1eb7fe5999 Nested action joins
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3613
GitOrigin-RevId: 95fdb317a1052bdc440865f2dc8c5897e8531539
2022-03-03 03:44:20 +00:00
Solomon
876300c049 Adds x-www-form-urlencoded body transformation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3764
GitOrigin-RevId: 60ce63496d94406476dd446a498d7a7d625465be
2022-03-02 19:43:22 +00:00
Vishnu Bharathi
eed47e973a ci: tag release for v2.3.0 and v2.4.0-beta.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3853
Co-authored-by: Alberto Francesco Motta <36401353+afmotta@users.noreply.github.com>
GitOrigin-RevId: ce28cdb679e6c2dda85c7309f81ee19f5f8ab714
2022-03-02 14:01:17 +00:00
Varun Choudhary
c82fdc4253 console: fixed an issue where cron triggers where not removed from the list after deletion
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3838
Co-authored-by: Alberto Francesco Motta <36401353+afmotta@users.noreply.github.com>
GitOrigin-RevId: ebfe928fb6c966898ad88d97f114abf500a6af19
2022-03-02 09:28:08 +00:00
Rikin Kachhia
8b88d15f06 console: only show tables from current schema in clone permissions section
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3823
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: ec47f1578c89bea42fbe5db0b742a7058604c4b8
2022-03-02 06:11:40 +00:00
Solomon
deb3baa504 Bug fix/webhook transforms header filtering
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3795
Co-authored-by: Lyndon Maydwell <92299+sordina@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 60becefedebbc89a9580c7989a0212903a843d25
2022-03-01 22:55:46 +00:00
Abhijeet Khangarot
0d120471cd console: provide checkbox to remove body in rest connectors v2
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3544
GitOrigin-RevId: 2beb58f09577bda72470fb0deb1099287ab4c8a9
2022-03-01 15:22:03 +00:00
Vishnu Bharathi
661bfeb153 ci: tag release v2.3.0-beta.3 and v2.3.0-beta.3-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3821
GitOrigin-RevId: 1220a68e4a03f22814dad2cc8b556a3a32b6f0f4
2022-02-28 13:56:51 +00:00
Varun Choudhary
9ca658a4f6 console: show an error notification if Hasura CLI migrations fail
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3786
GitOrigin-RevId: f63ccbcd99ad0e992cee9a6029a1f9af02ef1d1b
2022-02-28 10:47:58 +00:00
Daniel Chambers
0f9f2192a0 server: Customize root field GraphQL schema descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3719
GitOrigin-RevId: b0a9bb6a0f65aac72ca95b66219eec16b2f5a0dd
2022-02-28 07:50:12 +00:00
kodiakhq[bot]
1181625173 server: optimize collectTypeDefinitions and refactor
Numbers from CI for the new (currently noisy) `replace_metadata` adhoc benchmark:

    chinook:      0.19s  ->  0.16
    huge_schema: 36.98s  ->  29.89

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3685
GitOrigin-RevId: be79b666858b03e8407c0d89765e9aac0af8d40a
2022-02-24 18:56:22 +00:00
paritosh-08
bc74046ab2 server: case insensitive lookup in session variable
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3663
GitOrigin-RevId: b36666d8849a23dad209f9921f140390c2b57496
2022-02-24 13:08:35 +00:00
Varun Choudhary
f43704fb4a console: include cron trigger with include in metadata as false on cron trigger manage page
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3745
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 373c7e60cb4314392861a5a12ac10bbb620fb387
2022-02-24 11:21:36 +00:00
Vishnu Bharathi
faf9716c28 ci: tag release v2.2.1 and v2.2.1-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3785
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 90bcd2a062268c6c20d4006505574c5db5b88b81
2022-02-24 10:33:40 +00:00
Divi
d87b961378 cli: fix metadata version being set to 3 for v2 project
closes https://github.com/hasura/graphql-engine/issues/8148

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3619
GitOrigin-RevId: d10b715fc71dcc89bb0874f1c115ad9e562cfd6c
2022-02-23 10:53:22 +00:00
Vishnu Bharathi
0e988bcbf4 ci: tag release v2.3.0-beta.2 and v2.3.0-beta.2-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3756
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: d93845719f1c0e7318453da296a7fb6b2a2f3e74
2022-02-22 13:13:20 +00:00
Auke Booij
7547786b2b Build introspection Schema ad-hoc at parsing time
In order to respond to GraphQL queries that make use of the introspection fields `__type` or `__schema`, we need two things:
- an overview of the relevant GraphQL type information, stored in a `Schema` object, and
- to have included the `__type` and `__schema` fields in the `query_root` that we generate.

It used to be necessary to do the above items in that order, since the `__type` and `__schema` fields (i.e. the respective `FieldParser`s) were generated _from_ a `Schema` object.

Thanks to recent refactorings in `Hasura.GraphQL.Schema.Introspect` (see hasura/graphql-engine-mono#2835 or hasura/graphql-engine@5760d9289c), the introspection fields _themselves_ are now `Schema`-agnostic, and simply return a function that takes a `Schema` object after parsing. For instance, the type of `schema`, corresponding to the `__schema` field, has literally changed as follows:
```diff
-schema :: MonadParse n => Schema -> FieldParser n (          J.Value)
+schema :: MonadParse n =>           FieldParser n (Schema -> J.Value)
 ```

This means that the introspection fields can be included in the GraphQL schema *before* we have generated a `Schema` object. In particular, rather than the current architecture of generating `Schema` at startup time for every role, we can instead generate `Schema` ad-hoc at query parsing time, only for those queries that make use of the introspection fields. This avoids us storing a `Schema` for every role for the lifetime of the server.

However: this introduces a functional change, as the code that generates the `Schema` object, and in particular the `accumulateTypeDefinitions` method, also does certain correctness checks, to prevent exposing a spec-incompliant GraphQL schema. If these correctness checks are being done at parsing time rather than startup time, then we catch certain errors only later on. For this reason, this PR adds an explicit run of this type accumulation at startup time. For efficiency reasons, and since this correctness check is not essential for correct operation of HGE, this is done for the admin role only.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3231
GitOrigin-RevId: 23701c548b785929b28667025436b6ce60bfe1cd
2022-02-21 20:23:55 +00:00
Rakesh Emmadi
e77c110927 server/bigquery: fix parsing timestamp input values
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3667
GitOrigin-RevId: b696c219f96929fa8321c1a6d04589ee8d5b0827
2022-02-21 14:48:00 +00:00
Philip Lykke Carlsen
109a0beca8 (Fix #3456) Guard calls to JSON_QUERY on null arguments
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3655
GitOrigin-RevId: 6e0aed6e96b2995af11366676fa9c453bb44a7aa
2022-02-21 08:53:06 +00:00
Gil Mizrahi
69fd7449be server/mssql: Add max precision to nvarchar and varchar session variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3668
GitOrigin-RevId: 04de036eec00297e79d15d0b0429f9994378735a
2022-02-17 14:12:45 +00:00
Solomon
d1ba271c3d Feature/removable request transform body and modified request transform API
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3475
GitOrigin-RevId: bc847b18d491fe4957a190f5d0fe2ae6e6719791
2022-02-17 04:37:18 +00:00
hasura-bot
972caf65f3 docs: move metadata api deprecation notes + update changelog + nitpicks
GITHUB_PR_NUMBER: 8186
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8186

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3684
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 6d08a9c76c008c62f70a2285afcfdde141ae68c3
2022-02-16 18:34:04 +00:00
Vishnu Bharathi
0cd4bd1bff ci: tag release v2.3.0-beta.1 and v2.3.0-beta.1-pro.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3678
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: b5ffb38ec015773cffe6ec49fa1b2133f7bc4118
2022-02-16 11:09:47 +00:00
Naveen Naidu
2e823234f9 server/remote-schema: Include OperationName in the request sent to remote schemas
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3581
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
GitOrigin-RevId: 2db21d0df158a5a3229b883ee426b2f38f864f80
2022-02-16 07:55:19 +00:00
Daniel Chambers
2c7a4e3a16 Customization of computed field GraphQL schema descriptions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3615
GitOrigin-RevId: f51590d4cfc0412be9baa371353f9b9f3b908f84
2022-02-15 23:17:27 +00:00
Solomon
6c7820caa0 Bumps Kriti Version
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3625
GitOrigin-RevId: a453254ac89b470a56189e6178b2a00cf628fe63
2022-02-15 22:32:38 +00:00
pranshi06
582d78110f server: Support returning scalar types in actions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3453
GitOrigin-RevId: 59fee1460c5571322988b1f558a91ebeb2d55d22
2022-02-15 14:40:34 +00:00
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
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
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
Varun Choudhary
b91cbe2903 console: enable support for update permissions for mssql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3591
GitOrigin-RevId: 668505d81cb647a4cd7766b957f8676062ecde49
2022-02-08 10:50:11 +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
Abhijeet Khangarot
4453745c57 console: add remote database relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3412
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 22052291dcc15e6a10ed573f5044537401d366fe
2022-02-04 13:56:27 +00:00
Kali Vara Purushotham Santhati
780d942fad cli: skip tls verfication for all API requests when insecure-skip-tls-verify flag is set
closes: https://github.com/hasura/graphql-engine/issues/4926

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3307
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 90222fc2e5b176fbf5721fea3f5b2af929ca93f4
2022-02-04 11:11:37 +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
Brandon Martin
b081c8d6f9 Update CHANGELOG with more info for next release
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3548
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: 14c8c95da51b97ea3417b3342582e63699baa457
2022-02-02 13:46:23 +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
Vijay Prasanna
94eedbe07f console: enable inherited roles by default
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3554
GitOrigin-RevId: 04db7ce07931d390b2c6e507b955c65399edae71
2022-02-02 10:13:39 +00:00
Brandon Martin
ab208a858f Update CHANGELOG.md
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3512
GitOrigin-RevId: e087a034a985e52863e75018f1a079c93c738ca8
2022-01-31 15:30:11 +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
hasura-bot
3796fd354d console: fix custom field names sort (fix #7974, #8021)
GITHUB_PR_NUMBER: 8037
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8037

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3379
Co-authored-by: arjunyel <11153289+arjunyel@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: f561b7a0ac5b85a7ca8cdae1cc8f1ad50d61eb0c
2022-01-28 10:31:23 +00:00
Vijay Prasanna
e50c0c0a0c console: enable support for insert & delete permissions for mssql
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3376
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 5ad23803a7326e64f17dac88e2d1caa5f7276c5f
2022-01-28 09:51:08 +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
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
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
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
hasura-bot
f530b3ac6f cli: fix regression with --address flag of hasura console command
GITHUB_PR_NUMBER: 8039
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/8039
closes https://github.com/hasura/graphql-engine/issues/8005

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3381
Co-authored-by: Shoki Hata <37888628+sho-hata@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 6ca7c091ebf7c240e97b65fbfc1713cccb5a5b82
2022-01-20 06:41:05 +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
Daniel Chambers
2c5cf6983b Fixed schema & table dropdowns being unsorted on 'create event trigger' page
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3385
GitOrigin-RevId: 619f1bb8b22e048b47b629a1b6b3315943f1b1fe
2022-01-18 08:50:10 +00:00
Abhijeet Khangarot
54b5088acf rename webhook transforms to REST Connectors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3334
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 6722cc6449daa5111aa3d6afca8909c5af525bf7
2022-01-17 13:28: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
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
hasura-bot
d5e2d613f0 cli: stop using healthz endpoint
GITHUB_PR_NUMBER: 7994
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7994

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3268
Co-authored-by: Romain Briand <183016+romainbriand@users.noreply.github.com>
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: e034fddaea604ba98797e2d9dcab779b2cc21378
2022-01-14 04:17:41 +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
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
Divi
5723baaab4 cli: fix migrate create command behaviour when no data provided
closes https://github.com/hasura/graphql-engine/issues/7971

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3292
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 4f7e38d649c1f414132d576d0f288ca8d3cdb53d
2022-01-12 16:16:50 +00:00
Kali Vara Purushotham Santhati
695164b176 cli: misc changes
- Hasura CLI shows metadata diff in YAML for type `json` in directory mode. The expected behaviour is to show the diff in JSON
- The unified-json shows diff in YAML, not in JSON.
- Add new diff type unified-yaml which shows the diff in YAML unified format.
- Check the flag value of type in `hasura metadata diff --type`
- The help text of `seed apply`( `hasura seed apply --file seeds/1234_add_some_seed_data.sql`) should be updated to `hasura seed apply --file 1234_add_some_seed_data.sql --database-name default` and similarly in docs.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3246
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 1d16ad9ea4dd366af32498ce878ae132bd239be9
2022-01-12 13:25:22 +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
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
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
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
Kali Vara Purushotham Santhati
f0bef2b482 cli: add All option for migrate sub-commands (apply, delete and status) and seed apply command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2509
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 03ee878072b58c6dc7f43af9d26d30a5594d9a50
2021-12-23 15:59:56 +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
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
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
Vishnu Bharathi
291de84179 tag release v2.1.0
GitOrigin-RevId: 3456e09d2c096a3a89866f9e92c86605237b9693
2021-12-14 15:38:26 +00:00
Abhijeet Khangarot
5726852c54 console: add sample context section to request transforms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3110
GitOrigin-RevId: 1c11b8d1a465802490ce12cefce1469a9d24522d
2021-12-14 09:29:18 +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
Aravind K P
0c7e233125 cli: revert split remote schema permissions metadata into seperate files
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3123
GitOrigin-RevId: f327c7324edd66e1f57fafe7703c3318e1362049
2021-12-14 05:08:08 +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
Kali Vara Purushotham Santhati
8c41ff539a cli: enhance metadata diff command
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2581
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 327c26868102ea1c277b795b9f508847faa2ae8b
2021-12-09 17:26:53 +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
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
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
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