1. Supported Documat Formats
|
Note
|
This chapter has not been written yet. |
1.1. YAML
|
Note
|
This chapter has not been written yet. |
1.2. XML
|
Note
|
This chapter has not been written yet. |
1.3. Asciidoctor
|
Note
|
This chapter has not been written yet. |
2. GraphQL Plugin
The GraphQL plugin provides scanners for GraphQL schemas provided via
-
SDL files (having the extension
.graphqlor.graphqls) -
Introspection queries to HTTP endpoints by scanning an URL, e.g.
jqassistant scan -u graphql:schema::https://bahnql.herokuapp.com/graphql
|
💡
|
For an introduction into GraphQL, its schema and elements refer to http://graphql.org. |
2.1. Features
-
Scanning of
-
SDL files
-
HTTP endpoints by executing an introspection query using scope
graphql:schema
-
-
Supported schema elements
-
Object types including fields and implemented interfaces
-
Input object types including fields
-
Enum types including defined values
-
Scalar types
-
Interface types including fields
-
Union types including the types
-
Directive types
-
-
All supported elements provide additional information
-
The source location (i.e. line and column numbers)
-
Specifed directives and their values
-
2.2. Feature Requests and Bugs
In case of a missing feature or any kind of unexpected or faulty behaviour, please file an issue via Github.
2.3. The Model
| Entity | Used Combination of Labels |
|---|---|
Schema |
|
Schema File |
|
Schema URL |
|
Type |
|
Value |
|
Scalar Type |
|
Scalar Value |
|
Enum Type |
|
Enum Value |
|
Interface Type |
|
Object Type |
|
Field |
|
Input Object Type |
|
Input Field |
|
Input Value Definition |
|
Union Type |
|
List Type |
|
Directive Type |
|
Directive Value |
|
Directive Location |
|
Argument |
|
2.4. Schema
Represents a GraphQL schema.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..n |
References all GraphQL types which are declared in the schema |
|
|
0..n |
References all GraphQL types which are required by the schema (i.e. referenced but not declared) |
2.5. Schema File
A file with the the extension .graphql or .graphqls containing a GraphQL Schema.
Used labels |
|
|---|
2.6. Schema Url
A URL (i.e. endpoint) providing a GraphQL Schema.
Used labels |
|
|---|
| Property Name | Existence | Description |
|---|---|---|
|
always |
The URL. |
2.7. Type
Represents a GraphQL type.
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
0..n |
References to the declared directive values |
| Property Name | Existence | Description |
|---|---|---|
|
always |
The name. |
|
not always |
The optional description as provided in the GraphQL schema. |
|
not always |
The optional line number of the source location within the GraphQL schema. |
|
not always |
The optional column of the source location within the GraphQL schema. |
2.8. Value
Represents a value (e.g. a scalar or enum).
Used labels |
|
|---|
2.9. Scalar Type
Represents a GraphQL Scalar Type.
Used labels |
|
|---|
2.10. Scalar Value
Represents a GraphQL Scalar value.
Used labels |
|
|---|
| Property Name | Existence | Description |
|---|---|---|
|
always |
The scalar value. |
2.11. Enum Type
Represents a GraphQL Enum Type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1..n |
References an enum value declared by the type. |
2.12. Enum Value
Represents a GraphQL Enum value.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..n |
References to the declared directive values |
| Property Name | Existence | Description |
|---|---|---|
|
always |
The name. |
|
not always |
The optional description as provided in the GraphQL schema. |
2.13. Interface Type
Represents a GraphQL Interface Type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..n |
References the declared GraphQL fields |
2.14. Object Type
Represents a GraphQL Object Type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..n |
References the implemented interface types. |
|
|
0..n |
References the declared GraphQL fields |
2.15. Field
Represents a field of an object or interface type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1 |
References the field type |
|
|
0..n |
References the declared GraphQL input value definitions |
| Property Name | Existence | Description |
|---|---|---|
|
always |
The name. |
|
not always |
The optional description as provided in the GraphQL schema. |
2.16. Of Type Relation
References a GraphQL type indicating if this reference is nullable.
| Relation Name | Target Node Type |
|---|---|
|
| Property Name | Existence | Description |
|---|---|---|
|
always |
If |
2.17. Input Object Type
Represents a GraphQL Input Object Type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1..n |
References the declared input fields. |
2.18. Input Field
Represents a GraphQL Input Field, having similar properties and relations.
Used labels |
|
|---|
2.19. Input Value Definition
Defines an input value.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1 |
The relation to the type. |
|
|
0..1 |
References the default value. |
|
|
0..n |
References to the declared directive values |
| Property Name | Existence | Description |
|---|---|---|
|
always |
The index number (starting with 0). |
|
always |
The name. |
|
not always |
The optional description as provided in the GraphQL schema. |
|
not always |
The optional line number of the source location within the GraphQL schema. |
|
not always |
The optional column of the source location within the GraphQL schema. |
2.20. Union Type
Represents a GraphQL Union Type.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1..n |
References the declared GraphQL fields |
2.21. Union Declares Type
References a GraphQL type indicating the index of the relation.
| Relation Name | Target Node Type |
|---|---|
|
| Property Name | Existence | Description |
|---|---|---|
|
always |
The index number (starting with 0). |
2.22. List Type
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
1 |
References the field type |
2.23. Of Element Type Relation
References a GraphQL type indicating if this reference is nullable.
| Relation Name | Target Node Type |
|---|---|
|
| Property Name | Existence | Description |
|---|---|---|
|
always |
If |
2.24. Directive Type
Represents a directive Type that is defined within a GraphQL schema.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1..n |
References the allowed locations the directive can be applied to. |
|
|
0..n |
References the declared GraphQL input value definitions |
2.25. Directive Value
Represents a directive that is present at an element of the GraphQL schema.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1 |
References the type of the directive |
|
|
0..n |
References arguments of the directive |
2.26. Directive Location
Represents the allowed locations for a directive.
Used labels |
|
|---|
| Property Name | Existence | Description |
|---|---|---|
|
always |
The name. |
2.27. Argument
Represents an argument of a GraphQL directive.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
1 |
References the argument value. |
|
|
1 |
References the input value defined for this argument. |
| Property Name | Existence | Description |
|---|---|---|
|
always |
The index number (starting with 0). |
3. YAML II Plugin
The jQAssistant YAML 2 Plugin allows jQAssistant scan YAML documents and to build a graph model out of any valid YAML 1.2 document.
The YAML 2 Plugin is the successor of the jQAssistant YAML Plugin which suffers from a faulty graph model. As soon the YAML 2 Plugin is ready for production, it will replace the YAML Plugin.
|
💡
|
It is highly recommended to read the YAML 1.2 specification and to become more familiar with the possibilities of YAML. |
Features
-
Support of YAML 1.2 specification
-
Full support for maps, scalars,and sequences
-
Support of aliases and anchors
Feature Requests and Bugs
In case of a missing feature or any kind of unexpected or faulty behaviour, please file an issue via Github.
Compatibility with the jQAssistant YAML Plugin
The graph model build by the YAML 2 Plugin is different from the one of the YAML Plugin and not compatible. Therefore existing constraints and reports, which make use of the graph model generated by the previous plugin must be reworked.
3.1. The Model
| Entity | Used Combination of Labels |
|---|---|
YAML Document |
|
YAML File ( |
|
YAML Map |
|
Complex Key |
|
YAML Map |
|
|
|
|
|
|
|
|
|
|
3.2. A YAML File
A file with the the extension .yaml or .yml, which can contain
multiple YAML documents.
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..n |
References all YAML documents contained in this file |
| Property Name | Existence | Description |
|---|---|---|
|
always |
Indicates whether or not the item underlying the node was successfully scanned. |
In case the scanner of the YAML 2 plugin is not able to scan all documents
of the YAML file, the file will be marked as not valid by setting
the property valid of the node representing the YAML file to false.
This is done on the file level even if only one document of many is not valid.
This behavior is due to the used
SnakeYAML Engine library.
3.3. A YAML Document
A single YAML document as specified in the YAML 1.2 specification. A document can contain either a scalar, a sequence or a map.
--- and suffix …---
# Comments are not handled by jQAssistant
NX-01: Jonathan Archer
NCC-1701-A: James Tiberius Kirk
NCC-1701-D: Jean-Luc Picard
...
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
0..1 |
Reference to a sequence in the YAML document |
|
|
0..1 |
Reference to a map in the YAML document |
|
|
0..1 |
Reference to a scalar in the YAML document |
3.4. A Scalar
A scalar value as described in the YAML 1.2 specification.
Used labels |
|
|---|
| Property Name | Existence | Description |
|---|---|---|
|
not always |
Position of the element in document order in a sequence. |
|
always |
The scalar value itself |
3.5. A Sequence
A sequence as specified in the YAML 1.2 specification.
Each item of sequence has an additional label :Item.
- Humans: Earth
- Hirogen: Delta quadrant
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
1..n |
Reference to an item in the sequence. The item can be either a scalar, a sequence or a map. |
| Property Name | Existence | Description |
|---|---|---|
|
not always |
Position of the element in document order in a sequence. |
3.6. An Item in a Sequence
Each item of a sequence is also labled with :Item.
Used labels |
|
|---|
| Label | Existence | Description |
|---|---|---|
|
not always |
The last item in a sequence in document order carries also the
label |
|
not always |
The first item in a sequence in document order
carries also the label |
3.7. A Map
A map as specified in the YAML 1.2 specification
with a set of key-value pairs. The key of a key-value pair can be
either a simple key or a complex key.
The value of the key-value pair can be an arbitrary YAML structure.
Each value of a map has an additional Value label.
weight: 91
length: 103
height: 44
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
1..n |
Reference to key or a compley key in the map |
| Property Name | Existence | Description |
|---|---|---|
|
not always |
Position of the element in document order in a sequence. |
3.8. Simple Key
A simple key of a key-value pair in a map represented by a scalar value. Beside the simple key there is also the complex key, which can also be used as key for maps. Usage examples can be found in chapter 2.2 of the YAML specification.
simpleKey: "Value for a simple key"
? - combined
- key
: "Value for a complex key"
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..1 |
Reference to the value of this key-value pair |
| Property Name | Existence | Description |
|---|---|---|
|
not always |
Position of the element in document order in a sequence. |
|
always |
The name of a key as scalar value |
3.9. Complex Key
A complex key of a key-value pair in a map. A complex key
starts with an ? and can be any valid YAML structure.
Besides the complex key there is also the
simple key, which is represented by
a single scalar value.
simpleKey: "Value for a simple key"
? - Vulcan
- ShiKahr District
: Spock
? - Earth
- North America
: James T. Kirk
Used labels |
|
|---|
| Relation Name | Target Node | Cardinality | Description |
|---|---|---|---|
|
0..1 |
Reference to the value of this key-value pair |
3.10. A value in a map
A value of a key-value pair in a map can be any valid YAML structure.
The YAML 2 Plugin assigns each structure its standard labels, e.g.
:Yaml:Map for a map used as value or :Yaml:Scalar to a simple
scalar value like Romulan Star Empire. Any YAML structure
used as value of a key-value pair is also labled with :Value.
Used labels |
|
|---|
3.11. An Anchor
An anchor as specified in the YAML 1.2 specification, used to mark content in a YAML document for future reuse in the same document.
"James T. Kirk" : &ufp "United Federation of Planets"
"Hikaru Kato Sulu" : *ufp
"James T. Kirk" : "United Federation of Planets"
"Hikaru Kato Sulu" : "United Federation of Planets"
Used labels |
|
|---|
| Property Name | Existence | Description |
|---|---|---|
|
always |
The name of the anchor |
|
not always |
Position of the element in document order in a sequence. |
3.12. An Alias
An alias as specified in the YAML 1.2 specification, used to reuse previously marked content in a document.
"James T. Kirk" : &ufp "United Federation of Planets"
"Hikaru Kato Sulu" : *ufp
Used labels |
|
|---|
| Relation Name | Target Node Type | Cardinality | Description |
|---|---|---|---|
|
1 |
Reference to the anchor of this alias in the YAML document |
| Property Name | Existence | Description |
|---|---|---|
|
not always |
Position of the element in document order in a sequence. |