Skip to content

Commit 44fd291

Browse files
committed
Generate Introspection types for built-in types
1 parent 7098982 commit 44fd291

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

SchemaGenerator.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,19 @@ Operations::Operations()cpp";
20742074
{
20752075
)cpp";
20762076

2077+
if (_isIntrospection)
2078+
{
2079+
// Add SCALAR types for each of the built-in types
2080+
for (const auto& builtinType : s_builtinTypes)
2081+
{
2082+
sourceFile << R"cpp( schema->AddType(")cpp" << builtinType.first
2083+
<< R"cpp(", std::make_shared<)cpp" << s_introspectionNamespace
2084+
<< R"cpp(::ScalarType>(")cpp" << builtinType.first
2085+
<< R"cpp(", R"md(Built-in type)md"));
2086+
)cpp";
2087+
}
2088+
}
2089+
20772090
if (!_scalarTypes.empty())
20782091
{
20792092
for (const auto& scalarType : _scalarTypes)

0 commit comments

Comments
 (0)