-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathNamingStrategyInterface.php
More file actions
54 lines (44 loc) · 1.89 KB
/
Copy pathNamingStrategyInterface.php
File metadata and controls
54 lines (44 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
namespace TheCodingMachine\GraphQLite;
use TheCodingMachine\GraphQLite\Annotations\Factory;
use TheCodingMachine\GraphQLite\Annotations\Input;
use TheCodingMachine\GraphQLite\Annotations\TypeInterface;
/** @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html */
interface NamingStrategyInterface
{
/**
* Returns the name of the GraphQL interface from a name of GraphQL concrete type (when the interface is created
* automatically to manage inheritance)
*/
public function getInterfaceNameFromConcreteName(string $concreteType): string;
/**
* Returns the name of the GraphQL object from a name of GraphQL interface type (when the object is created
* automatically from a "Type" annotated interface)
*/
public function getConcreteNameFromInterfaceName(string $name): string;
/**
* Returns the GraphQL output object type name based on the type className and the Type annotation.
*/
public function getOutputTypeName(string $typeClassName, TypeInterface $type): string;
/**
* Returns the GraphQL input object type name based on the type className and the Input annotation.
*
* @param class-string<object> $className
*/
public function getInputTypeName(string $className, Input|Factory $input): string;
/**
* Returns the name of a GraphQL field from the name of the annotated method.
*/
public function getFieldNameFromMethodName(string $methodName): string;
/**
* Returns the name of a GraphQL input field from the name of the annotated method.
*/
public function getInputFieldNameFromMethodName(string $methodName): string;
/**
* Returns the name of a GraphQL union type based on the included types.
*
* @param string[] $typeNames The list of GraphQL type names
*/
public function getUnionTypeName(array $typeNames): string;
}