graphql-engine/v3/crates
Tom Harding c8a1678b7a Note the names of subgraphs in error contexts where applicable (#1359)
<!-- 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
2024-11-21 12:41:21 +00:00
..
auth Stop Nix rebuilding (#1329) 2024-11-11 12:06:31 +00:00
compatibility Factor out jsonpath into its own crate (#1101) 2024-09-11 15:21:47 +00:00
custom-connector Support nested relationships via remote joins if the connector does not natively support them (#1355) 2024-11-19 05:42:00 +00:00
engine Rework GraphQL schema and IR parsing for boolean expressions to fix issues with nested fields (#1361) 2024-11-20 23:38:55 +00:00
execute Rework GraphQL schema and IR parsing for boolean expressions to fix issues with nested fields (#1361) 2024-11-20 23:38:55 +00:00
graphql Rework GraphQL schema and IR parsing for boolean expressions to fix issues with nested fields (#1361) 2024-11-20 23:38:55 +00:00
jsonapi ENG-1287 remove metadata copy from SQL artifact (#1348) 2024-11-18 18:26:36 +00:00
metadata-resolve Note the names of subgraphs in error contexts where applicable (#1359) 2024-11-21 12:41:21 +00:00
metadata-schema-generator Stop Nix rebuilding (#1329) 2024-11-11 12:06:31 +00:00
open-dds Make using ObjectBooleanExpressionType an error (#1344) 2024-11-14 17:02:38 +00:00
plan Add new execution plan types to plan-types crate (#1363) 2024-11-20 19:35:44 +00:00
plan-types Add new execution plan types to plan-types crate (#1363) 2024-11-20 19:35:44 +00:00
plugins Stop Nix rebuilding (#1329) 2024-11-11 12:06:31 +00:00
query-usage-analytics Stop Nix rebuilding (#1329) 2024-11-11 12:06:31 +00:00
sql Add new execution plan types to plan-types crate (#1363) 2024-11-20 19:35:44 +00:00
utils Note the names of subgraphs in error contexts where applicable (#1359) 2024-11-21 12:41:21 +00:00