RenderableDirective   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 39
dl 0
loc 5
ccs 1
cts 1
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A definition() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Laravel\Lighthouse\Directives;
4
5
use Nuwave\Lighthouse\Schema\Directives\BaseDirective;
6
7
class RenderableDirective extends BaseDirective
8
{
9 8
    public static function definition(): string
10
    {
11
        return /** @lang GraphQL */ <<<'SDL'
12 8
"""
13
Generate renderable
14
"""
15
directive @renderable (
16
    """Label for this field"""
17
    label: String
18
19
    """Comment for this field"""
20
    comment: String
21
22
    """Should this field be used in show pages?"""
23
    show: Boolean
24
25
    """Is this field the title field for this object?"""
26
    title: Boolean
27
    
28
    """Should this field be used in the form? Default is true"""
29
    form: Boolean
30
    
31
    """Should this field be used in card components?"""
32
    card: Boolean
33
34
    """Should this field be used in table components?"""
35
    table: Boolean
36
37
    """Field size in render"""
38
    size: String
39
40
    # move to schemaRenderable()
41
    itemtype: String
42
43
    # move to typeRenderable()
44
    routeBase: String
45
    keyAttribute: String
46
    name: String
47
) on FIELD_DEFINITION | OBJECT
48
SDL;
49
    }
50
}
51