@@ -1671,28 +1671,6 @@ static_assert(graphql::internal::MinorVersion == )cpp"
16711671 headerFile << R"cpp(
16721672};
16731673
1674- )cpp" ;
1675- }
1676-
1677- if (_isIntrospection)
1678- {
1679- headerFile << R"cpp( #ifdef GRAPHQL_DLLEXPORTS
1680- // Export all of the built-in converters
1681- )cpp" ;
1682-
1683- for (const auto & enumType : _enumTypes)
1684- {
1685- headerFile << R"cpp( template <>
1686- GRAPHQLSERVICE_EXPORT )cpp" << enumType.cppType << R"cpp( service::ModifiedArgument<)cpp" << enumType.cppType << R"cpp( >::convert(
1687- const response::Value& value);
1688- template <>
1689- GRAPHQLSERVICE_EXPORT std::future<service::ResolverResult> service::ModifiedResult<)cpp" << enumType.cppType << R"cpp( >::convert(
1690- service::FieldResult<)cpp" << enumType.cppType << R"cpp( >&& result, service::ResolverParams&& params);
1691- )cpp" ;
1692- }
1693-
1694- headerFile << R"cpp( #endif // GRAPHQL_DLLEXPORTS
1695-
16961674)cpp" ;
16971675 }
16981676 }
@@ -1726,25 +1704,6 @@ GRAPHQLSERVICE_EXPORT std::future<service::ResolverResult> service::ModifiedResu
17261704 }
17271705 headerFile << R"cpp( };
17281706
1729- )cpp" ;
1730- }
1731-
1732- if (_isIntrospection)
1733- {
1734- headerFile << R"cpp( #ifdef GRAPHQL_DLLEXPORTS
1735- // Export all of the built-in converters
1736- )cpp" ;
1737-
1738- for (const auto & inputType : _inputTypes)
1739- {
1740- headerFile << R"cpp( template <>
1741- GRAPHQLSERVICE_EXPORT )cpp" << inputType.cppType << R"cpp( service::ModifiedArgument<)cpp" << inputType.cppType << R"cpp( >::convert(
1742- const response::Value& value);
1743- )cpp" ;
1744- }
1745-
1746- headerFile << R"cpp( #endif // GRAPHQL_DLLEXPORTS
1747-
17481707)cpp" ;
17491708 }
17501709 }
@@ -1877,16 +1836,63 @@ GRAPHQLSERVICE_EXPORT )cpp" << inputType.cppType << R"cpp( service::ModifiedArgu
18771836 if (_isIntrospection)
18781837 {
18791838 headerFile
1880- << R"cpp( GRAPHQLINTROSPECTION_EXPORT void AddTypesToSchema(const std::shared_ptr<schema::Schema>& schema);)cpp" ;
1839+ << R"cpp( GRAPHQLINTROSPECTION_EXPORT void AddTypesToSchema(const std::shared_ptr<schema::Schema>& schema);
1840+
1841+ )cpp" ;
1842+
1843+ if (!_enumTypes.empty () || !_inputTypes.empty ())
1844+ {
1845+ if (schemaNamespace.exit ())
1846+ {
1847+ headerFile << std::endl;
1848+ }
1849+
1850+ NamespaceScope serviceNamespace { headerFile, " service" };
1851+
1852+ headerFile << R"cpp(
1853+ #ifdef GRAPHQL_DLLEXPORTS
1854+ // Export all of the built-in converters
1855+ )cpp" ;
1856+
1857+ for (const auto & enumType : _enumTypes)
1858+ {
1859+ headerFile << R"cpp( template <>
1860+ GRAPHQLSERVICE_EXPORT )cpp" << _schemaNamespace
1861+ << R"cpp( ::)cpp" << enumType.cppType << R"cpp( ModifiedArgument<)cpp"
1862+ << _schemaNamespace << R"cpp( ::)cpp" << enumType.cppType
1863+ << R"cpp( >::convert(
1864+ const response::Value& value);
1865+ template <>
1866+ GRAPHQLSERVICE_EXPORT std::future<ResolverResult> ModifiedResult<)cpp"
1867+ << _schemaNamespace << R"cpp( ::)cpp" << enumType.cppType
1868+ << R"cpp( >::convert(
1869+ FieldResult<)cpp" << _schemaNamespace
1870+ << R"cpp( ::)cpp" << enumType.cppType
1871+ << R"cpp( >&& result, ResolverParams&& params);
1872+ )cpp" ;
1873+ }
1874+
1875+ for (const auto & inputType : _inputTypes)
1876+ {
1877+ headerFile << R"cpp( template <>
1878+ GRAPHQLSERVICE_EXPORT )cpp" << _schemaNamespace
1879+ << R"cpp( ::)cpp" << inputType.cppType << R"cpp( ModifiedArgument<)cpp"
1880+ << inputType.cppType << R"cpp( >::convert(
1881+ const response::Value& value);
1882+ )cpp" ;
1883+ }
1884+
1885+ headerFile << R"cpp( #endif // GRAPHQL_DLLEXPORTS
1886+
1887+ )cpp" ;
1888+ }
18811889 }
18821890 else
18831891 {
1884- headerFile << R"cpp( std::shared_ptr<schema::Schema> GetSchema();)cpp" ;
1885- }
1886-
1887- headerFile << R"cpp(
1892+ headerFile << R"cpp( std::shared_ptr<schema::Schema> GetSchema();
18881893
18891894)cpp" ;
1895+ }
18901896
18911897 return true ;
18921898}
0 commit comments