Commit Graph

580 Commits

Author SHA1 Message Date
Daniel Chambers
31babc3693 Return correct isRepeatable value for directives in graphql schema introspection
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11058
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GitOrigin-RevId: 5fafb1611b3a080c6e90e3b7da85d41999503e73
2024-10-15 00:59:52 +00:00
Rakesh Emmadi
f4aafb234d server: Introduce option to add query field in http-log only on errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/11029
GitOrigin-RevId: f5c8aa1b81d67b84030215cb68b3bb9ee6021087
2024-09-18 09:21:02 +00:00
kodiakhq[bot]
61fe468d47 GHC 9.10.1
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10944
GitOrigin-RevId: f7e98c510a0f866f98fd43b7b1c10e5fe730e61f
2024-08-13 13:41:16 +00:00
Samir Talwar
a8d1002175 server: Factor out authentication-related code into a new namespace, Hasura.Authentication.
In preparation for tightening up the various ways in which we construct and work with session variables, I am trying to move the behavior into the same module(s) as the data types, so that we can avoid exposing the internals of data structures in favor of smart constructors and conversions.

The session variable code was split between `Hasura.RQL.Types.Roles`, `Hasura.RQL.Types.Session`, and `Hasura.Session`, with the first two containing most of the data structures (and some logic) and the latter containing the rest of the logic. These files do not interact with the rest of `Hasura.RQL`, though they are depended upon by that namespace.

I have refactored these files into a new namespace, `Hasura.Authentication`. It now looks like this:

1. Role types are now in `Hasura.Authentication.Role`.
2. Header constants were moved from `Hasura.Server.Utils` to `Hasura.Authentication.Headers` (plural) to avoid cycles.
3. Header logic was moved from various places into `Hasura.Authentication.Header` (singular) for the same reason.
4. Session variable types and logic live together in `Hasura.Authentication.Session`.
5. User info types and logic live together in `Hasura.Authentication.User`.

This new structure is cycle-free and generally avoids importing the rest of the code, which means we should be able to start pruning the list of exports and locking down session variable construction.

No behavior was changed in this changeset.

The majority of changes are to the imports in a number of files; everything depends on these things. By splitting into multiple files, we also reduce the surface area of an individual import, which was a pleasant side-effect of this work.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10960
GitOrigin-RevId: 7cb962c06483cd9b92b80432aed5cabecb465cda
2024-07-29 06:02:56 +00:00
Tom Harding
4e6394355d Return correct type when an update_many has no arguments
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10954
GitOrigin-RevId: 214163f4f4764ea66194bf26bfe202a807771e90
2024-07-26 16:19:18 +00:00
Tom Harding
3f15dfd1f5 Don't set columns to NULL when nullable variables are omitted
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10921
GitOrigin-RevId: 01779e0d02d4de1ca56d84f3d11f5e7513b87676
2024-07-19 11:59:52 +00:00
Samir Talwar
b8d7c6039b Use a test PostgreSQL image based on Debian, not Alpine.
Alpine is often slower than Debian (because musl is sometimes slower than glibc) and not how anyone actually deploys PostgreSQL in production.

Most notably, some floating-point computations result in slightly different values, and Debian ships with better support for different locales so sorting text (e.g. with `ORDER BY`) behaves differently.

Let's test against an environment that people are likely to actually use.

As a result, there are slight changes to the results of PostGIS computations in a couple of test cases.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10942
GitOrigin-RevId: 4caed19def23a372fc3930c409514b1c9b385026
2024-07-19 08:18:01 +00:00
Samir Talwar
b2ac4d82bc Remove the version from Docker Compose files.
Recent versions of Docker Compose no longer support this, instead just printing a warning.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10937
GitOrigin-RevId: 97a82968c48f5c09d6cbe74d8ea7386979e46e7a
2024-07-17 13:49:05 +00:00
Philip Lykke Carlsen
69219958d6 Postgres: Quote custom scalar types in SQL
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10914
GitOrigin-RevId: 1ea4690b801913b4fc3fa8631090e3caa76b1cdc
2024-07-05 12:22:49 +00:00
Gil Mizrahi
4b884d3d47 add a flag to disable native query validation
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10889
GitOrigin-RevId: 43f2b83fe99b1e0fd514ccaed4888694351fadfc
2024-06-21 11:49:40 +00:00
Philip Lykke Carlsen
ed97e858f7 Actually thread through where those 60 seconds come from
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10864
GitOrigin-RevId: be54d96199eb34d27dbd60b814b297f658c8be8a
2024-06-17 13:56:12 +00:00
paritosh-08
cf41d2abd9 add postgres query to traces
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10853
GitOrigin-RevId: b47c7077fc8fc7115ab05dffe93195abfeb4131d
2024-06-06 18:26:03 +00:00
Brandon Simmons
9b7a2c0b88 server/pro/opentelemetry: Fix missing overflow bucket in OTLP histogr…
…am export

This was a violation of the spec on our part, reported by a New Relic user where this results in an error. For other users the data was correct except that they were not receiving data for the overflow bucket (with upper bounds of infinity)

I don't see other reports in tracker.

See: https://github.com/open-telemetry/opentelemetry-proto/blob/v0.9.0/opentelemetry/proto/metrics/v1/metrics.proto#L550-L551

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10848
GitOrigin-RevId: cbc82e10c76e727881df4f9fbd4cbe4d6bd88969
2024-06-05 10:49:18 +00:00
Anon Ray
aa109ba331 fix: deregister relevant connection pool metrics when part of the source config is modified
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10786
GitOrigin-RevId: 6ba7a1db1df19453c59de3f41d0e0d9de93d3a8e
2024-05-13 11:45:38 +00:00
paritosh-08
25f92f379e add timeout for redis queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10788
GitOrigin-RevId: 7a18b077e106812703c73d57b70d9a7f10a7e8ac
2024-05-13 11:45:17 +00:00
Toan Nguyen
ce5ff4c367 server: support env template for otel status
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10764
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: 3dfb3478cefc8ffa9067295293203e06b3eac90c
2024-04-17 07:25:44 +00:00
Brandon Martin
47f4d2ac76 Add urlEncode for passwords with dynamic file
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10728
GitOrigin-RevId: 437ea6572d72034ab955482bf9f28b0950735097
2024-03-18 17:01:44 +00:00
Brandon Simmons
267d7fe751 server: add the ability to force refresh of dynamic db connection str…
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10713
GitOrigin-RevId: 7aa286141a27c11609614349cad05041e55b2a0f
2024-03-14 22:50:20 +00:00
Naveen Naidu
acd3f33bb5 server: add hasura_postgres_max_connection prometheus metric
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10669
GitOrigin-RevId: 6d6607a6dd520866d1aa556bab1007afd1793a01
2024-02-20 06:01:04 +00:00
kodiakhq[bot]
dd3bbef2fe Jberryman/ghc 9.6.4
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10615
GitOrigin-RevId: 8a45c92bec8444d5ec0aed125f4aa96d9c684728
2024-01-23 19:47:53 +00:00
Tom Harding
cc588a1ed3 Add support for ilike and nilike operators in BigQurey
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10638
GitOrigin-RevId: 6e97d480282b19ef0c87e08719e6421c09665d15
2024-01-23 15:28:21 +00:00
Rakesh Emmadi
f8b71fa94e server/pro/cloud: consider session variables and http headers from connection templates for query caching
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10625
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: 3bf7896437cb5bc40c491e6feac7c43e7d2c7e6e
2024-01-17 06:48:31 +00:00
Krushan Bauva
8b34100606 server: add a flag to specify header precedence when calling webhook in actions and input validations
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10594
GitOrigin-RevId: 84f58b7b957630e2fc527ece09c026bf07f3027a
2024-01-11 13:26:36 +00:00
paritosh-08
7f1f0606ed add config to prioritize data/error for remote schema fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10528
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
GitOrigin-RevId: 49d0d7cbcc73fb0876d7ac3f5a1a8ff61ff800e8
2023-12-19 13:30:30 +00:00
Samir Talwar
ae5279ccda Apply HLint's new proposed fixes.
Upgrading HLint brought in a bunch of new suggestions for improvements to the code.

I thought I'd go through them quickly and get them in.

This is not all of them, just the ones I thought were reasonable.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10505
GitOrigin-RevId: cefd661e9dcb973843b421fd0e31a5c5ffe4720f
2023-12-07 09:16:33 +00:00
Samir Talwar
0373beaed0 Upgrade nixpkgs, bump Haskell tool versions, and fix the new HLint errors.
Maintenance work to keep our server tools up to date.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10503
GitOrigin-RevId: 4402e39a5600d14c1e7d5eb4c91b152c2111f315
2023-11-22 09:02:34 +00:00
Rakesh Emmadi
970024569c server: reject null values for non-null variables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10333
GitOrigin-RevId: b778c225400cfb698570f58044b38396a685a6b6
2023-11-13 22:47:57 +00:00
David Overton
82fa13db6e Support joins on nested fields for MongoDB
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10345
GitOrigin-RevId: 1a4886b7ac5110ddf9233596068810963bde3371
2023-10-30 02:27:29 +00:00
Daniel Chambers
30ed6fc30d Dynamic from file template variables in Data Connector config Kriti transforms
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10408
Co-authored-by: Matthew Goodwin <49927862+m4ttheweric@users.noreply.github.com>
Co-authored-by: Vijay Prasanna <11921040+vijayprasanna13@users.noreply.github.com>
GitOrigin-RevId: c6d7a47079d93a6c0a987cd1df7ece9fa4d1a917
2023-10-27 12:36:11 +00:00
paritosh-08
9de2ab40e2 server: throw error in subscription for fields using remote relationship permission
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10415
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 245c2805e312f2eb05b61eec64f714c6bd0308e4
2023-10-27 11:05:47 +00:00
pranshi06
203b85af25 pro/server: add support for automated persisted queries
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10370
GitOrigin-RevId: c7a6436e4bf0efd83e9751b5d3349c30ad7404e5
2023-10-27 10:04:20 +00:00
Brandon Simmons
4007104653 server: GS-650: dynamic postgres connection strings from file
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10401
Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com>
Co-authored-by: Matthew Goodwin <49927862+m4ttheweric@users.noreply.github.com>
GitOrigin-RevId: 94967922738533a80c1af33cca7feab724cc89f6
2023-10-26 22:24:39 +00:00
Daniel Chambers
bb5a7d7789 Fix unstable ordering in data connector agent foreach tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10396
GitOrigin-RevId: 50415d3a13d8f4c79337280bfd15fdcd3fcc8c9b
2023-10-20 21:23:17 +00:00
Samir Talwar
cca591a7f9 CI: Test against PostgreSQL 16.
This changes our test configuration to use the PostgreSQL 16 image from `postgis/postgis`.

In addition, it bumps PostGIS to v3.4 (from v3.3).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10361
GitOrigin-RevId: 883c96d8453efb42b226f849891488382a99c80c
2023-10-05 12:59:17 +00:00
pranshi06
33bafdf450 server: add Env Variable to set the number of requests processed at a time in async actions
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10326
Co-authored-by: Puru Gupta <32328846+purugupta99@users.noreply.github.com>
GitOrigin-RevId: d88ef6e2bb0b94f1cba9903cf7338ff2931d7ee2
2023-09-26 06:23:54 +00:00
Samir Talwar
2467e23ef6 docker: Always use the official SQL Server image for testing.
Now that Docker for macOS supports using Rosetta for x86/amd64 emulation, we no longer need to use the `azure-sql-edge` image. We can always use the official `mcr.microsoft.com/mssql/server` one.

This also means that we no longer need the separate healthcheck container, because the official image ships with `sqlcmd`.

When this is merged, you will need to ensure you have enabled Rosetta emulation in the Docker settings to test against SQL Server on macOS. This requires macOS 13 (Ventura).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10139
GitOrigin-RevId: 2225bf5f4c6d3632da1f29b2229c9b04ead5e34c
2023-09-25 13:27:23 +00:00
Philip Lykke Carlsen
2d2fe93adf fix: MSSQL remote relationships handles large results
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10327
GitOrigin-RevId: c7e478f52f7aa7b44a3597886588b0c0f1e7341c
2023-09-25 08:49:43 +00:00
Samir Talwar
0aa5e832e5 server: Update BigQuery tests to react to a change in error messages.
BigQuery has changed its error message text. This updates the test accordingly.

We could probably be more liberal when matching the text, but as this is unlikely to change again soon, that feels like overkill.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10306
GitOrigin-RevId: 74e7926ee17e617d9ff4430b3cea220ced579ae5
2023-09-13 10:24:45 +00:00
Brandon Martin
db59d5ccf4 Add schema post and deprecate get
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10281
GitOrigin-RevId: 9fae2d61bd5120302ae199016b71e2b0ecac422a
2023-09-07 13:35:29 +00:00
Daniel Harvey
a9cf1594f9 chore(api-tests): update Logimo test helpers
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10196
GitOrigin-RevId: b858ca810b65a6adecf4afa0af3f7a71066ab149
2023-08-29 08:23:33 +00:00
Philip Lykke Carlsen
b522a0f650 fix: Introduce naming-convention-sep-2023 feature flag
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10200
GitOrigin-RevId: 02654837c3b98a7cbfb89cf98a1d7b5287fed1b4
2023-08-28 08:43:08 +00:00
paritosh-08
e1cfc56fc3 server: add remote source relationship in permission
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9575
GitOrigin-RevId: 4566d51d48f9ace583b04fbe04c534d6aeb771ea
2023-08-22 14:35:14 +00:00
Daniel Harvey
f4c9c16f0e chore(server): add Table -> NQ array relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10150
GitOrigin-RevId: fc4ea33b1951cb960187bb53d4c3ef8471566dc9
2023-08-22 12:39:49 +00:00
Daniel Chambers
c726b528c4 Add table/function filtering and detail level to schema introspection for Data Connectors to improve performance
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10074
GitOrigin-RevId: 12de7387746f456cbefd9f76e446f56e9e643dc9
2023-08-18 04:29:17 +00:00
Daniel Harvey
f8d60a74a0 chore(server): Table -> Native Query object relationships
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10114
GitOrigin-RevId: 0181184d1bc0e851151f86a98c96c97888a10e3e
2023-08-17 15:35:31 +00:00
Samir Talwar
15ac52ded4 server: Fix the Analyze feature for SQL Server.
The "Analyze" feature for SQL Server only partially worked. It would show the SQL generated, but not the execution plan. This is because SQL Server doesn't support generating a plan for prepared statements with parameters.

To work around this, we restructure the query as one without parameters. Instead, we replace each parameter with a variable. We declare the variables but don't set values. We then plan _that_, which works.

We run all this in a single query because local variables only last for a single transaction/batch.

This feature does not work for stored procedures.

[NDAT-582]: https://hasurahq.atlassian.net/browse/NDAT-582?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10125
GitOrigin-RevId: a4b45b9b207456ff4fbd1b69b008e93f87346342
2023-08-17 12:51:57 +00:00
Lyndon Maydwell
41054de113 Data Connectors Native Queries Support
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9499
Co-authored-by: gneeri <10553562+gneeri@users.noreply.github.com>
GitOrigin-RevId: 1e351556c43e643aa973f87adc0306f076cd227e
2023-08-17 02:05:14 +00:00
Daniel Chambers
131fe3d9e6 Block the use of column redaction where the data connector agent does not support it
[GDC-1292]: https://hasurahq.atlassian.net/browse/GDC-1292?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10108
GitOrigin-RevId: 830102b8cf1e6ad53b9971460dee147b678f008d
2023-08-15 05:13:15 +00:00
David Overton
7a9e1f6ea6 Order by nested fields
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10082
GitOrigin-RevId: 9c53d7ce3635f442451e04f70f0975ed79a3f4f7
2023-08-14 06:41:50 +00:00
Krushan Bauva
cb9996d9e5 server: add Prometheus metrics hasura_postgres_connection_init_time and hasura_postgres_pool_wait_time
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10032
GitOrigin-RevId: 696522090a252f8838c31da9ab92e6ed2b5cc5f8
2023-08-10 11:08:42 +00:00