Skip to content

Commit ce99e64

Browse files
committed
Fix #48 - Skip generating NYI stubs in IntrospectionSchema.*
1 parent 0b458f7 commit ce99e64

File tree

3 files changed

+53
-331
lines changed

3 files changed

+53
-331
lines changed

SchemaGenerator.cpp

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,11 @@ class )cpp" << objectType.type << R"cpp(
14341434
{
14351435
const bool inheritedField = interfaceFields.find(outputField.name) != interfaceFields.cend();
14361436

1437+
if (inheritedField && _isIntrospection)
1438+
{
1439+
continue;
1440+
}
1441+
14371442
if (firstField)
14381443
{
14391444
headerFile << R"cpp(
@@ -1554,7 +1559,7 @@ std::string Generator::getFieldDeclaration(const OutputField & outputField, bool
15541559
}
15551560

15561561
output << R"cpp() const)cpp";
1557-
if (interfaceField)
1562+
if (interfaceField || _isIntrospection)
15581563
{
15591564
output << R"cpp( = 0)cpp";
15601565
}
@@ -1895,29 +1900,34 @@ namespace object {
18951900
std::string fieldName(outputField.name);
18961901

18971902
fieldName[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(fieldName[0])));
1898-
sourceFile << R"cpp(
1903+
if (!_isIntrospection)
1904+
{
1905+
sourceFile << R"cpp(
18991906
std::future<)cpp" << getOutputCppType(outputField, false)
19001907
<< R"cpp(> )cpp" << objectType.type
19011908
<< R"cpp(::get)cpp" << fieldName
19021909
<< R"cpp((service::FieldParams&&)cpp";
1903-
for (const auto& argument : outputField.arguments)
1904-
{
1905-
sourceFile << R"cpp(, )cpp" << getInputCppType(argument)
1906-
<< R"cpp(&&)cpp";
1907-
}
1910+
for (const auto& argument : outputField.arguments)
1911+
{
1912+
sourceFile << R"cpp(, )cpp" << getInputCppType(argument)
1913+
<< R"cpp(&&)cpp";
1914+
}
19081915

1909-
sourceFile << R"cpp() const
1916+
sourceFile << R"cpp() const
19101917
{
19111918
std::promise<)cpp" << getOutputCppType(outputField, false)
1912-
<< R"cpp(> promise;
1919+
<< R"cpp(> promise;
19131920
19141921
promise.set_exception(std::make_exception_ptr(std::runtime_error(R"ex()cpp" << objectType.type
1915-
<< R"cpp(::get)cpp" << fieldName
1916-
<< R"cpp( is not implemented)ex")));
1922+
<< R"cpp(::get)cpp" << fieldName
1923+
<< R"cpp( is not implemented)ex")));
19171924
19181925
return promise.get_future();
19191926
}
1927+
)cpp";
1928+
}
19201929

1930+
sourceFile << R"cpp(
19211931
std::future<response::Value> )cpp" << objectType.type
19221932
<< R"cpp(::resolve)cpp" << fieldName
19231933
<< R"cpp((service::ResolverParams&& params)

0 commit comments

Comments
 (0)