RenderableDirective::definition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 38

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 38
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 9.312
c 1
b 0
f 0
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