File tree Expand file tree Collapse file tree 5 files changed +15
-8
lines changed
Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 77
88#include < algorithm>
99#include < array>
10- #include < stdexcept>
1110#include < sstream>
11+ #include < stdexcept>
1212#include < string_view>
1313
1414using namespace std ::literals;
Original file line number Diff line number Diff line change 77
88#include < algorithm>
99#include < array>
10- #include < stdexcept>
1110#include < sstream>
11+ #include < stdexcept>
1212#include < string_view>
1313
1414using namespace std ::literals;
Original file line number Diff line number Diff line change 77
88#include < algorithm>
99#include < array>
10- #include < stdexcept>
1110#include < sstream>
11+ #include < stdexcept>
1212#include < string_view>
1313
1414using namespace std ::literals;
Original file line number Diff line number Diff line change 77
88#include < algorithm>
99#include < array>
10- #include < stdexcept>
1110#include < sstream>
11+ #include < stdexcept>
1212#include < string_view>
1313
1414using namespace std ::literals;
Original file line number Diff line number Diff 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
458459using 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" ;
You can’t perform that action at this time.
0 commit comments