Skip to content

Commit 83b41bb

Browse files
committed
Fix #199
1 parent 9313634 commit 83b41bb

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

samples/client/benchmark/BenchmarkClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <algorithm>
99
#include <array>
10-
#include <stdexcept>
1110
#include <sstream>
11+
#include <stdexcept>
1212
#include <string_view>
1313

1414
using namespace std::literals;

samples/client/mutate/MutateClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <algorithm>
99
#include <array>
10-
#include <stdexcept>
1110
#include <sstream>
11+
#include <stdexcept>
1212
#include <string_view>
1313

1414
using namespace std::literals;

samples/client/query/QueryClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <algorithm>
99
#include <array>
10-
#include <stdexcept>
1110
#include <sstream>
11+
#include <stdexcept>
1212
#include <string_view>
1313

1414
using namespace std::literals;

samples/client/subscribe/SubscribeClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <algorithm>
99
#include <array>
10-
#include <stdexcept>
1110
#include <sstream>
11+
#include <stdexcept>
1212
#include <string_view>
1313

1414
using namespace std::literals;

src/ClientGenerator.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ static_assert(graphql::internal::MinorVersion == )cpp"
223223
{
224224
pendingSeparator.reset();
225225

226-
headerFile << R"cpp(enum class )cpp" << _schemaLoader.getCppType(enumType->name()) << R"cpp(
226+
headerFile << R"cpp(enum class )cpp" << _schemaLoader.getCppType(enumType->name())
227+
<< R"cpp(
227228
{
228229
)cpp";
229230
for (const auto& enumValue : enumType->enumValues())
@@ -451,8 +452,8 @@ bool Generator::outputSource() const noexcept
451452
452453
#include <algorithm>
453454
#include <array>
454-
#include <stdexcept>
455455
#include <sstream>
456+
#include <stdexcept>
456457
#include <string_view>
457458
458459
using namespace std::literals;
@@ -625,8 +626,14 @@ response::Value serializeVariables(Variables&& variables)
625626
for (const auto& variable : variables)
626627
{
627628
sourceFile << R"cpp( result.emplace_back(R"js()cpp" << variable.name
628-
<< R"cpp()js"s, ModifiedVariable<Variables::)cpp"
629-
<< _schemaLoader.getCppType(variable.type->name()) << R"cpp(>::serialize)cpp"
629+
<< R"cpp()js"s, ModifiedVariable<)cpp";
630+
631+
if (_schemaLoader.getSchemaType(variable.type->name()) != SchemaType::Scalar)
632+
{
633+
sourceFile << R"cpp(Variables::)cpp";
634+
}
635+
636+
sourceFile << _schemaLoader.getCppType(variable.type->name()) << R"cpp(>::serialize)cpp"
630637
<< getTypeModifierList(variable.modifiers)
631638
<< R"cpp((std::move(variables.)cpp" << variable.cppName << R"cpp()));
632639
)cpp";

0 commit comments

Comments
 (0)