PHP 클래스 GraphQL\Type\Definition\ObjectType

Almost all of the GraphQL types you define will be object types. Object types have a name, but most importantly describe their fields. Example: var AddressType = new GraphQLObjectType({ name: 'Address', fields: { street: { type: GraphQLString }, number: { type: GraphQLInt }, formatted: { type: GraphQLString, resolve(obj) { return obj.number + ' ' + obj.street } } } }); When two types need to refer to each other, or a type needs to refer to itself in a field, you can use a function expression (aka a closure or a thunk) to supply the fields lazily. Example: var PersonType = new GraphQLObjectType({ name: 'Person', fields: () => ({ name: { type: GraphQLString }, bestFriend: { type: PersonType }, }) });
상속: extends Type, implements OutputType, implements CompositeType
파일 보기 프로젝트 열기: webonyx/graphql-php 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$config array Keeping reference of config for late bindings and custom app-level metadata
$resolveFieldFn callable

공개 메소드들

메소드 설명
__construct ( array $config ) ObjectType constructor.
getField ( string $name ) : FieldDefinition
getFields ( ) : FieldDefinition[]
getInterfaces ( ) : InterfaceType[]
implementsInterface ( InterfaceType $iface ) : boolean
isTypeOf ( $value, $context, ResolveInfo $info ) : boolean | null

메소드 상세

__construct() 공개 메소드

ObjectType constructor.
public __construct ( array $config )
$config array

getField() 공개 메소드

public getField ( string $name ) : FieldDefinition
$name string
리턴 FieldDefinition

getFields() 공개 메소드

public getFields ( ) : FieldDefinition[]
리턴 FieldDefinition[]

getInterfaces() 공개 메소드

public getInterfaces ( ) : InterfaceType[]
리턴 InterfaceType[]

implementsInterface() 공개 메소드

public implementsInterface ( InterfaceType $iface ) : boolean
$iface InterfaceType
리턴 boolean

isTypeOf() 공개 메소드

public isTypeOf ( $value, $context, ResolveInfo $info ) : boolean | null
$value
$context
$info ResolveInfo
리턴 boolean | null

프로퍼티 상세

$config 공개적으로 프로퍼티

Keeping reference of config for late bindings and custom app-level metadata
public array $config
리턴 array

$resolveFieldFn 공개적으로 프로퍼티

public callable $resolveFieldFn
리턴 callable