1 | <?php |
||
19 | class DocsType extends AbstractType |
||
20 | { |
||
21 | use SelectById; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $attributes = [ |
||
27 | 'name' => 'Docs', |
||
28 | 'description' => 'Documentation repository', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * @return array |
||
33 | */ |
||
34 | public function typeFields(): array |
||
35 | { |
||
36 | return [ |
||
37 | 'id' => [ |
||
38 | 'type' => Type::nonNull(Type::id()), |
||
39 | 'description' => 'Docs identifier', |
||
40 | ], |
||
41 | 'project' => [ |
||
42 | 'type' => Type::nonNull(Type::string()), |
||
43 | 'description' => 'Docs project name', |
||
44 | ], |
||
45 | 'pages' => [ |
||
46 | 'args' => $this->extendArguments([ |
||
47 | 'slug' => [ |
||
48 | 'type' => Type::string(), |
||
49 | 'description' => 'Docs page slug', |
||
50 | ], |
||
51 | ]), |
||
52 | 'type' => Type::listOf(\GraphQL::type('DocsPage')), |
||
53 | 'description' => '', |
||
54 | ], |
||
55 | 'title' => [ |
||
56 | 'type' => Type::nonNull(Type::string()), |
||
57 | 'description' => '', |
||
58 | ], |
||
59 | 'image' => [ |
||
60 | 'type' => Type::nonNull(Type::string()), |
||
61 | 'description' => '', |
||
62 | ], |
||
63 | 'version' => [ |
||
64 | 'type' => Type::nonNull(Type::string()), |
||
65 | 'description' => '', |
||
66 | ], |
||
67 | 'description' => [ |
||
68 | 'type' => Type::nonNull(Type::string()), |
||
69 | 'description' => '', |
||
70 | ], |
||
71 | 'created_at' => [ |
||
72 | 'type' => Type::nonNull(Type::string()), |
||
73 | 'description' => '', |
||
74 | ], |
||
75 | 'updated_at' => [ |
||
76 | 'type' => Type::nonNull(Type::string()), |
||
77 | 'description' => '', |
||
78 | ], |
||
79 | ]; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @param $root |
||
84 | * @param array $args |
||
85 | * @return \Illuminate\Support\Collection |
||
86 | */ |
||
87 | public function resolvePagesField(array $root, array $args) |
||
99 | } |
||
100 |