private static function resolveGraphqlTypeFromReflectionType(\ReflectionType $type, array $filterGraphqlTypes = null, bool $isOptionnal = false)
    {
        $stype = (string) $type;
        if ($type->isBuiltin()) {
            $gqlType = self::resolveTypeFromPhpType($stype);
            if (!$gqlType) {
                throw new \Exception(\sprintf('No corresponding GraphQL type found for builtin type "%s"', $stype));
            }
        } else {
            $gqlType = self::resolveTypeFromClass($stype, $filterGraphqlTypes);
            if (!$gqlType) {
                throw new \Exception(\sprintf('No corresponding GraphQL %s found for class "%s"', $filterGraphqlTypes ? \implode(',', $filterGraphqlTypes) : 'object', $stype));
            }
        }

        return \sprintf('%s%s', $gqlType, ($type->allowsNull() || $isOptionnal) ? '' : '!');
    }
private static function resolveGraphqlTypeFromReflectionType(\ReflectionType $type, array $filterGraphqlTypes = null, bool $isOptionnal = false)
    {
        $stype = (string) $type;
        if ($type->isBuiltin()) {
            $gqlType = self::resolveTypeFromPhpType($stype);
            if (!$gqlType) {
                throw new \Exception(\sprintf('No corresponding GraphQL type found for builtin type "%s"', $stype));
            }
        } else {
            $gqlType = self::resolveTypeFromClass($stype, $filterGraphqlTypes);
            if (!$gqlType) {
                throw new \Exception(\sprintf('No corresponding GraphQL %s found for class "%s"', $filterGraphqlTypes ? \implode(',', $filterGraphqlTypes) : 'object', $stype));
            }
        }

        return \sprintf('%s%s', $gqlType, ($type->allowsNull() || $isOptionnal) ? '' : '!');
    }
private static function resolveGraphqlTypeFromReflectionType ( \ ReflectionType $ type , array $ filterGraphqlTypes = null , bool $ isOptionnal = false ) { $ stype = ( string ) $ type ; if ( $ type -> isBuiltin ( ) ) { $ gqlType = self :: resolveTypeFromPhpType ( $ stype ) ; if ( ! $ gqlType ) { throw new \ Exception ( \ sprintf ( 'No corresponding GraphQL type found for builtin type "%s"' , $ stype ) ) ; } } else { $ gqlType = self :: resolveTypeFromClass ( $ stype , $ filterGraphqlTypes ) ; if ( ! $ gqlType ) { throw new \ Exception ( \ sprintf ( 'No corresponding GraphQL %s found for class "%s"' , $ filterGraphqlTypes ? \ implode ( ',' , $ filterGraphqlTypes ) : 'object' , $ stype ) ) ; } } return \ sprintf ( '%s%s' , $ gqlType , ( $ type -> allowsNull ( ) || $ isOptionnal ) ? '' : '!' ) ; }
Try to guess a GraphQL type from a Reflected Type.

@param \ReflectionType $type

@return string
Try to guess a GraphQL type from a Reflected Type .