public function theOperationNamedInFile($queryName, $file)
    {
        // TODO: add support for fragments
        // if a fragment is not used in some operation in the same file a error is thrown

        $this->theOperationInFile($file);
        $this->operationName = $queryName;
        if ($this->client->getGraphQL()) {
            // remove non necessary operations to avoid errors with unsettled variables
            $pattern = '/(query|mutation|subscription)\s+(?!'.$queryName.'\s*[\({])(.+\n)+}\n*/';
            $this->client->setGraphQL(preg_replace($pattern, null, $this->client->getGraphQL()));
        }

        if ($queryName) {
            if (strpos($this->client->getGraphQL(), $queryName) === false) {
                throw new \RuntimeException(sprintf('Does not exist any operation called "%s" in "%s"', $queryName, $file));
            }
        }
    }