COVESA / COVESA/s2dm

Handling of instances

Open
#63 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Python
Stars
17
Forks
10
Avg merge
1d 10h
Merged PRs (30d)
2

Description

## Current solution
Currently, valid instances are specified like this:

```graphql
type Seat {
instanceTag: InCabinArea2x2
}
```
And the `InCabinArea2x2 ` must be declared as:
```gql
type InCabinArea2x2 @instanceTag {
row: ...
column: ...
}
```
Ruleset:
- field name must be `instanceTag`
- output type of this field must be an object type declared as a valid instance with the `@instanceTag` directive.

## Alternative
### with `@instanceTag`
To have an arbitrary name for the tag field but use the directive with both the object and the field.
```graphql
type Seat {
anyFieldName: InCabinArea2x2 @instanceTag
}
```
And the `InCabinArea2x2 ` must be declared as:
```gql
type InCabinArea2x2 @instanceTag {
row: ...
column: ...
}
```
Ruleset:
- there can be only one field for the instance tag using the @instanceTag.
- the field for the instance tag can have an arbitrary name.
- output type of this field must be an object type declared as a valid instance with the `@instanceTag` directive.

### with two directives @instanceTagField and @instanceTagObject instead:
```graphql
type Seat {
anyFieldName: InCabinArea2x2 @instanceTagField
}
```
And the `InCabinArea2x2 ` must be declared as:
```gql
type InCabinArea2x2 @instanceTagObject {
row: ...
column: ...
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.