Skip to content

Commit 354e6f5

Browse files
committed
feat: some flexible mutation
1 parent 8885c35 commit 354e6f5

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/Endpoint/Concerns/IncludesData.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ public function defaultInclude(array $include): static
1717
return $this;
1818
}
1919

20+
public function addDefaultInclude(array $include): static
21+
{
22+
$this->defaultInclude = array_merge($this->defaultInclude ?? [], $include);
23+
24+
return $this;
25+
}
26+
27+
public function removeDefaultInclude(array $include): static
28+
{
29+
$this->defaultInclude = array_diff($this->defaultInclude ?? [], $include);
30+
31+
return $this;
32+
}
33+
2034
private function getInclude(Context $context): array
2135
{
2236
if (

src/Schema/Field/Relationship.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public function type(string|array $type): static
3737
/**
3838
* Allow this relationship to be included.
3939
*/
40-
public function includable(): static
40+
public function includable(bool $includable = true): static
4141
{
42-
$this->includable = true;
42+
$this->includable = $includable;
4343

4444
return $this;
4545
}

0 commit comments

Comments
 (0)