Commit Graph

580 Commits

Author SHA1 Message Date
Sameer Kolhar
edeb8c98fd server: support for graphql-ws protocol
https://github.com/hasura/graphql-engine-mono/pull/1655

Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@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: Brandon Simmons <210815+jberryman@users.noreply.github.com>
Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Divi <32202683+imperfect-fourth@users.noreply.github.com>
GitOrigin-RevId: 9db3902388fef06b94f9513255e2b5333bd23c3e
2021-08-24 16:26:12 +00:00
Lyndon Maydwell
9a1c7d5ea0 server: Adding support for TLS allowlist by domain and service id (port)
https://github.com/hasura/graphql-engine-mono/pull/2153

Co-authored-by: Sameer Kolhar <6604943+kolharsam@users.noreply.github.com>
GitOrigin-RevId: 473a29af97236fc879ae178b0c2a6c31c1f12563
2021-08-24 07:37:25 +00:00
Ikechukwu Eze
4330798a71 console: fix error due too rendering inconsistent object's message
https://github.com/hasura/graphql-engine-mono/pull/2116

GitOrigin-RevId: a2d8230bf685a201991adfe33f548c9e9c24e44b
2021-08-19 16:43:17 +00:00
David Overton
20f7a6e726 server: fix untrack_function for non-default source
https://github.com/hasura/graphql-engine-mono/pull/2152

GitOrigin-RevId: 339b365044443cec6a83e1a6b3ec06677dc51e1d
2021-08-19 10:28:49 +00:00
Karthikeyan Chinnakonda
eaf0211787 docs: document clean up steps for scheduled triggers
https://github.com/hasura/graphql-engine-mono/pull/2077

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 7f4fae18052b46122106a0fb57ab4b5c0c000b18
2021-08-18 16:16:39 +00:00
Aniket Deshpande
2700554412 bq: test table customization features
https://github.com/hasura/graphql-engine-mono/pull/2062

Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 5573efd1b28e088d5730c7d22e16889dc852b5fe
2021-08-18 13:00:58 +00:00
Rikin Kachhia
47f8bc9b42 server: update non-existent object error messages
https://github.com/hasura/graphql-engine-mono/pull/2098

GitOrigin-RevId: 61a10560a9df50afd80a6186e0d23b74874e3265
2021-08-18 10:52:28 +00:00
Rakesh Emmadi
fa152d842d server/postgres: optimize SQL query generation with LIMITs
>

### Description
>
This PR supersedes https://github.com/hasura/graphql-engine-mono/pull/1484. Apply `limit` to the table selection before joining relationship rows to improve query performance.

### 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

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

### Solution and Design
>
Prior to this change, we apply `LIMIT` and `OFFSET` to the outer selection from sub-query which includes joins for relationships. Now, we move `LIMIT` and `OFFSET` (if present) to inner selection of base table. But, this isn't done always! If there are order by relationships' columns we apply at the outer selection. To know more, please refer to [source code note](https://github.com/hasura/graphql-engine-mono/pull/2078/files#diff-46d868ee45d3eaac667cebb34731f573c77d5c9c8097bb9ccf1115fc07f65bfdR652).

```graphql
query {
  article(limit: 2){
    id
    title
    content
    author{
      name
    }
  }
}
```
Before:
```sql
SELECT
  coalesce(json_agg("root"), '[]') AS "root"
FROM
  (
    SELECT
      row_to_json(
        (
          SELECT
            "_4_e"
          FROM
            (
              SELECT
                "_0_root.base"."id" AS "id",
                "_0_root.base"."title" AS "title",
                "_0_root.base"."content" AS "content",
                "_3_root.or.author"."author" AS "author"
            ) AS "_4_e"
        )
      ) AS "root"
    FROM
      (
        SELECT
          *
        FROM
          "public"."article"
        WHERE
          ('true')
      ) AS "_0_root.base"
      LEFT OUTER JOIN LATERAL (
        SELECT
          row_to_json(
            (
              SELECT
                "_2_e"
              FROM
                (
                  SELECT
                    "_1_root.or.author.base"."name" AS "name"
                ) AS "_2_e"
            )
          ) AS "author"
        FROM
          (
            SELECT
              *
            FROM
              "public"."author"
            WHERE
              (("_0_root.base"."author_id") = ("id"))
          ) AS "_1_root.or.author.base"
      ) AS "_3_root.or.author" ON ('true')
    LIMIT
      2
  ) AS "_5_root"
```
cost
```
Aggregate  (cost=0.73..0.74 rows=1 width=32)
  ->  Limit  (cost=0.15..0.71 rows=2 width=32)
        ->  Nested Loop Left Join  (cost=0.15..223.96 rows=810 width=32)
              ->  Seq Scan on article  (cost=0.00..18.10 rows=810 width=72)
              ->  Index Scan using author_pkey on author  (cost=0.15..0.24 rows=1 width=36)
                    Index Cond: (article.author_id = id)
                    SubPlan 1
                      ->  Result  (cost=0.00..0.01 rows=1 width=32)
              SubPlan 2
                ->  Result  (cost=0.00..0.01 rows=1 width=32)
```

After:
```sql
SELECT
  coalesce(json_agg("root"), '[]') AS "root"
FROM
  (
    SELECT
      row_to_json(
        (
          SELECT
            "_4_e"
          FROM
            (
              SELECT
                "_0_root.base"."id" AS "id",
                "_0_root.base"."title" AS "title",
                "_0_root.base"."content" AS "content",
                "_3_root.or.author"."author" AS "author"
            ) AS "_4_e"
        )
      ) AS "root"
    FROM
      (
        SELECT
          *
        FROM
          "public"."article"
        WHERE
          ('true')
        LIMIT
          2
      ) AS "_0_root.base"
      LEFT OUTER JOIN LATERAL (
        SELECT
          row_to_json(
            (
              SELECT
                "_2_e"
              FROM
                (
                  SELECT
                    "_1_root.or.author.base"."name" AS "name"
                ) AS "_2_e"
            )
          ) AS "author"
        FROM
          (
            SELECT
              *
            FROM
              "public"."author"
            WHERE
              (("_0_root.base"."author_id") = ("id"))
          ) AS "_1_root.or.author.base"
      ) AS "_3_root.or.author" ON ('true')
  ) AS "_5_root"
```
cost:
```
Aggregate  (cost=16.47..16.48 rows=1 width=32)
  ->  Nested Loop Left Join  (cost=0.15..16.44 rows=2 width=100)
        ->  Limit  (cost=0.00..0.04 rows=2 width=72)
              ->  Seq Scan on article  (cost=0.00..18.10 rows=810 width=72)
        ->  Index Scan using author_pkey on author  (cost=0.15..8.18 rows=1 width=36)
              Index Cond: (article.author_id = id)
              SubPlan 1
                ->  Result  (cost=0.00..0.01 rows=1 width=32)
  SubPlan 2
    ->  Result  (cost=0.00..0.01 rows=1 width=32)
```

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

Co-authored-by: Evie Ciobanu <1017953+eviefp@users.noreply.github.com>
GitOrigin-RevId: 47eaccdbfb3499efd2c9f733f3312ad31c77916f
2021-08-17 17:03:08 +00:00
Vishnu Bharathi
cf6f3edc1f tag release v2.0.7 (#2118)
GitOrigin-RevId: b86611a3393d2b8008b09c1d833d5b2c43f72aaf
2021-08-17 13:07:37 +00:00
hasura-bot
2d03920169 console: add custom timeouts to actions
GITHUB_PR_NUMBER: 6251
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6251

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

Co-authored-by: Varun Choudhary <68095256+Varun-Choudhary@users.noreply.github.com>
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com>
GitOrigin-RevId: 758c6d7edfbf3f7f3173653bceb53608b0f253d8
2021-08-17 11:59:22 +00:00
Karthikeyan Chinnakonda
1294ae59f2 server: fix bug when downgrading from v2 to v1 when there is atleast one cron trigger present in the metadata
https://github.com/hasura/graphql-engine-mono/pull/2101

GitOrigin-RevId: 7011f0c18cb0cef828214ec084adc39cfb3aba1c
2021-08-17 07:02:09 +00:00
Karthikeyan Chinnakonda
ef2278f9c7 server: add an index on event_id in hdb_cron_event_invocation_logs table
https://github.com/hasura/graphql-engine-mono/pull/2083

GitOrigin-RevId: b5748424c7b685a0bad2117adfe0eb189e40197c
2021-08-17 05:45:11 +00:00
Ikechukwu Eze
64a5c52904 console: support computed fields in permission builder
>

### Description
>

### 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] Console

### Related Issues
closes [#7336](https://github.com/hasura/graphql-engine/issues/7336)

### Steps to test and verify

- Add a scalar computed field with only table row as argument, to the table you want to use for testing
- Then head to table's permission tab, and try to use permission builder to set permissions for any role
- confirm that computed fields are listed as options along table columns

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

GitOrigin-RevId: 2cd16ca4a0e6a6288d4b62549ebe1aaaf841952b
2021-08-16 12:28:03 +00:00
Abhijeet Khangarot
5de2ef7d31 console: allow same named queries and unnamed queries on allowlist file upload
https://github.com/hasura/graphql-engine-mono/pull/1906

GitOrigin-RevId: bdd752f49213a2056f39050d40d3dc299dc07819
2021-08-16 09:23:12 +00:00
Rakesh Emmadi
c2f667a06d server: correctly generate remote relationship field type
>

### Description
>
From HGE version 2.0 onwards, all remote relationship fields are generated as plain types without non-nullable and lists. This PR fixes the same.

### 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
->
fix https://github.com/hasura/graphql-engine/issues/7284

### Steps to test and verify
>
- Create a remote relationship to a field in remote schema with non-nullable or list type
- The HGE introspection should give the remote relationship field type correctly as like in the remote schema

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

GitOrigin-RevId: e113f5d17b62bfa0a25028c20260ae1782ae224b
2021-08-12 12:17:52 +00:00
pranshi06
d179a6f2ec server: support EdDSA keys for JWT
https://github.com/hasura/graphql-engine-mono/pull/1818

Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: aae87d34cd19c97e66721a2bd7602d907aeb90b3
2021-08-12 01:54:06 +00:00
Sameer Kolhar
3f35a9a219 console: support creation of indexes on the console for postgres sources
https://github.com/hasura/graphql-engine-mono/pull/358

Co-authored-by: Ikechukwu Eze <22247592+iykekings@users.noreply.github.com>
GitOrigin-RevId: cd4a5073fb361fe1235f5d49a0dc9b025fc1379f
2021-08-11 18:02:56 +00:00
Vijay Prasanna
5d6211d3dc console/inherited-roles: allow resolution of conflicting permissions
https://github.com/hasura/graphql-engine-mono/pull/2027

GitOrigin-RevId: 896759f70aa95bf4b16766cc6e4ca38cf10878e1
2021-08-11 14:21:14 +00:00
Evie Ciobanu
11b3e1573d [server] generate the correct type for single-row returning functions
https://github.com/hasura/graphql-engine-mono/pull/2055

GitOrigin-RevId: 94c1cc32028054c7ec11d6ada2fc57f0820a4d5e
2021-08-11 12:42:30 +00:00
Tirumarai Selvan
7b863a1b3b tag release v2.0.6
GitOrigin-RevId: b2b906cf7b05bc444148a334aba42385046be75c
2021-08-11 01:19:22 +00:00
Karthikeyan Chinnakonda
06f5e4fb77 server: inherited roles for mutations, remote schemas, actions and custom functions
https://github.com/hasura/graphql-engine-mono/pull/1715

GitOrigin-RevId: 4818292cff8c3a5b264968e7032887a1e98b6f79
2021-08-09 10:21:05 +00:00
Aniket Deshpande
a9fb2710db server/bigquery: implement _in and _nin operators. (close #7343)
https://github.com/hasura/graphql-engine-mono/pull/2033

GitOrigin-RevId: 58d4de268b62c6d7cb6106bec38214e651926816
2021-08-06 19:58:33 +00:00
Lyndon Maydwell
d483109443 Revert "Disable TLS checks for actions services with self-signed certificates"
Reverts hasura/graphql-engine-mono#1595

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

GitOrigin-RevId: b32adde77b189c14eef0090866d58750d1481b50
2021-08-06 17:06:55 +00:00
jkachmar
4a83bb1834 Remote schema execution logic
https://github.com/hasura/graphql-engine-mono/pull/1995

Co-authored-by: David Overton <7734777+dmoverton@users.noreply.github.com>
GitOrigin-RevId: 178669089ec5e63b1f3da1d3ba0a9f8debbc108d
2021-08-06 13:40:37 +00:00
Antoine Leblanc
52d91e3e8d Update GraphQL Parser version to fix text encoding issue (fix #1965)
### A long tale about encoding

GraphQL has an [introspection system](http://spec.graphql.org/June2018/#sec-Introspection), which allows its schema to be introspected. This is what we use to introspect [remote schemas](41383e1f88/server/src-rsr/introspection.json). There is one place in the introspection where we might find GraphQL values: the default value of an argument.

```json
{
  "fields": [
    {
      "name": "echo",
      "args": [
        {
          "name": "msg",
          "defaultValue": "\"Hello\\nWorld!\""
        }
      ]
    }
  ]
}
```

Note that GraphQL's introspection is transport agnostic: the default value isn't returned as a JSON value, but as a _string-encoded GraphQL Value_. In this case, the value is the GraphQL String `"Hello\nWorld!"`. Embedded into a string, it is encoded as: `"\"Hello\\nWorld!\""`.

When we [parse that value](41383e1f88/server/src-lib/Hasura/GraphQL/RemoteServer.hs (L351)), we first extract that JSON string, to get its content, `"Hello\nWorld!"`, then use our [GraphQL Parser library](21c1ddfb41/src/Language/GraphQL/Draft/Parser.hs (L200)) to interpret this: we find the double quote, understand that the content is a String, unescape the backslashes, and end up with the desired string value: `['H', 'e', 'l', 'l', 'o', '\n', 'W', 'o', 'r', 'l', 'd', '!']`. This all works fine.

However, there was a bug in the _printer_ part of our parser library: when printing back a String value, we would not re-escape characters properly. In practice, this meant that the GraphQL String `"Hello\nWorld"` would be encoded in JSON as `"\"Hello\nWorld!\""`. Note how the `\n` is not properly double-escaped. This led to a variety of problems, as described in #1965:
- we would successfully parse a remote schema containing such characters in its default values, but then would print those erroneous JSON values in our introspection, which would _crash the console_
- we would inject those default values in queries sent to remote schemas, and print them wrong doing so, sending invalid values to remote schemas and getting errors in result

It turns out that this bug had been lurking in the code for a long time: I combed through the history of [the parser library](https://github.com/hasura/graphql-parser-hs), and as far as I can tell, this bug has always been there. So why was it never caught? After all, we do have [round trip tests](21c1ddfb41/test/Spec.hs (L52)) that print + parse arbitrary values and check that we get the same value as a result. They do use any arbitrary unicode character in their generated strings. So... that should have covered it, right?

Well... it turns out that [the tests were ignoring errors](7678066c49/test/Spec.hs (L45)), and would always return "SUCCESS" in CI, even if they failed... Furthermore, the sample size was small enough that, most of the time, _they would not hit such characters_. Running the tests locally on a loop, I only got errors ~10% of the time...

This was all fixed in hasura/graphql-parser-hs#44. This was probably one of Hasura's longest standing bugs? ^^'

### Description

This PR bumps the version of graphql-parser-hs in the engine, and switches some of our own arbitrary tests to use unicode characters in text rather than alphanumeric values. It turns out those tests were much better at hitting "bad" values, and that they consistently failed when generating arbitrary unicode characters.

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

GitOrigin-RevId: 54fa48270386a67336e5544351691619e0684559
2021-08-06 11:54:45 +00:00
hasura-bot
e78bc4b0ed console: export metadata before tracking new table (fix #6805) (fix #7221) (fix #7233)
GITHUB_PR_NUMBER: 7330
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/7330

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

Co-authored-by: Kenneth J. Miller <6822406+KloudJack@users.noreply.github.com>
GitOrigin-RevId: 9532f7b596801ebcdd15bd40a9b3ace0b9b88326
2021-08-06 09:09:34 +00:00
Kali Vara Purushotham Santhati
0341037aeb cli-ext: fix sdl formatting
closes https://github.com/hasura/graphql-engine/issues/7296

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

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: 41383e1f88c709c6cae4059a1b4fb8f2a58259e6
2021-08-06 05:01:07 +00:00
Lyndon Maydwell
f6987ca4ff Disable TLS checks for actions services with self-signed certificates
https://github.com/hasura/graphql-engine-mono/pull/1595

GitOrigin-RevId: 3834e7d005bfaeaa7cc429c9d662d23b3d903f5c
2021-08-06 03:01:24 +00:00
David Overton
1000df2e0a Fix/remote nested field customization
https://github.com/hasura/graphql-engine-mono/pull/2009

GitOrigin-RevId: bec59d2173afd6f392997f6bd953775f4a42dd48
2021-08-05 14:59:55 +00:00
Ikechukwu Eze
2e1f0df610 console: fix untracked foreign-key relationships suggestion across schemas
This PR fixes untracked foreign-key relationships suggestion across schemas.

### 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] Console

### Related Issues
close [#7177](https://github.com/hasura/graphql-engine/issues/7177)

### Solution and Design
Previously to determine relations, we'd check the foreign keys constraint on all tables in the metadata,
but from 2.0, we filtered these tables based on schema. Therefore, relationships are only reflected if both tables are of the same schema. This PR makes sure that all tables in the metadata are considered

### Steps to test and verify
- Create two schemas and a table in each
- Create a foreign key constraint on one of the tables to the other using RawSQL
- Go the schema page of the table where the constraint was created on.
- Confirm that the console suggests to track the relationship you created in step 2 above

#### Breaking changes

- [x] No Breaking changes

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

GitOrigin-RevId: c1d5229955e731bb8019955ebd7a925d7870eb17
2021-08-05 12:32:53 +00:00
Tirumarai Selvan
553aecb5e5 tag release v2.0.5
GitOrigin-RevId: 8c98e9dba9fa655b5d7503211a5d3f42f641cef5
2021-08-05 07:35:10 +00:00
jkachmar
c322af93f8 server: Uses GraphQL type in remote variable cache key
https://github.com/hasura/graphql-engine-mono/pull/1801

GitOrigin-RevId: 98843e422b2431849b675acdb318ffae2f492f18
2021-08-04 21:24:36 +00:00
Karthikeyan Chinnakonda
2f71e2e7c9 server: fine tune cron triggers behaviour in replace metadata API call
https://github.com/hasura/graphql-engine-mono/pull/1991

GitOrigin-RevId: 7eb7d7b20d0a03eda7829d3a17a35dffe0f7bf1a
2021-08-04 14:52:20 +00:00
Aravind K P
2898db17af cli-migrations-v2: use env variable to start temporary hasura instance
closes https://github.com/hasura/graphql-engine/issues/7319

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

GitOrigin-RevId: a2c798b5825423f9c2d37d436a3852c2262644d2
2021-08-04 06:11:06 +00:00
Karthikeyan Chinnakonda
cb29607833 server: fix mutations bug when inherited roles is enabled
https://github.com/hasura/graphql-engine-mono/pull/1989

GitOrigin-RevId: d4e41431fdf90426651dd1289eb0f0e099de95b9
2021-08-03 11:12:01 +00:00
Karthikeyan Chinnakonda
0a3fd16c35 server: revert the relaxing of unique name constraint in allow-lists
https://github.com/hasura/graphql-engine-mono/pull/1972

GitOrigin-RevId: cb062df7a1ba1c99705f811409e2e4ad42f4b581
2021-08-03 09:23:20 +00:00
Swann Moreau
63d5b7ad53 pro, server: improve parameterised query hash handling for batched requests (fix #1767)
https://github.com/hasura/graphql-engine-mono/pull/1768

GitOrigin-RevId: 11615408ee2fb097e68ee4a641e5dc46c1d28795
2021-08-02 16:05:17 +00:00
Evie Ciobanu
e48ccd7fab server: Check session variables for subscriptions
https://github.com/hasura/graphql-engine-mono/pull/1879

GitOrigin-RevId: 78d3384cb21a36e8b8c85c17ae7578ce0b4230f8
2021-07-30 21:42:52 +00:00
David Overton
1abb1dee69 Remote Schema Customization take 2 using parser tranformations
https://github.com/hasura/graphql-engine-mono/pull/1740

GitOrigin-RevId: e807952058243a97f67cd9969fa434933a08652f
2021-07-30 11:33:59 +00:00
Aniket Deshpande
61663ec901 MSSQL: __typename error and json based aggregates (graphql-engine#7130)
https://github.com/hasura/graphql-engine-mono/pull/1930

GitOrigin-RevId: f14df470ffa298c18e006c522d6355298041ae8e
2021-07-30 09:03:57 +00:00
Nicolas Beaussart
1b10f275d2 console: add template gallery
https://github.com/hasura/graphql-engine-mono/pull/1923

GitOrigin-RevId: 88f8f276c79ea61ba38070c582bd02468e6593e2
2021-07-29 13:51:45 +00:00
Tirumarai Selvan
3089a385f1 tag release v2.0.4
https://github.com/hasura/graphql-engine-mono/pull/1936

GitOrigin-RevId: 0e1c97f8b8f0223a17712f870cf304004621948f
2021-07-29 12:03:53 +00:00
Divi
80846d36b7 cli: add support for query_tags metadata object
- add support for query_tags metadata object
- fix filename for cron_triggers metadata object

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

Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com>
GitOrigin-RevId: d9266d723f06d11d92f156f70660e0122412e41a
2021-07-29 07:22:25 +00:00
Rakesh Emmadi
a63fa18d9c server/postgres: Support computed fields in permission check/filter
https://github.com/hasura/graphql-engine-mono/pull/1697

GitOrigin-RevId: 6cdf8acc90d3fd97d20a3ee68c84306c3f589370
2021-07-28 08:10:25 +00:00
Rakesh Emmadi
5cfac6ea87 server/postgres: support computed fields in order by
https://github.com/hasura/graphql-engine-mono/pull/1793

GitOrigin-RevId: e0396c0d4d96fc8f9bdbd7567193933db5b295a6
2021-07-27 16:28:23 +00:00
Anon Ray
e4155e4c5b server: log post drop-source hook errors instead of throwing
https://github.com/hasura/graphql-engine-mono/pull/1724

GitOrigin-RevId: 659d9335861b71ee6ed551eedfb0926d16c9ac3d
2021-07-27 15:15:47 +00:00
Auke Booij
7bead93827 server: remove remnants of query plan caching (fix #1795)
Query plan caching was introduced by - I believe - hasura/graphql-engine#1934 in order to reduce the query response latency. During the development of PDV in hasura/graphql-engine#4111, it was found out that the new architecture (for which query plan caching wasn't implemented) performed comparably to the pre-PDV architecture with caching. Hence, it was decided to leave query plan caching until some day in the future when it was deemed necessary.

Well, we're in the future now, and there still isn't a convincing argument for query plan caching. So the time has come to remove some references to query plan caching from the codebase. For the most part, any code being removed would probably not be very well suited to the post-PDV architecture of query execution, so arguably not much is lost.

Apart from simplifying the code, this PR will contribute towards making the GraphQL schema generation more modular, testable, and easier to profile. I'd like to eventually work towards a situation in which it's easy to generate a GraphQL schema parser *in isolation*, without being connected to a database, and then parse a GraphQL query *in isolation*, without even listening any HTTP port. It is important that both of these operations can be examined in detail, and in isolation, since they are two major performance bottlenecks, as well as phases where many important upcoming features hook into.

Implementation

The following have been removed:
- The entirety of `server/src-lib/Hasura/GraphQL/Execute/Plan.hs`
- The core phases of query parsing and execution no longer have any references to query plan caching. Note that this is not to be confused with query *response* caching, which is not affected by this PR. This includes removal of the types:
- - `Opaque`, which is replaced by a tuple. Note that the old implementation was broken and did not adequately hide the constructors.
- - `QueryReusability` (and the `markNotReusable` method). Notably, the implementation of the `ParseT` monad now consists of two, rather than three, monad transformers.
- Cache-related tests (in `server/src-test/Hasura/CacheBoundedSpec.hs`) have been removed .
- References to query plan caching in the documentation.
- The `planCacheOptions` in the `TenantConfig` type class was removed. However, during parsing, unrecognized fields in the YAML config get ignored, so this does not cause a breaking change. (Confirmed manually, as well as in consultation with @sordina.)
- The metrics no longer send cache hit/miss messages.

There are a few places in which one can still find references to query plan caching:

- We still accept the `--query-plan-cache-size` command-line option for backwards compatibility. The `HASURA_QUERY_PLAN_CACHE_SIZE` environment variable is not read.

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

GitOrigin-RevId: 17d92b254ec093c62a7dfeec478658ede0813eb7
2021-07-27 11:52:43 +00:00
Sooraj
af9dfd3554 console: show error message on inconsistent objects table
https://github.com/hasura/graphql-engine-mono/pull/1886

GitOrigin-RevId: 074b1f54b6ed3505892b5db3466592333ba1207a
2021-07-27 06:56:52 +00:00
Ikechukwu Eze
760406b851 console: fix issues with replacing invalid graphql identifiers in table and column names
>
This PR  replaces all occurrences of invalid graphql identifiers in table and column names when tracking a table from the console.

### Description
>

### 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] Console

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

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

GitOrigin-RevId: b6f719b0f1c270908a8717b08564a97c44d8c5bf
2021-07-23 16:36:06 +00:00
Antoine Leblanc
49f40a44f0 Enforce that backends use the properly resolved environment variables.
## Description

This PR fixes an oversight in the implementation of the resolvers of different backends. To implement resolution from environment variables, both MSSQL and BigQuery were directly fetching the process' environment variables, instead of using the careful curated set we thread from main. It was working just fine on OSS, but is failing on Cloud.

This PR fixes this by adding an additional argument to `resolveSourceConfig`, to ensure that backends always use the correct set of variables.

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

GitOrigin-RevId: 58644cab7d041a8bf4235e2acfe9cf71533a92a1
2021-07-23 12:26:10 +00:00