mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
c8a1678b7a
<!-- The PR description should answer 2 important questions: --> ### What It's helpful (given the CLI's version of our metadata format) to talk about configuration in terms of subgraphs as well as the JSON structure that MBS ingests. This PR updates the error contexts to contain that name. Here's an example: ```json { "errors": [ { "context": [ { "message": "Data connector name given here", "path": [ { "Key": "subgraphs" }, { "Index": 0 }, { "Key": "objects" }, { "Index": 0 }, { "Key": "definition" }, { "Key": "source" }, { "Key": "dataConnectorName" } ], "subgraph": "default" } ], "path": null, "code": "opendds-validation", "message": "invalid metadata: error building schema: invalid metadata: the source data connector b (in subgraph default) for model Artists (in subgraph default) has not been defined" } ] } ``` As we can see, the `subgraph` key tells us what the subgraph is. Note that the path contains the fact that we have a subgraphs array, so this will need removing by a CLI tool if a subgraph is present. Not doing this on the server side means we can write non-CLI tooling around these errors as well. ### How We just add the `subgraph` key to the error context, and fix the raw metadata deserializers. I'm not sure why these are separate to the standard opendd deserializers. V3_GIT_ORIGIN_REV_ID: 3c50bcc649e2842b35a2f05059c2f795c620ea23 |
||
---|---|---|
.. | ||
auth | ||
compatibility | ||
custom-connector | ||
engine | ||
execute | ||
graphql | ||
jsonapi | ||
metadata-resolve | ||
metadata-schema-generator | ||
open-dds | ||
plan | ||
plan-types | ||
plugins | ||
query-usage-analytics | ||
sql | ||
utils |