<commit_before><?php
/**
 * Date: 03.12.15
 *
 * @author <NAME> <<EMAIL>>
 */

namespace Youshido\GraphQL\Introspection;

use Youshido\GraphQL\Schema;
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
use Youshido\GraphQL\Type\Field\Field;
use Youshido\GraphQL\Type\Object\AbstractObjectType;

class MutationType extends QueryType
{

    public function resolve($value = null, $args = [])
    {
        /** @var Schema|Field $value */
        if ($value instanceof Schema) {
            return $value->getMutationType();
        }

        return $value->getConfig()->getType();
    }

}<commit_msg>Fix bug when no mutation was declared for schema<commit_after><?php
/**
 * Date: 03.12.15
 *
 * @author <NAME> <<EMAIL>>
 */

namespace Youshido\GraphQL\Introspection;

use Youshido\GraphQL\Schema;
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
use Youshido\GraphQL\Type\Field\Field;
use Youshido\GraphQL\Type\Object\AbstractObjectType;
use Youshido\GraphQL\Type\Object\ObjectType;

class MutationType extends QueryType
{

    public function resolve($value = null, $args = [])
    {
        /** @var Schema|Field $value */
        if ($value instanceof Schema) {
            $mutationType = $value->getMutationType();

            return $mutationType instanceof ObjectType ? null : $mutationType;
        }


        return $value->getConfig()->getType();
    }

}
{'fraction_non_alphanumeric': 0.13372093023255813, 'fraction_numerical': 0.00872093023255814, 'mean_word_length': 3.2763975155279503, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4872825', 'n_tokens_mistral': 453, 'n_tokens_neox': 440, 'n_words': 88}