GraphQL\Utils\TypeInfo::getFieldDefinition PHP Method

getFieldDefinition() private static method

Not exactly the same as the executor's definition of getFieldDef, in this statically evaluated environment we do not always have an Object type, and need to handle Interface and Union types.
private static getFieldDefinition ( Schema $schema, Type $parentType, FieldNode $fieldNode ) : FieldDefinition
$schema GraphQL\Schema
$parentType GraphQL\Type\Definition\Type
$fieldNode GraphQL\Language\AST\FieldNode
return GraphQL\Type\Definition\FieldDefinition
    private static function getFieldDefinition(Schema $schema, Type $parentType, FieldNode $fieldNode)
    {
        $name = $fieldNode->name->value;
        $schemaMeta = Introspection::schemaMetaFieldDef();
        if ($name === $schemaMeta->name && $schema->getQueryType() === $parentType) {
            return $schemaMeta;
        }
        $typeMeta = Introspection::typeMetaFieldDef();
        if ($name === $typeMeta->name && $schema->getQueryType() === $parentType) {
            return $typeMeta;
        }
        $typeNameMeta = Introspection::typeNameMetaFieldDef();
        if ($name === $typeNameMeta->name && $parentType instanceof CompositeType) {
            return $typeNameMeta;
        }
        if ($parentType instanceof ObjectType || $parentType instanceof InterfaceType) {
            $fields = $parentType->getFields();
            return isset($fields[$name]) ? $fields[$name] : null;
        }
        return null;
    }