GraphQL\Tests\Executor\ExecutorTest::testUsesTheMutationSchemaForMutations PHP Method

testUsesTheMutationSchemaForMutations() public method

    public function testUsesTheMutationSchemaForMutations()
    {
        $doc = 'query Q { a } mutation M { c }';
        $data = ['a' => 'b', 'c' => 'd'];
        $ast = Parser::parse($doc);
        $schema = new Schema(['query' => new ObjectType(['name' => 'Q', 'fields' => ['a' => ['type' => Type::string()]]]), 'mutation' => new ObjectType(['name' => 'M', 'fields' => ['c' => ['type' => Type::string()]]])]);
        $mutationResult = Executor::execute($schema, $ast, $data, null, [], 'M');
        $this->assertEquals(['data' => ['c' => 'd']], $mutationResult->toArray());
    }