Skip to content

Commit 5e45c3e

Browse files
committed
Export functions from DLLs for clientgen
1 parent 3af63f6 commit 5e45c3e

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

include/Validation.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ class ValidateVariableTypeVisitor
169169
class ValidateExecutableVisitor
170170
{
171171
public:
172-
ValidateExecutableVisitor(const std::shared_ptr<schema::Schema>& schema);
172+
GRAPHQLSERVICE_EXPORT ValidateExecutableVisitor(const std::shared_ptr<schema::Schema>& schema);
173173

174-
void visit(const peg::ast_node& root);
174+
GRAPHQLSERVICE_EXPORT void visit(const peg::ast_node& root);
175175

176-
std::list<schema_error> getStructuredErrors();
176+
GRAPHQLSERVICE_EXPORT std::list<schema_error> getStructuredErrors();
177177

178178
private:
179179
static ValidateTypeFieldArguments getArguments(

include/graphqlservice/introspection/IntrospectionSchema.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ enum class DirectiveLocation
6868
INPUT_FIELD_DEFINITION
6969
};
7070

71+
#ifdef GRAPHQL_DLLEXPORTS
72+
// Export all of the built-in converters
73+
template <>
74+
GRAPHQLSERVICE_EXPORT TypeKind service::ModifiedArgument<TypeKind>::convert(
75+
const response::Value& value);
76+
template <>
77+
GRAPHQLSERVICE_EXPORT std::future<service::ResolverResult> service::ModifiedResult<TypeKind>::convert(
78+
service::FieldResult<TypeKind>&& result, service::ResolverParams&& params);
79+
template <>
80+
GRAPHQLSERVICE_EXPORT DirectiveLocation service::ModifiedArgument<DirectiveLocation>::convert(
81+
const response::Value& value);
82+
template <>
83+
GRAPHQLSERVICE_EXPORT std::future<service::ResolverResult> service::ModifiedResult<DirectiveLocation>::convert(
84+
service::FieldResult<DirectiveLocation>&& result, service::ResolverParams&& params);
85+
#endif // GRAPHQL_DLLEXPORTS
86+
7187
namespace object {
7288

7389
class Schema;

src/SchemaGenerator.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,28 @@ 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+
16741696
)cpp";
16751697
}
16761698
}
@@ -1704,6 +1726,25 @@ static_assert(graphql::internal::MinorVersion == )cpp"
17041726
}
17051727
headerFile << R"cpp(};
17061728
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+
17071748
)cpp";
17081749
}
17091750
}

0 commit comments

Comments
 (0)