Skip to content

Commit

Permalink
[4.x] Use ModelSchema typename for queries (#142)
Browse files Browse the repository at this point in the history
(cherry picked from commit 15ce948)
  • Loading branch information
erikgaal committed Feb 11, 2021
1 parent 1515b68 commit 8f97f81
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Mutations/AttachPivotMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function name(): string

$relation = Str::studly($this->pivotRelationName);

return 'attach'.$relation.'On'.$this->modelSchema->typename();
return 'attach'.$relation.'On'.$this->modelSchema->getTypename();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Mutations/CreateMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function name(): string
return $this->name;
}

return 'create'.$this->modelSchema->typename();
return 'create'.$this->modelSchema->getTypename();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Mutations/DeleteMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function name(): string
return $this->name;
}

return 'delete'.$this->modelSchema->typename();
return 'delete'.$this->modelSchema->getTypename();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Mutations/DetachPivotMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function name(): string

$relation = Str::studly($this->pivotRelationName);

return 'detach'.$relation.'On'.$this->modelSchema->typename();
return 'detach'.$relation.'On'.$this->modelSchema->getTypename();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Mutations/UpdateMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function name(): string
return $this->name;
}

return 'update'.$this->modelSchema->typename();
return 'update'.$this->modelSchema->getTypename();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Queries/EloquentCollectionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function name(): string
return $this->name;
}

return Utils::plural($this->modelSchema->getModel());
return Utils::plural($this->modelSchema->getTypename());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Queries/SingleEntityQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function name(): string
return $this->name;
}

return Utils::single($this->model);
return Utils::single($this->modelSchema->getTypename());
}

/**
Expand Down

0 comments on commit 8f97f81

Please sign in to comment.