graphql-engine/v3/crates/engine/tests/execute/description/metadata.json
Samir Talwar c4b659e12c Rename "source" to "sourceType" for "kind": "Relationship". (#531)
## Description

To clarify the purpose of the `"source"` field, we've decided to rename
it to `"sourceType"`. This hopefully makes it clearer that the value
should be a type name.

`"source"` is still accepted as an alias in order to stop this from
being a breaking change.

I have added the aliasing capability for struct fields in
`opendds_derive`.

All test metadata has been updated to use `"sourceType"`, but I've added
one test case that uses `"source"` instead just to make sure that it
still works.

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes
  in this PR have any user-facing impact. See
[changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
  `no-changelog-required` label to the PR.

### Product

_(Select all products this will be available in)_

- [x] community-edition
- [x] cloud
<!-- product : end : DO NOT REMOVE -->

### Type

<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->

_(Select only one. In case of multiple, choose the most appropriate)_

- [ ] highlight
- [ ] enhancement
- [ ] bugfix
- [x] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry

<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

- OpenDDS: The `"source"` field for relationships has been renamed to
`"sourceType"`. Metadata using `"source"` will continue to work as
usual, but new metadata should be authored with `"sourceType"` instead.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: 305cbf7a62ee49a715e95ad892b8d00647f05cef
2024-04-30 17:21:07 +00:00

466 lines
12 KiB
JSON

{
"version": "v2",
"subgraphs": [
{
"name": "default",
"objects": [
{
"kind": "DataConnectorScalarRepresentation",
"version": "v1",
"definition": {
"dataConnectorName": "db",
"dataConnectorScalarType": "String",
"representation": "String",
"graphql": {
"comparisonExpressionTypeName": "String_Comparison_Exp"
}
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "Actor",
"description": "Object to identify an actor.",
"fields": [
{
"name": "actor_id",
"description": "Unique ID to identify an actor.",
"type": "Int!"
},
{
"name": "name",
"description": "Name of the actor.",
"type": "String!"
},
{
"name": "movie_id",
"description": "Movie ID.",
"type": "Int!"
}
],
"graphql": {
"typeName": "Actor"
},
"dataConnectorTypeMapping": [
{
"dataConnectorName": "custom",
"dataConnectorObjectType": "actor",
"fieldMapping": {
"actor_id": {
"column": {
"name": "id"
}
},
"name": {
"column": {
"name": "name"
}
},
"movie_id": {
"column": {
"name": "movie_id"
}
}
}
}
]
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "author",
"fields": [
{
"name": "author_id",
"description": "Identifier to uniquely identify an author",
"type": "Int!"
},
{
"name": "first_name",
"type": "String!"
},
{
"name": "last_name",
"type": "String!"
}
],
"graphql": {
"typeName": "Author"
}
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "author",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": ["author_id", "first_name", "last_name"]
}
},
{
"role": "user",
"output": {
"allowedFields": ["author_id", "first_name", "last_name"]
}
}
]
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "Authors",
"objectType": "author",
"arguments": [
{
"name": "authors_arg",
"type": "Int!",
"description": "Authors argument description"
}
],
"graphql": {
"selectUniques": [
{
"queryRootField": "AuthorByID",
"description": "Selecting an author by ID",
"uniqueIdentifier": ["author_id"]
}
],
"selectMany": {
"queryRootField": "AuthorMany"
},
"orderByExpressionType": "AuthorOrderBy",
"argumentsInputType": "AuthorArgs"
},
"orderableFields": [
{
"fieldName": "author_id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "first_name",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "last_name",
"orderByDirections": {
"enableAll": true
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "Authors",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
},
{
"role": "user",
"select": {
"filter": null
}
}
]
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "Actor",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": ["actor_id", "name", "movie_id"]
}
}
]
}
},
{
"kind": "ScalarType",
"version": "v1",
"definition": {
"description": "Opaque scalar type description.",
"name": "Opaque",
"graphql": {
"typeName": "Opaque"
}
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "NameFilterOpaqueSurname",
"description": "Some description for custom input object type",
"fields": [
{
"name": "first_name",
"description": "Some description of first name",
"type": "String"
},
{
"name": "surname",
"description": "Some description of last name",
"type": "Opaque"
}
],
"graphql": {
"inputTypeName": "NameFilterOpaqueSurname"
},
"dataConnectorTypeMapping": [
{
"dataConnectorName": "custom",
"dataConnectorObjectType": "name_query",
"fieldMapping": {
"first_name": {
"column": {
"name": "first_name"
}
},
"surname": {
"column": {
"name": "last_name"
}
}
}
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_actors_by_name_opaque_surname",
"arguments": [
{
"name": "name_filter",
"type": "NameFilterOpaqueSurname!"
}
],
"outputType": "[Actor!]!",
"source": {
"dataConnectorName": "custom",
"dataConnectorCommand": {
"function": "get_actors_by_name"
},
"argumentMapping": {
"name_filter": "name"
}
},
"graphql": {
"rootFieldName": "getActorsByNameOpaqueSurname",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_actors_by_name_opaque_surname",
"permissions": [
{
"role": "admin",
"allowExecution": true
}
]
}
},
{
"kind": "Command",
"version": "v1",
"definition": {
"name": "get_actors_by_opaque_name",
"description": "Command to get the actors matching a given name.",
"arguments": [
{
"name": "name_filter",
"description": "name_filter command argument description",
"type": "Opaque!"
}
],
"outputType": "[Actor!]!",
"source": {
"dataConnectorName": "custom",
"dataConnectorCommand": {
"function": "get_actors_by_name"
},
"argumentMapping": {
"name_filter": "name"
}
},
"graphql": {
"rootFieldName": "getActorsByOpaqueName",
"rootFieldKind": "Query"
}
}
},
{
"kind": "CommandPermissions",
"version": "v1",
"definition": {
"commandName": "get_actors_by_opaque_name",
"permissions": [
{
"role": "admin",
"allowExecution": true
}
]
}
},
{
"kind": "ObjectType",
"version": "v1",
"definition": {
"name": "article",
"fields": [
{
"name": "article_id",
"type": "Int!"
},
{
"name": "title",
"type": "String!"
},
{
"name": "author_id",
"type": "Int!"
}
],
"graphql": {
"typeName": "Article"
}
}
},
{
"kind": "TypePermissions",
"version": "v1",
"definition": {
"typeName": "article",
"permissions": [
{
"role": "admin",
"output": {
"allowedFields": ["article_id", "title", "author_id"]
}
},
{
"role": "user",
"output": {
"allowedFields": ["title", "author_id", "article_id"]
}
}
]
}
},
{
"kind": "Model",
"version": "v1",
"definition": {
"name": "Articles",
"objectType": "article",
"orderableFields": [
{
"fieldName": "article_id",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "title",
"orderByDirections": {
"enableAll": true
}
},
{
"fieldName": "author_id",
"orderByDirections": {
"enableAll": true
}
}
]
}
},
{
"kind": "ModelPermissions",
"version": "v1",
"definition": {
"modelName": "Articles",
"permissions": [
{
"role": "admin",
"select": {
"filter": null
}
},
{
"role": "user",
"select": {
"filter": null
}
}
]
}
},
{
"kind": "Relationship",
"version": "v1",
"definition": {
"sourceType": "author",
"name": "Articles_relationship",
"description": "Gets the corresponding articles of the author.",
"target": {
"model": {
"name": "Articles",
"relationshipType": "Array"
}
},
"mapping": [
{
"source": {
"fieldPath": [
{
"fieldName": "author_id"
}
]
},
"target": {
"modelField": [
{
"fieldName": "author_id"
}
]
}
}
]
}
}
]
}
]
}