Skip to content

Commit d6b6e97

Browse files
committed
Add an operation name argument to clientgen
1 parent dd9dad5 commit d6b6e97

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/ClientGenerator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct GeneratorPaths
2121
struct GeneratorOptions
2222
{
2323
const std::string requestFilename;
24+
const std::string operationName;
2425
const std::optional<GeneratorPaths> paths;
2526
const bool verbose = false;
2627
const bool noIntrospection = false;

src/ClientGenerator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ int main(int argc, char** argv)
16591659
bool noIntrospection = false;
16601660
std::string schemaFileName;
16611661
std::string requestFileName;
1662+
std::string operationName;
16621663
std::string filenamePrefix;
16631664
std::string schemaNamespace;
16641665
std::string sourceDir;
@@ -1673,7 +1674,9 @@ int main(int argc, char** argv)
16731674
po::value(&schemaFileName),
16741675
"Schema definition file path")("request,r",
16751676
po::value(&requestFileName),
1676-
"Request document file path")("prefix,p",
1677+
"Request document file path")("operation,o",
1678+
po::value(&operationName),
1679+
"Operation name if the request document contains more than one")("prefix,p",
16771680
po::value(&filenamePrefix),
16781681
"Prefix to use for the generated C++ filenames")("namespace,n",
16791682
po::value(&schemaNamespace),
@@ -1742,6 +1745,7 @@ int main(int argc, char** argv)
17421745
std::move(schemaNamespace) },
17431746
graphql::generator::client::GeneratorOptions {
17441747
std::move(requestFileName),
1748+
std::move(operationName),
17451749
graphql::generator::client::GeneratorPaths { std::move(headerDir),
17461750
std::move(sourceDir) },
17471751
verbose,

0 commit comments

Comments
 (0)