Commit Graph

772 Commits

Author SHA1 Message Date
Rakesh Emmadi
a2cf9a53c2 server: move to storing metadata as a json blob (#115)
GitOrigin-RevId: 3d1a7618a4ec086c2d255549a6c15087201e9ab0
2020-12-08 14:23:28 +00:00
Auke Booij
5edca3a5c2 server: add tshow :: Show a => a -> Text, including hlint hint (#142)
GitOrigin-RevId: 627a55533831b51aa0d01f8a8d95e3d013744dc5
2020-12-08 12:38:31 +00:00
hasura-bot
920c6ea427 ci: add hlint escape hatch (#71)
* ci: add hlint escape hatch

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GITHUB_PR_NUMBER: 6164
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6164

* Applied changes to new workflow files.

* Add missing label trigger for lint worklow

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: 3e22c301a9412f7f77978b35f29c38c7876ac13f
2020-12-07 12:10:38 +00:00
Auke Booij
9fb80d1230 server: remove some unused top-level definitions; some minor code cleanups (#141)
GitOrigin-RevId: 92002684c5d89791a05975e4b137d93599491ffa
2020-12-04 19:33:10 +00:00
Auke Booij
be7f34891c server: give stack traces when encountering conflicting type definitions (#150)
Since PDV, introspection queries are parsed by a certain kind of reflection where during the GraphQL schema generation, we collect all GraphQL types used during schema generation to generate answers to introspection queries. This has a great advantage, namely that we don't need to keep track of which types are being used in our schema, as this information is extracted after the fact.

But what happens when we encounter two types with the same name in the GraphQL schema? Well, they better be the same, otherwise we likely made a programming error. So what do we do when we *do* encounter a conflict? So far, we've been throwing a rather generic error message, namely `found conflicting definitions for <typename> when collecting types from the schema`. It does not specify what the conflict is, or how it arose. In fact, I'm a little bit hesitant to output more information about what the conflict is, because we support many different kinds of GraphQL types, and these can have disagreements in many different ways. It'd be a bit tiring (not to mention error-prone) to spell this out explicitly for all types. And, in any case, at the moment our equality checks for types is incorrect anyway, as we are avoiding implementing a certain recursive equality checking algorithm.

As it turns out, type conflicts arise not just due to programming errors, but also arise naturally under certain configurations. @codingkarthik encountered an interesting case recently where adding a specific remote and a single unrelated database table would result in a conflict in our Relay schema. It was not readily visible how this conflict arose: this took significant engineering effort.

This adds stack traces to type collection, so that we can inform the user where the type conflict is taking place. The origin of the above conflict can easily be spotted using this PR. Here's a sample error message:

```
Found conflicting definitions for "PageInfo". The definition at "mutation_root.UpdateUser.favourites.anime.edges.node.characters.pageInfo" differs from the the definition at "query_root.test_connection.pageInfo"
```

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: d4c01c243022d8570b3c057b168a61c3033244ff
2020-12-04 15:37:55 +00:00
hasura-bot
3451413d1a server: do not block catalog migration on inconsistent metadata (#139)
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6286
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6286

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
GitOrigin-RevId: 27bbfc960da87e4ad54bad5943782f28aa113874
2020-12-04 08:39:05 +00:00
hasura-bot
115f2cb621 server: don't memoize backend scalar type reps through WithScalarType (#136)
Co-authored-by: Auke Booij <auke@hasura.io>
GITHUB_PR_NUMBER: 6281
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6281
GitOrigin-RevId: b7ab3352af21175f0065f1bc2304a1232f6a5580
2020-12-03 12:22:24 +00:00
Phil Freeman
20913c254d server: allocation limits (#82)
* server: allocation limits

* Move most of the allocation limits work into Pro

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* code review changes

* fix build

Co-authored-by: Brandon Simmons <brandon@hasura.io>
GitOrigin-RevId: 035f15def48f4a0376cb2701eff9982c43a78e2d
2020-12-03 04:07:22 +00:00
Antoine Leblanc
3537e2acdc server: fix primary key mutations issue (closes #6255) (#129)
* Add update_by_pk test with more interesting permissions.

* Add new delete test with more interesting permissions.

* Fix byPk operations not providing all columns.

* Empty commit to unlock ci.

GitOrigin-RevId: eb1ca2cc4c59f421bc5fedf49bef91aa4bbdca94
2020-12-02 14:13:00 +00:00
Swann Moreau
e873c4e650 server: add metric for warp threads (#88)
* server: add ekg gauge to count number of warp threads currently alive

* Apply suggestions from code review

* Fix a weird impredicativity bug

* changelog

* Update server/src-lib/Hasura/App.hs

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Add hlint pragma :|

Co-authored-by: Phil Freeman <phil@hasura.io>
Co-authored-by: Phil Freeman <paf31@cantab.net>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GitOrigin-RevId: 02e5d85cd8bdf7b1ebbe3395c61d8cac3abc135f
2020-12-02 06:16:58 +00:00
Phil Freeman
1843643c74 Disallow caching for remote joins with forwarded headers (master) (#58)
GitOrigin-RevId: 76eb061534fd2a068965b8b22517a0729d9e3020
2020-12-01 23:24:24 +00:00
Brandon Simmons
bcf251a469 Add missing PROFILING CPP pragma
GitOrigin-RevId: b50acc16cd7194e5a778a34592d44cf21c969d52
2020-12-01 16:05:10 +00:00
Auke Booij
3c3ed55914 server: schema that grows (#105)
This PR makes a bunch of schema generation code in Hasura.GraphQL.Schema backend-agnostic, by moving the backend-specific parts into a new BackendSchema type class. This way, the schema generation code can be reused for other backends, simply by implementing new instances of the BackendSchema type class.

This work is now in a state where the schema generators are sufficiently generic to accept the implementation of a new backend. That means that we can start exposing MS SQL schema. Execution is not implemented yet, of course.
The branch currently does not support computed fields or Relay. This is, in a sense, intentional: computed field support is normally baked into the schema generation (through the fieldSelection schema generator), and so this branch shows a programming technique that allows us to expose certain GraphQL schema depending on backend support. We can write support for computed fields and Relay at a later stage.

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: df369fc3d189cbda1b931d31678e9450a6601314
2020-12-01 15:51:13 +00:00
hasura-bot
f6bd354b40 server: hasura on PG v13 (#125)
GitOrigin-RevId: 00fd91c250bcf3dc7ee638e3b152e0dab7281de7
2020-12-01 12:22:42 +00:00
hasura-bot
7b31ff99d1 Support Postgres POSIX regex operators (close #4317) (#119)
Co-authored-by: christophediprima <dipdipdip84@gmail.com>
Co-authored-by: dip <dipdipdip84@gmail.com>
Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GITHUB_PR_NUMBER: 6172
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6172
GitOrigin-RevId: 5192d238b527cd21b6efb2f74e279ecc34756c29
2020-11-27 10:54:52 +00:00
Auke Booij
86aef93d31 server: remove a few unused Lift instances (#114)
GitOrigin-RevId: b5679e9579d226f7209b73ac966d29391c308c06
2020-11-26 13:58:07 +00:00
Auke Booij
350d6b3d43 server: make the UnpreparedValue less tightly bound to the backend (#108)
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: 90cb7e1cc97961523085ae7ae3d195549b901b1f
2020-11-25 16:08:27 +00:00
hasura-bot
64743cb189 server: all remaining IR changes (#75)
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GITHUB_PR_NUMBER: 6233
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6233

Co-authored-by: Antoine Leblanc <antoine@hasura.io>
Co-authored-by: Auke Booij <auke@hasura.io>
GitOrigin-RevId: 268cdad529ad5d9bebeb5b881fda5413ea9d7715
2020-11-25 14:19:50 +00:00
hasura-bot
29925eb08d server: metadata storage abstraction for scheduled triggers
An incremental PR towards https://github.com/hasura/graphql-engine/pull/5797

* metadata storage abstraction for scheduled triggers

Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Auke Booij <auke@hasura.io>
GITHUB_PR_NUMBER: 6131
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6131

* update pro server code

Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Auke Booij <auke@hasura.io>
GitOrigin-RevId: 17244a47b3e8633acf2492e0b0734b72025f0a09
2020-11-25 10:57:38 +00:00
Tirumarai Selvan A
6fe5daa702 fix migration to 1) account for long trigger names and 2) correct syntax for dropping function without arguments in pg < 10
GitOrigin-RevId: b5382db23dcf8c05a9936404b8ab303a336c8a44
2020-11-25 09:29:04 +00:00
hasura-bot
5ca8cd23a0 server: support remote relationship with ID scalar types (#92)
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6227
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6227

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GitOrigin-RevId: 666ec37d570e46482e0f27db2c97c9e3f9c1f4d3
2020-11-24 12:20:22 +00:00
hasura-bot
d955001046 server: schema cache syncing without relying on a Postgres table (#40)
An incremental PR towards # 5797 (OSS repo)

* schema cache syncing without relying on a Postgres table

Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
GITHUB_PR_NUMBER: 6173
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6173

* fix pro compile issues

Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
GitOrigin-RevId: 055b06ae477af80892124ff55d005d04a8034c34
2020-11-24 06:11:07 +00:00
hasura-bot
fb902d4209 Support tracking SQL functions as mutations. Closes #1514 (#34)
* Support tracking SQL functions as mutations. Closes #1514

Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GITHUB_PR_NUMBER: 6160
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6160

* Update docs/graphql/core/api-reference/schema-metadata-api/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/core/schema/custom-functions.rst

Co-authored-by: Brandon Simmons <brandon@hasura.io>
Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Marion Schleifer <marion@hasura.io>
GitOrigin-RevId: 8fd39258641ecace6e3e9930e497b1655ad35080
2020-11-18 18:05:59 +00:00
hasura-bot
8eebcb9bdf server: query remote server in a remote join query iff all arguments are not null (#31)
* server: query remote server in a remote join query iff all arguments are not null

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
GITHUB_PR_NUMBER: 6199
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6199

* Update server/src-lib/Hasura/Backends/Postgres/Execute/RemoteJoin.hs

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Apply suggestions from code review

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Update server/tests-py/test_remote_relationships.py

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* Apply suggestions from code review

Co-authored-by: Brandon Simmons <brandon@hasura.io>

* use guard instead of case match

* add comment about the remote relationship joining

* add a comment about the design discussion

* update CHANGELOG

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
GitOrigin-RevId: ce7e8288d37ad7c32705f96cb6363f6ad68f3c0a
2020-11-18 09:00:12 +00:00
Tirumarai Selvan A
ba45d0454d tag release v1.3.3
GitOrigin-RevId: e7ded3aaa7677e8baa5a30217625f32b68f7fb0b
2020-11-17 15:05:44 +00:00
hasura-bot
e80515600d archive invalid events and drop existing invalid postgres triggers (#27)
GITHUB_PR_NUMBER: 6181
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/6181

Co-authored-by: Tirumarai Selvan A <tiru@hasura.io>
GitOrigin-RevId: fdbc18abe42f2f5737d71a2fa95a2c80e6b4a85a
2020-11-16 10:10:09 +00:00
Vishnu Bharathi P
58c44f55dd Merge oss/master onto mono/main
GitOrigin-RevId: 1c8c4d60e033c8a0bc8b2beed24c5bceb7d4bcc8
2020-11-12 22:37:19 +05:30
Phil Freeman
9faf5d90f7 Pro: use local graphql-engine (#14)
* Use local graphql-engine, WIP

* Implement cacheLookup and cacheStore

* Fix the key generatio ncode, deduplicate

* changelog

* More deduplication

* Run tests from this repo

* remove changelog

Co-authored-by: Anon Ray <rayanon004@gmail.com>
GitOrigin-RevId: 80d10c4dfdcadbe9f49ec50fe67aa981202c98c9
2020-11-12 22:37:19 +05:30
Vishnu Bharathi P
666058ab7f oss: renames dot files and folders
GitOrigin-RevId: 540aeec3be091e1cfb7b05a988f50445534ed663
2020-11-12 22:37:19 +05:30
Antoine Leblanc
70303a5a68
server: post-pdv Insert IR cleanup (#6162)
https://github.com/hasura/graphql-engine/pull/6162
2020-11-11 17:06:38 +00:00
Antoine Leblanc
fd5f64e1ed
server: remove postgres-specific code from OrderBy IR (#6150)
https://github.com/hasura/graphql-engine/pull/6150
2020-11-10 17:04:50 +00:00
Karthikeyan Chinnakonda
d3f724634f
server: reorder migration files to align with v1.3.3 (#6165)
https://github.com/hasura/graphql-engine/pull/6165
2020-11-10 14:45:08 +00:00
Alexis King
6787a1b1b0
Fix the way replace_metadata drops event triggers (fix #5461) (#6137)
https://github.com/hasura/graphql-engine/pull/6137
2020-11-10 12:02:38 +00:00
Antoine Leblanc
d769a7536e
server: remove postgres-specific code in Insert IR (#6149)
https://github.com/hasura/graphql-engine/pull/6149
2020-11-10 11:04:31 +00:00
Antoine Leblanc
f8ad1698a9
Move MutationCTE code to Postgres.Translate. (#6148)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
2020-11-10 15:31:49 +05:30
Antoine Leblanc
7960cd1c87
server: generalize table name IR (#6127)
https://github.com/hasura/graphql-engine/pull/6127
2020-11-10 07:50:26 +00:00
Vamshi Surabhi
10ada484f4
adds haskell-language-server/ghcide configuration (#6133) 2020-11-09 19:05:39 +05:30
Auke Booij
0b98e8c504
server: add hlint hints to replace case analysis with combinators (#6145)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-09 13:27:16 +01:00
Antoine Leblanc
39843e48f2
server: split RQL.Types.DML (#6101)
https://github.com/hasura/graphql-engine/pull/6101
2020-11-09 10:03:38 +00:00
Rakesh Emmadi
ca47c92f50
server: avoid raising mutation check constraint violation in pg procedure (#6123)
https://github.com/hasura/graphql-engine/pull/6123
2020-11-06 13:22:22 +00:00
kodiakhq[bot]
8df3f07909
Merge branch 'master' into fix-6041 2020-11-05 16:08:58 +00:00
Rakesh Emmadi
8bf84dff17
Avoid hdb_views schema for storing event trigger procedures (#6135)
https://github.com/hasura/graphql-engine/pull/6135
2020-11-05 12:12:13 +00:00
Tirumarai Selvan A
78afba7c2a use readcommitted isolation level for event fetch 2020-11-05 17:24:37 +05:30
Karthikeyan Chinnakonda
81fd1ec083
server: minor refactoring in the remote joins execution module (#6130)
* server: refactor the fetchRemoteJoinFields function

* apply hlint suggestions

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-05 11:51:39 +05:30
Auke Booij
49a7a074c1
server: avoid two circular imports (#6134)
https://github.com/hasura/graphql-engine/pull/6134
2020-11-05 04:26:47 +00:00
Auke Booij
21e38760e3
server: re-implement table name validity filtering (#6132) 2020-11-04 14:40:01 +01:00
Antoine Leblanc
faf321ce17
server: generalize SQLExp in RQL.IR (#6091)
https://github.com/hasura/graphql-engine/pull/6091
2020-11-04 10:50:56 +00:00
Karthikeyan Chinnakonda
77a04c7395
Server: Fix flaky action timeout test (#6124)
https://github.com/hasura/graphql-engine/pull/6124
2020-11-04 07:09:53 +00:00
Auke Booij
3bcde3d4b8
server: metadata separation: reorganize metadata types (#6103)
https://github.com/hasura/graphql-engine/pull/6103
2020-11-03 18:01:33 +00:00
Sasha Bogicevic
81e836a12c
server: configurable websocket keep alive interval (#6092)
Accept new server flag --websocket-keepalive to control
websockets keep-alive interval

Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-03 18:04:48 +01:00