PHP Class GraphQL\Examples\Blog\Types

Acts as a registry and factory for your types. As simplistic as possible for the sake of clarity of this example. Your own may be more dynamic (or even code-generated).
Show file Open project: webonyx/graphql-php Class Usage Examples

Public Methods

Method Description
boolean ( ) Let's add internal types as well for consistent experience
comment ( ) : CommentType
contentFormatEnum ( ) : ContentFormatEnum
email ( )
float ( ) : FloatType
htmlField ( $name, null $objectKey = null ) : array
id ( ) : IDType
image ( ) : ImageType
imageSizeEnum ( ) : ImageSizeEnumType
int ( ) : IntType
listOf ( Type $type ) : ListOfType
mention ( ) : SearchResultType
node ( ) : NodeType
nonNull ( Type $type ) : NonNull
query ( ) : QueryType
story ( ) : StoryType
string ( ) : StringType
url ( ) : UrlType
user ( ) : UserType

Method Details

boolean() public static method

Let's add internal types as well for consistent experience
public static boolean ( )

comment() public static method

public static comment ( ) : CommentType
return GraphQL\Examples\Blog\Type\CommentType

contentFormatEnum() public static method

public static contentFormatEnum ( ) : ContentFormatEnum
return GraphQL\Examples\Blog\Type\Enum\ContentFormatEnum

email() public static method

public static email ( )

float() public static method

public static float ( ) : FloatType
return GraphQL\Type\Definition\FloatType

htmlField() public static method

public static htmlField ( $name, null $objectKey = null ) : array
$name
$objectKey null
return array

id() public static method

public static id ( ) : IDType
return GraphQL\Type\Definition\IDType

image() public static method

public static image ( ) : ImageType
return GraphQL\Examples\Blog\Type\ImageType

imageSizeEnum() public static method

public static imageSizeEnum ( ) : ImageSizeEnumType
return GraphQL\Examples\Blog\Type\Enum\ImageSizeEnumType

int() public static method

public static int ( ) : IntType
return GraphQL\Type\Definition\IntType

listOf() public static method

public static listOf ( Type $type ) : ListOfType
$type GraphQL\Type\Definition\Type
return GraphQL\Type\Definition\ListOfType

mention() public static method

public static mention ( ) : SearchResultType
return GraphQL\Examples\Blog\Type\SearchResultType

node() public static method

public static node ( ) : NodeType
return GraphQL\Examples\Blog\Type\NodeType

nonNull() public static method

public static nonNull ( Type $type ) : NonNull
$type GraphQL\Type\Definition\Type
return GraphQL\Type\Definition\NonNull

query() public static method

public static query ( ) : QueryType
return GraphQL\Examples\Blog\Type\QueryType

story() public static method

public static story ( ) : StoryType
return GraphQL\Examples\Blog\Type\StoryType

string() public static method

public static string ( ) : StringType
return GraphQL\Type\Definition\StringType

url() public static method

public static url ( ) : UrlType
return GraphQL\Examples\Blog\Type\Scalar\UrlType

user() public static method

public static user ( ) : UserType
return GraphQL\Examples\Blog\Type\UserType