graphql-engine/server/src-lib/Hasura/Backends/MySQL
Auke Booij 83ea4a254d server: plumb StoredIntrospection while building the Schema Cache
We'd like to be able to build a Schema Cache from only serializable data. We already have Metadata. The data that's missing to build a Schema Cache is referred to as "stored introspection", and this includes:
- DB introspection
- User-defined enum values (i.e. contents of specific DB tables)
- Remote schema introspection

This PR introduces a new `StoredIntrospection` container that holds that data, and plumbs it through to the right parts of the schema cache building process, so that stored introspection can be used as a substitute for fresh introspection requests against live data sources.

The serialization of `StoredIntrospection` is intended to be straightforward: just take the serialized source introspection results, and put them in an appropriate JSON object. Though I don't think that this PR achieves that entirely.

In order for `StoredIntrospection` to be deserializable (through `aeson` instances), while keeping the required code changes low, this piggy-backs off of the `ResolvedSource` data type. `ResolvedSource` is _almost_ exactly what we want, and _almost_ deserializable, so this PR brings it across the finish line by moving a few things out of that type, and adding a `FromJSON (RawFunctionInfo b)` context to the `Backend` type class.

[PLAT-270]: https://hasurahq.atlassian.net/browse/PLAT-270?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[PLAT-270]: https://hasurahq.atlassian.net/browse/PLAT-270?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[PLAT-276]: https://hasurahq.atlassian.net/browse/PLAT-276?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[PLAT-276]: https://hasurahq.atlassian.net/browse/PLAT-276?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7053
GitOrigin-RevId: 5001b4ea086195cb5e65886747eac2a0a657b64c
2023-01-20 14:52:36 +00:00
..
DataLoader Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
Instances Refactor Update IR to generalize Update vs Update Many across backends - compositional approach [GDC-687] 2023-01-10 01:56:14 +00:00
Types Show RQL IR Select 2023-01-04 08:29:43 +00:00
Connection.hs server: plumb StoredIntrospection while building the Schema Cache 2023-01-20 14:52:36 +00:00
FromIr.hs server: transform enum with upper for graphql-default 2022-07-19 06:56:45 +00:00
Meta.hs Remove strictness annotations from data types in the Hasura.Backends hierarchy 2022-07-29 14:06:23 +00:00
Plan.hs Move Hasura.GraphQL.Parser.Column to .RQL.IR. and .GraphQL.Schema. 2022-05-30 22:07:57 +00:00
SQL.hs Remove strictness annotations from data types in the Hasura.Backends hierarchy 2022-07-29 14:06:23 +00:00
ToQuery.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
Types.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00