EagerLoadDirective   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 17
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 EagerLoadDirective extends BaseDirective
8
{
9 8
    public static function definition(): string
10
    {
11
        return /** @lang GraphQL */ <<<'SDL'
12 8
"""
13
Eager load relationships using Laravel Model::$with();
14
"""
15
directive @eagerLoad (
16
    """
17
    If present, use this name as the with($name) parameter. Otherwise try to guess from field.
18
    """
19
    name: String
20
21
    """
22
    If present, append these values to the with($name) model class.
23
    """
24
    tables: [String!] 
25
) on FIELD_DEFINITION | OBJECT
26
SDL;
27
    }
28
}
29