graphql-engine/server/src-lib/Hasura
Antoine Leblanc f7071b3c93 Changed RemoteSchemaIntrospection's internal representation from a list to a hashmap.
### Description

This PR changes the internal representation of a parsed remote schema. We were still using a list of type definitions, meaning every time we were doing a type lookup we had to iterate through a linked list! 🙀 It was very noticeable on large schemas, that need to do a lot of lookups. This PR consequently changes the internal representation to a HashMap. Building the OneGraph schema on my machine now takes **23 seconds**, compared to **367 seconds** before this patch.

Some important points:
- ~~this PR removes a check for type duplication in remote schemas; it's unclear to me whether that's something we need to add back or not~~ (no longer true)
- this PR makes it obvious that we do not distinguish between "this remote schema is missing type X" and "this remote schema expects type X to be an object, but it's a scalar"; this PR doesn't change anything about it, but adds a comment where we could surface that error (see [2991](https://github.com/hasura/graphql-engine-mono/issues/2991))

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2963
GitOrigin-RevId: f5c96ad40f4e0afcf8cef635b4d64178111f98d3
2021-11-30 14:47:50 +00:00
..
Backends multitenant: support for event disabling 2021-11-30 12:32:26 +00:00
Base server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
Cache server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Eventing server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
GraphQL Changed RemoteSchemaIntrospection's internal representation from a list to a hashmap. 2021-11-30 14:47:50 +00:00
Incremental server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
Metadata server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
RQL Changed RemoteSchemaIntrospection's internal representation from a list to a hashmap. 2021-11-30 14:47:50 +00:00
Server multitenant: support for event disabling 2021-11-30 12:32:26 +00:00
SQL server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
App.hs multitenant: support for event disabling 2021-11-30 12:32:26 +00:00
EncJSON.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
GC.hs server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
HTTP.hs server: drop HasVersion implicit parameter (closes #2236) 2021-10-13 16:39:58 +00:00
Incremental.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Logging.hs server: log DB locking queries during source catalog migration 2021-11-09 14:22:44 +00:00
Prelude.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
QueryTags.hs server: add explicit export lists in OSS server and enforce with warning 2021-11-04 16:09:38 +00:00
Session.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Tracing.hs server: interpTraceT docs and small changes 2021-09-25 04:00:34 +00:00