Skip to content

Commit

Permalink
Merge pull request #12 from worksome/feat-gql-convertable
Browse files Browse the repository at this point in the history
feat: Add GraphQLConvertable
  • Loading branch information
alberthaff committed Apr 5, 2024
2 parents dfcd880 + 510ea81 commit fb34590
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Definition/Concerns/GraphQLConvertable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Worksome\GraphQLHelpers\Definition\Concerns;

use Jawira\CaseConverter\Convert;
use UnitEnum;

/**
* @mixin UnitEnum
*/
trait GraphQLConvertable
{
public function toGraphQLValue(): string
{
return (new Convert($this->name))->toMacro();
}
}

0 comments on commit fb34590

Please sign in to comment.