Commit Graph

3183 Commits

Author SHA1 Message Date
Varun Choudhary
b1013e8d6c console: add reload all databases checkbox to the metadata settings page
Closes: https://github.com/hasura/graphql-engine/issues/7146

### Description

This PR adds a `reload all databases` check box along `with` the `reload metadata` check box to reload all databases (inconsistent databases also).

![Screenshot from 2021-07-07 16-51-49](https://user-images.githubusercontent.com/68095256/124750932-af31a000-df43-11eb-88d9-b6585214a188.png)

### Affected components

- [x] Console

### Steps to test and verify

Use this for your docker image: https://235669-308610159-gh.circle-artifacts.com/0/server/image.tar

1. Go to the metadata setting page
2. If `reload all databases` check box is checked: It reloads everything by sending * in the API
3. If `reloading all databases` check box is not checked: It reloads inconsistent DB and if no inconsistent then it passes an empty string

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

GitOrigin-RevId: 2b6f029a17d40a43f5bce3680d5681c97433d78c
2021-07-14 06:16:00 +00:00
Nicolas Beaussart
cdfb71c1da console: add a feature flag for schema sharing
https://github.com/hasura/graphql-engine-mono/pull/1786

GitOrigin-RevId: a35dfa98508a8ef1ea92fe8588e79fc6f8479a2d
2021-07-13 16:57:04 +00:00
Vamshi Surabhi
9ec40be58d bigquery: 'global_select_limit' is now optional and defaults to 1000
See https://github.com/hasura/graphql-engine-mono/pull/1774. This new branch had to be opened because of an issue with cli test failure if the branch name starts with a number.

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

Co-authored-by: Aniket Deshpande <922486+aniketd@users.noreply.github.com>
GitOrigin-RevId: 25d2d92f57c10d80bc54b47a3f895ab014b8e6fa
2021-07-13 15:50:12 +00:00
Abby Sassel
151ae6715d server/fix: Remove explicit -developer flag in cabal.project.freeze,
>

### Description
An attempt to fix [this build issue](https://hasurahq.slack.com/archives/CV3UR1MT2/p1626157653068000) on `main`.

https://hasurahq.slack.com/archives/C019Q4RCC4U/p1626167243339000

I believe this change will cause cabal to fall back to default (false) or local config.

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

GitOrigin-RevId: 9b6d59f6b8014e531bedc9270807ac9eb5248f08
2021-07-13 14:41:45 +00:00
Aniket Deshpande
921bdf709b MySQL: Initial connection and corresponding types
https://github.com/hasura/graphql-engine-mono/pull/1517

Co-authored-by: Sibi Prabakaran <737477+psibi@users.noreply.github.com>
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: e0f61664b33d8ca50f223ec7fb76c66940eabc89
2021-07-13 13:33:21 +00:00
Anon Ray
d8fa32776b server: log query in http-log/ws-log only if query-log is enabled
https://github.com/hasura/graphql-engine-mono/pull/1771

GitOrigin-RevId: 1fb8246f6ebff7e114779f284ba36d510b504f29
2021-07-13 12:24:19 +00:00
Ikechukwu Eze
701f3fd304 pro-console/security features: add support for api limits
https://github.com/hasura/graphql-engine-mono/pull/1541

Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: 83f0f20a45f0f396002c53a716dd3541e82b83e1
2021-07-13 11:18:06 +00:00
Rakesh Emmadi
df1efdcd27 server/postgres: fix reload sources and remote schemas if they're inconsistent
https://github.com/hasura/graphql-engine-mono/pull/1709

GitOrigin-RevId: c0684380d0e86dd6f28d6c8a0aebeaa210319272
2021-07-13 07:57:21 +00:00
Aniket Deshpande
3bdd777ec4 MySQL: Add mysql-client dependencies on CI and in .cabal file
https://github.com/hasura/graphql-engine-mono/pull/1514

Co-authored-by: Sibi Prabakaran <737477+psibi@users.noreply.github.com>
Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Toan Nguyen  <1615675+hgiasac@users.noreply.github.com>
GitOrigin-RevId: 81fd23f439e8c3db8149fedae2855db1e84a60a3
2021-07-12 20:07:46 +00:00
Abby Sassel
745ff91dcd server/docs: Add reference in test to its related issue
I got sad that I didn't write a line of code (or...comments) today, so here we are 😅 also [I said I would](https://github.com/hasura/graphql-engine/issues/7181#issuecomment-877143240).

FYI @aniketd this is our convention for linking bug fixes to issues

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

GitOrigin-RevId: 11ee6cc52903c074dc3b6fa8b8c3636cca94174d
2021-07-12 18:59:50 +00:00
Rakesh Emmadi
a375f8c105 server/postgres: Support scalar computed fields in remote joins
https://github.com/hasura/graphql-engine-mono/pull/1692

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: fcef85910899859f7421cad554c022f8023965ea
2021-07-12 16:04:37 +00:00
Sooraj
effb221d97 console: fix test_oss_console ci errors
https://github.com/hasura/graphql-engine-mono/pull/1726

GitOrigin-RevId: ae87ca45a111fcdb25ba9c53c1bfd8650e1be78c
2021-07-12 10:40:50 +00:00
Antoine Leblanc
0a9382f2dc [gardening] remove Alias from Backend
### Description

In our haste to generalize everything for MSSQL, we put every single "suspicious" type in Backend, including ones that weren't required. `Alias` is one of those: it's only used in a type alias, and is actually just an implementation detail of the translation layer. This PR removes it.

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

GitOrigin-RevId: fb348934ec65a51aae7f95d93c83c3bb704587b5
2021-07-09 15:54:56 +00:00
Aniket Deshpande
66f09eeaab MSSQL nodes aggregates & inherited roles
https://github.com/hasura/graphql-engine-mono/pull/1293

Co-authored-by: Chris Done <11019+chrisdone@users.noreply.github.com>
Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 776402dbbaf3d8166a62b1aaaf6abc7e584b3eb2
2021-07-08 20:50:09 +00:00
Philip Lykke Carlsen
7784c72d70 Pytest: Pretty-print JSON payloads in failing assertions
I finally got fed up trying to decipher the messages from failing assertions in integration tests and was thus spurred into action :-)

Instead of using the `repr(..)` format for the `OrderedDict`s of query responses we now deliberately format them as JSON with indentation.

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

GitOrigin-RevId: 1ca0d03ff52950095b89b447d9625d6481bc7177
2021-07-08 19:29:40 +00:00
Brandon Simmons
8306a4d1e4 Add initial benchmark suite, running in CI (closes hasura/graphql-engine-mono#736)
https://github.com/hasura/graphql-engine-mono/pull/1742

GitOrigin-RevId: 17ccd836171f6f39e808f8ac0f28da5cf8ef8f27
2021-07-08 18:19:51 +00:00
Antoine Leblanc
d91029ad51 [gardening] remove all traverse functions from RQL.IR
### Description

This PR removes all `fmapX` and `traverseX` functions from RQL.IR, favouring instead `Functor` and `Traversable` instances throughout the code. This was a relatively straightforward change, except for two small pain points: `AnnSelectG` and `AnnInsert`. Both were parametric over two types `a` and `v`, making it impossible to make them traversable functors... But it turns out that in every single use case, `a ~ f v`. By changing those types to take such an `f :: Type -> Type` as an argument instead of `a :: Type` makes it possible to make them functors.

The only small difference is for `AnnIns`, I had to introduce one `Identity` transformation for one of the `f` parameters. This is relatively straightforward.

### Notes

This PR fixes the most verbose BigQuery hint (`let` instead of `<- pure`).

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

GitOrigin-RevId: e632263a8c559aa04aeae10dcaec915b4a81ad1a
2021-07-08 15:42:53 +00:00
Nicolas Beaussart
e3e078fa42 console: add schema sharing
https://github.com/hasura/graphql-engine-mono/pull/1512

Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
GitOrigin-RevId: 71efbb2a5a577f765b83b1fd9ee9254a292d361d
2021-07-08 08:18:25 +00:00
Rakesh Emmadi
e567a096e6 server/postgres: support computed fields in query filters ('where' expression)
https://github.com/hasura/graphql-engine-mono/pull/1677

GitOrigin-RevId: 30175a442237f6ac4b112c652f448a635ad90dc6
2021-07-07 11:59:32 +00:00
Robert
ae6d624441 server: improve handling of HTTP client errors for remote schema calls
https://github.com/hasura/graphql-engine-mono/pull/1719

GitOrigin-RevId: 5ff671bcff5f0559b9821f8359ebee4129f4b664
2021-07-07 10:15:05 +00:00
Antoine Leblanc
80161e4208 server: delegate Metadata API parsing to a new backend class
https://github.com/hasura/graphql-engine-mono/pull/1179

Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <8663570+tirumaraiselvan@users.noreply.github.com>
GitOrigin-RevId: b565de269e215ae8172bddd895f3d057ddcc8695
2021-07-07 01:44:41 +00:00
Abby Sassel
76c322589c server/bigquery: Document BigQuery integration tests
This PR documents & streamlines how we run BigQuery integration tests locally as a first step to [running them in CI](https://github.com/hasura/graphql-engine-mono/issues/1525).

I've also created a hasura service account for internal use. [Internal docs here](https://github.com/hasura/graphql-engine-mono/wiki/Testing-BigQuery).

Thanks to FP Complete team for [the guidance here](https://docs.google.com/document/d/1dGDK0touUtsDxRQPonMxSoPbIfzBoSYo02tAjQEO7qA/edit?ts=60c0cf24#), which I've reused parts of.

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

GitOrigin-RevId: 303819d212aa073fbef685d077b1cfa583cd15fc
2021-07-06 11:13:06 +00:00
Aravind K P
e99c012af6 cli: expose method to get iconsistent metadata objects
https://github.com/hasura/graphql-engine-mono/pull/1725

GitOrigin-RevId: 68c64369dcc950def19bf773ab1bc95226ebcdd4
2021-07-06 09:37:28 +00:00
Chris Done
614c0dab80 Bigquery/fix limit offset for array aggregates
Blocked on https://github.com/hasura/graphql-engine-mono/pull/1640.

While fiddling with BigQuery I noticed a severe issue with offset/limit for array-aggregates. I've fixed it now.

The basic problem was that I was using a query like this:

```graphql
query MyQuery {
  hasura_Artist(order_by: {artist_self_id: asc}) {
    artist_self_id
    albums_aggregate(order_by: {album_self_id: asc}, limit: 2) {
      nodes {
        album_self_id
      }
      aggregate {
        count
      }
    }
  }
}
```

Producing this SQL:

```sql
SELECT `t_Artist1`.`artist_self_id` AS `artist_self_id`,
       STRUCT(IFNULL(`aa_albums1`.`nodes`, NULL) AS `nodes`, IFNULL(`aa_albums1`.`aggregate`, STRUCT(0 AS `count`)) AS `aggregate`) AS `albums_aggregate`
FROM `hasura`.`Artist` AS `t_Artist1`
LEFT OUTER JOIN (SELECT ARRAY_AGG(STRUCT(`t_Album1`.`album_self_id` AS `album_self_id`) ORDER BY (`t_Album1`.`album_self_id`) ASC) AS `nodes`,
                        STRUCT(COUNT(*) AS `count`) AS `aggregate`,
                        `t_Album1`.`artist_other_id` AS `artist_other_id`
                 FROM (SELECT *
                       FROM `hasura`.`Album` AS `t_Album1`
                       ORDER BY (`t_Album1`.`album_self_id`) ASC NULLS FIRST
                       -- PROBLEM HERE
                       LIMIT @param0) AS `t_Album1`
                 GROUP BY `t_Album1`.`artist_other_id`)
AS `aa_albums1`
ON (`aa_albums1`.`artist_other_id` = `t_Artist1`.`artist_self_id`)
ORDER BY (`t_Artist1`.`artist_self_id`) ASC NULLS FIRST
```

Note the `LIMIT @param0` -- that is incorrect because we want to limit
per artist. Instead, we want:

```sql
SELECT `t_Artist1`.`artist_self_id` AS `artist_self_id`,
       STRUCT(IFNULL(`aa_albums1`.`nodes`, NULL) AS `nodes`, IFNULL(`aa_albums1`.`aggregate`, STRUCT(0 AS `count`)) AS `aggregate`) AS `albums_aggregate`
FROM `hasura`.`Artist` AS `t_Artist1`
LEFT OUTER JOIN (SELECT ARRAY_AGG(STRUCT(`t_Album1`.`album_self_id` AS `album_self_id`) ORDER BY (`t_Album1`.`album_self_id`) ASC) AS `nodes`,
                        STRUCT(COUNT(*) AS `count`) AS `aggregate`,
                        `t_Album1`.`artist_other_id` AS `artist_other_id`
                 FROM (SELECT *,
                            -- ADDED
                            ROW_NUMBER() OVER(PARTITION BY artist_other_id) artist_album_index
                       FROM `hasura`.`Album` AS `t_Album1`
                       ORDER BY (`t_Album1`.`album_self_id`) ASC NULLS FIRST
                       ) AS `t_Album1`
                 -- CHANGED
                 WHERE artist_album_index <= @param
                 GROUP BY `t_Album1`.`artist_other_id`)
AS `aa_albums1`
ON (`aa_albums1`.`artist_other_id` = `t_Artist1`.`artist_self_id`)
ORDER BY (`t_Artist1`.`artist_self_id`) ASC NULLS FIRST
```

That serves both the LIMIT/OFFSET function in the where clause. Then,
both the ARRAY_AGG and the COUNT are correct per artist.

I've updated my Haskell test suite to add regression tests for this. I'll push a commit for Python tests shortly. The tests still pass there.

This just fixes a case that we hadn't noticed.

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

GitOrigin-RevId: 49933fa5e09a9306c89565743ecccf2cb54eaa80
2021-07-06 08:29:39 +00:00
Antoine Leblanc
6ed800abaa [gardening] Introduce PartialArbitrary
### Context

One of the ways we use the Backend type families is to use `Void` for all types for which a backend has no representation; this allows us to make some branches of our metadata and IR unrepresentable, making some functions total, where they would have to handle those unsupported cases otherwise.

However, one of the biggest features, functions, cannot be cut that way, due to one of the constraints on `FunctionName b`: the metadata generator requires it to have an `Arbitrary` instance, and `Arbitrary` does not have a recovery mechanism which would allow for a `Void` instance...

### Description

This PR solves this problem and removes the `Arbitrary` constraints in `Backend`. To do so, it introduces a new typeclass: `PartialArbitrary`, which is very similar to `Arbitrary`, except that it returns a `Maybe (Gen a)`, allowing for `Void` to have a well-formed instance. An `Arbitrary` instance for `Metadata` can easily be retrieved with `arbitrary = fromJust . partialArbitrary`.

Furthermore, `PartialArbitrary` has a generic implementation, inspired by the one in `generic-arbitrary`, which automatically prunes branches that return `Nothing`, allowing to automatically construct most types. Types that don't have a type parameter and therefore can't contain `Void` can easily get their `PartialArbitrary` instance from `Arbitrary` with `partialArbitrary = Just arbitrary`. This is what a default overlappable instance provides.

In conjunction with other cleanups in #1666, **this allows for Void function names**.

### Notes

While this solves the stated problem, there are other possible solutions we could explore, such as:
- switching from QuickCheck to a library that supports that kind of pruning natively
- removing the test altogether, and dropping all notion of Arbitrary from the code

There are also several things we could do with the Generator module:
- move it out of RQL.DDL.Metadata, to some place that makes more sense
- move ALL Arbitrary instances in the code to it, since nothing else uses Arbitrary
- or, to the contrary, move all those Arbitrary instances alongside their types, to avoid an orphan instance

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

GitOrigin-RevId: 88e304ea453840efb5c0d39294639b8b30eefb81
2021-07-05 22:04:38 +00:00
Antoine Leblanc
c64f66774b [gardening] remove ToJSON constraint in spockAction (fix #1581)
### Description

The spock handler requires the request type to have a `ToJSON` instance AND a `FromJSON` instance. That's because we parse it from the received bytestring into its proper type.... and call `toJSON` on it to log it. This PR simplifies this, by keeping the intermediate `Value` obtained during parsing, and using it for logging. This has two consequences:

1. it removes the `ToJSON` constraint, which will remove some code down the line (esp. in Metadata)
2. it means we log the actual JSON object query we received, not the result of parsing it, meaning the logged object will contain fields that would have been ignored when parsing the actual value; this is both an upside (more accurate log) and a downside (could be more verbose / more confusing)

### Further work

Should this PR also remove all obsolete ToJSON instances while at it?
How do we test this?

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

GitOrigin-RevId: ae099eea9a671eabadcdf507f993a5ad9433be87
2021-07-05 18:47:55 +00:00
hasura-bot
2c2ce3972e console: fix incorrect down migration comment blocks
GITHUB_PR_NUMBER: 6956
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6956

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

Co-authored-by: Bob Ippolito <26596+etrepum@users.noreply.github.com>
GitOrigin-RevId: de652b37f13d0c38d497610de1c270d0b8d18160
2021-07-05 10:30:56 +00:00
Swann Moreau
f6e49500d5 server: log request type (batched/single) in http-log
https://github.com/hasura/graphql-engine-mono/pull/1488

GitOrigin-RevId: 092335d6eb95224b8ed81d853a71fca01379dd7d
2021-07-05 09:46:29 +00:00
Varun Choudhary
a1f25506f2 console: fix empty table list on create event triggers form
Closes: https://github.com/hasura/graphql-engine/issues/6903

Description:

This PR adds `Select schema` as a default text in schema drop down box on events triggers.
![Screenshot from 2021-05-12 15-39-09](https://user-images.githubusercontent.com/68095256/117958025-3d204e80-b338-11eb-9169-ec529db0bf6f.png)

Affected Components:

- [x] Console

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

GitOrigin-RevId: 28b6054addf8fcb11b80ae357cfcbe8b71a470bc
2021-07-05 08:32:19 +00:00
Robert
5cc91aebc3 server: Log action and event names (close #1603)
- add name fields to log output in several spots:
  - action logs get the action name in detail.action_name
  - events (triggered and scheduled) get the trigger name in detail.event_name
  - one-off scheduled events don't have a trigger name; instead, they get the
    comment if it exists
- remove unused event creation timestamp from ExtraLogContext

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

GitOrigin-RevId: 28907340d4e2d9adc0c48cc5d3010eef1fa902e1
2021-07-05 07:48:39 +00:00
Robert
a7a4791b96 server/eventing: clean-up around logging configuration
- Add export list to Hasura.Eventing.Common
- Group logging options in one type / argument
- Group request header processing code in one place
  This doesn't address the convoluted logic, but should make it a bit easier
  to figure out what's going on for the next person.

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

GitOrigin-RevId: 34b0abdd1b86b5836eb512484acb0db8c81f3014
2021-07-02 17:25:59 +00:00
Varun Choudhary
2af583beb1 console: show trigger names by execution order on table's modify page
Closes: https://github.com/hasura/graphql-engine/issues/6737

Product Design link: https://hasura.github.io/product-design/62-console-trigger-design/v2-triggers.html

Description:

This PR
1. Group all triggers based on the `action_timing` and `event_manipulation`. (BEFORE INSERT, BEFORE UPDATE, ...)
2. Sort the names of the triggers within each of the groups
On admin panel.
![Screenshot from 2021-05-07 12-55-53](https://user-images.githubusercontent.com/68095256/117413420-943ab380-af33-11eb-9127-86c0dd789274.png)

Affected Components:

- [x] Console

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

GitOrigin-RevId: 1709dd82ce44886e1d53505d94e1e289dab73aaf
2021-07-02 15:14:36 +00:00
Anon Ray
f263af31a0 server: add query field to http-log and websocket-log
https://github.com/hasura/graphql-engine-mono/pull/1683

GitOrigin-RevId: 6f46e31bb14f135d528b20ae9513e393c06c3c8a
2021-07-02 13:05:57 +00:00
Sooraj
97505cf251 console: hide incorrect table comments for mssql table
https://github.com/hasura/graphql-engine-mono/pull/1699

GitOrigin-RevId: 0e253fd3b15f199f138413533f36d248470b99c1
2021-07-02 08:15:47 +00:00
Varun Choudhary
2b2655665c console: show frequently used columns button on add new column view
closes: https://github.com/hasura/graphql-engine/issues/7148

### Description

This PR add `Frequently used columns` on modify page while adding a column to existing table.

![frequently](https://user-images.githubusercontent.com/68095256/123812895-16cb6800-d912-11eb-977e-a3247ec15525.png)

### Affected components

- [x] Console

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

GitOrigin-RevId: 1e8fa354281458dd9c7eacb963c4d54391d975a0
2021-07-02 07:30:18 +00:00
hasura-bot
35ab147dd9 server/citus: run tests in CI (OSS changes)
GITHUB_PR_NUMBER: 7161
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7161

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

Co-authored-by: Abby Sassel <3883855+sassela@users.noreply.github.com>
GitOrigin-RevId: 7acbfdad71d9c26fb1bb015f66f844988927bdc8
2021-07-02 05:19:58 +00:00
Abby Sassel
5b7d949ef4 server/citus: run tests in CI
https://github.com/hasura/graphql-engine-mono/pull/1526

GitOrigin-RevId: 4fd4214a799bc0d91cd2d29b1ea444f80714f6bc
2021-07-01 14:41:12 +00:00
vaishnavigvs
779f767369 docs: update faq
https://github.com/hasura/graphql-engine-mono/pull/1691

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: a0c6599db7a9c89a39aff623602684bd68bb3959
2021-07-01 11:58:01 +00:00
Karthikeyan Chinnakonda
43973f80cf server tests: refactor the per_class_tests_db_state fixture
https://github.com/hasura/graphql-engine-mono/pull/1701

GitOrigin-RevId: 278b9e226cc7719f4c44bf9c9a802146a8a004f4
2021-07-01 09:21:45 +00:00
Brandon Simmons
f1b1dc109e tests: document server-upgrade-downgrade test
https://github.com/hasura/graphql-engine-mono/pull/1658

GitOrigin-RevId: c097de5758847ee01e5cb4f049a662338f6a4dda
2021-06-29 18:39:30 +00:00
Swann Moreau
4929f83c71 server: reorganise version embedding for fewer [TH] rebuilds
https://github.com/hasura/graphql-engine-mono/pull/1682

GitOrigin-RevId: 6575f7bba20b75c48c5bc6d60e9379dc443aeaa0
2021-06-29 16:40:47 +00:00
Jigyasu Arya
53fbc9eb5e docs: update strip banner (hasuracon)
https://github.com/hasura/graphql-engine-mono/pull/1662

GitOrigin-RevId: a352c732da037db4eb30a4a09bfc68259271affd
2021-06-29 09:53:30 +00:00
Antoine Leblanc
404551acdb server: fix major issue with JSON instances of AnyBackend
### Description
This PR fixes a major issue in the JSON instances of `AnyBackend`: they were not symmetrical! `FromJSON` always made the assumption that the value was an object, and that it contained a "kind" field if it happened to not be a Postgres value. `ToJSON` did NOT insert said field in the output, and did not enforce that the output was an object.

....however, it worked, because nowhere in the code did we yet rely on those being symmetrical. They are both used only once:
- `parseJSON` was used to decode a `Metadata` object, but the matching `toJSON` instance, which is heavily customized, does insert the "kind" field properly
- `toJSON` was only used on the `SchemaCache`, which has no corresponding `FromJSON` instance, since we only serialize it in debug endpoints

This PR makes no attempt at making the instances symmetrical. Instead, it implements simpler functions, and pushes the problem of identifying the proper backend (if any) to the call sites.

### Notes

Additionally, it cleans up some instances that were manually written where they could be auto-generated. In the process, this PR changes the semantics of `Show`, since the stock derived instance will include the constructor name, where before it was skipped. I think it is preferable.

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

GitOrigin-RevId: 0a1580a0e0f01c25b8c9fee7612dba6e7de055d5
2021-06-28 18:39:01 +00:00
Chris Done
27223fb102 Bigquery/drop dataloader
Blocked on https://github.com/hasura/graphql-engine-mono/pull/1592.

This drops the unused data loader code. There should be no function change, so no new tests are added.

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

GitOrigin-RevId: 6589a69493dc3d2ea119e6ee04622fc94024403b
2021-06-28 13:30:40 +00:00
Abhijeet Khangarot
efd934f5c1 console/remote-schemas: fixes 404 errors while adding/modifying/removing remote schemas
https://github.com/hasura/graphql-engine-mono/pull/1674

GitOrigin-RevId: 4775830d97307fd960fc6d0857ec6431f707c68b
2021-06-28 12:20:55 +00:00
hasura-bot
621029b4ed cli: make cli-ext to be usable in the cli library
GITHUB_PR_NUMBER: 7099
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7099

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

Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com>
GitOrigin-RevId: 610215142cadfab76fd8368c28a125f46da5e759
2021-06-27 13:50:20 +00:00
Divi
bcb5baf63b ci: make deploy job dependent on cli, console test jobs
https://github.com/hasura/graphql-engine-mono/pull/1663

GitOrigin-RevId: 6731c33adcbfff9ba972fca226d9f3245496233c
2021-06-25 14:07:14 +00:00
Chris Done
6dc555f9eb Bigquery/global limit
This resolves https://github.com/hasura/graphql-engine/issues/6947.

A new [`global_select_limit`](b0ab5deefe/server/tests-py/queries/graphql_query/bigquery/replace_metadata.yaml (L17)) field is supported in the BigQuery configuration.

To test global limits, we have two sources defined,  the normal one (limited to 1million) and one with a limit of 1.

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

GitOrigin-RevId: 6ebcc7c1a16bc26ec36e53ae3694d36b7ce5c6e1
2021-06-25 13:36:35 +00:00
kodiakhq[bot]
a11b4135fc Use exceptions to handle compatibility with pg 9.6 in 2.0 upgrade migration
https://github.com/hasura/graphql-engine-mono/pull/1651

Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Brandon Simmons <210815+jberryman@users.noreply.github.com>
GitOrigin-RevId: cdb4a33cbb1a136bc30e8f0dd59aaae584d3a636
2021-06-24 02:20:11 +00:00
Tirumarai Selvan
345cf8fe4c tag release v2.0.1
GitOrigin-RevId: f33aca9566de9cb6e2fe9fa7a94e7d64d06d3ef4
2021-06-23 18:10:07 +00:00