graphql-engine/server/src-lib/Hasura/RQL/DDL
Antoine Leblanc cc6c86aeab Clean metadata arguments
## Description

Thanks to #1664, the Metadata API types no longer require a `ToJSON` instance. This PR follows up with a cleanup of the types of the arguments to the metadata API:
- whenever possible, it moves those argument types to where they're used (RQL.DDL.*)
- it removes all unrequired instances (mostly `ToJSON`)

This PR does not attempt to do it for _all_ such argument types. For some of the metadata operations, the type used to describe the argument to the API and used to represent the value in the metadata are one and the same (like for `CreateEndpoint`). Sometimes, the two types are intertwined in complex ways (`RemoteRelationship` and `RemoteRelationshipDef`). In the spirit of only doing uncontroversial cleaning work, this PR only moves types that are not used outside of RQL.DDL.

Furthermore, this is a small step towards separating the different types all jumbled together in RQL.Types.

## Notes

This PR also improves several `FromJSON` instances to make use of `withObject`, and to use a human readable string instead of a type name in error messages whenever possible. For instance:
- before: `expected Object for Object, but encountered X`
  after: `expected Object for add computed field, but encountered X`
- before: `Expecting an object for update query`
  after: `expected Object for update query, but encountered X`

This PR also renames `CreateFunctionPermission` to `FunctionPermissionArgument`, to remove the quite surprising `type DropFunctionPermission = CreateFunctionPermission`.

This PR also deletes some dead code, mostly in RQL.DML.

This PR also moves a PG-specific source resolving function from DDL.Schema.Source to the only place where it is used: App.hs.

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

GitOrigin-RevId: a594521194bb7fe6a111b02a9e099896f9fed59c
2021-07-27 10:42:51 +00:00
..
Metadata server: add metadata for DB-DB remote joins 2021-07-22 23:07:10 +00:00
Permission Clean metadata arguments 2021-07-27 10:42:51 +00:00
Relationship Clean metadata arguments 2021-07-27 10:42:51 +00:00
RemoteRelationship server: add metadata for DB-DB remote joins 2021-07-22 23:07:10 +00:00
RemoteSchema server: rewrite remote input parsers to deal with partial variable expansion (fix hasura/graphql-engine#6656) 2021-05-24 20:13:47 +00:00
Schema Clean metadata arguments 2021-07-27 10:42:51 +00:00
Action.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
ApiLimit.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
ComputedField.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
CustomTypes.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Deps.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Endpoint.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
EventTrigger.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
GraphqlSchemaIntrospection.hs server: introduce Hasura.Base (take 2) 2021-05-11 15:19:33 +00:00
Headers.hs server: misc cleanups 2021-06-15 15:06:37 +00:00
InheritedRoles.hs server: inherited roles improvements for select permissions only 2021-07-16 21:19:58 +00:00
Metadata.hs server: add metadata for DB-DB remote joins 2021-07-22 23:07:10 +00:00
Permission.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
QueryCollection.hs server: relax unique operation name constraint in a query collection 2021-07-21 12:05:50 +00:00
Relationship.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
RemoteRelationship.hs Clean metadata arguments 2021-07-27 10:42:51 +00:00
RemoteSchema.hs server, console, docs: add update_remote_schema API 2021-06-21 17:42:40 +00:00
ScheduledTrigger.hs server: fix cron trigger bug of new events not getting generated when cron trigger is imported via metadata 2021-05-26 16:20:19 +00:00
Schema.hs server: misc cleanups 2021-06-15 15:06:37 +00:00