Skip to content

Commit 2dc6ebe

Browse files
committed
fix(dll): move introspection DLL exports to shared types header
1 parent 68b9d33 commit 2dc6ebe

File tree

15 files changed

+176
-157
lines changed

15 files changed

+176
-157
lines changed

include/graphqlservice/introspection/IntrospectionSchema.h

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "graphqlservice/GraphQLResponse.h"
1212
#include "graphqlservice/GraphQLService.h"
1313

14+
#include "graphqlservice/internal/DllExports.h"
1415
#include "graphqlservice/internal/Version.h"
1516
#include "graphqlservice/internal/Schema.h"
1617

@@ -25,8 +26,7 @@
2526
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2627
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2728

28-
namespace graphql {
29-
namespace introspection {
29+
namespace graphql::introspection {
3030
class Schema;
3131
class Type;
3232
class Field;
@@ -54,33 +54,6 @@ void AddDirectiveDetails(const std::shared_ptr<schema::ObjectType>& typeDirectiv
5454

5555
GRAPHQLSERVICE_EXPORT void AddTypesToSchema(const std::shared_ptr<schema::Schema>& schema);
5656

57-
} // namespace introspection
58-
59-
namespace service {
60-
61-
#ifdef GRAPHQL_DLLEXPORTS
62-
// Export all of the built-in converters
63-
template <>
64-
GRAPHQLSERVICE_EXPORT introspection::TypeKind Argument<introspection::TypeKind>::convert(
65-
const response::Value& value);
66-
template <>
67-
GRAPHQLSERVICE_EXPORT AwaitableResolver Result<introspection::TypeKind>::convert(
68-
AwaitableScalar<introspection::TypeKind> result, ResolverParams&& params);
69-
template <>
70-
GRAPHQLSERVICE_EXPORT void Result<introspection::TypeKind>::validateScalar(
71-
const response::Value& value);
72-
template <>
73-
GRAPHQLSERVICE_EXPORT introspection::DirectiveLocation Argument<introspection::DirectiveLocation>::convert(
74-
const response::Value& value);
75-
template <>
76-
GRAPHQLSERVICE_EXPORT AwaitableResolver Result<introspection::DirectiveLocation>::convert(
77-
AwaitableScalar<introspection::DirectiveLocation> result, ResolverParams&& params);
78-
template <>
79-
GRAPHQLSERVICE_EXPORT void Result<introspection::DirectiveLocation>::validateScalar(
80-
const response::Value& value);
81-
#endif // GRAPHQL_DLLEXPORTS
82-
83-
} // namespace service
84-
} // namespace graphql
57+
} // namespace graphql::introspection
8558

8659
#endif // INTROSPECTIONSCHEMA_H

include/graphqlservice/introspection/IntrospectionSharedTypes.h

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "graphqlservice/GraphQLResponse.h"
1212

13+
#include "graphqlservice/internal/DllExports.h"
1314
#include "graphqlservice/internal/Version.h"
1415

1516
#include <array>
@@ -23,7 +24,8 @@
2324
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2425
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2526

26-
namespace graphql::introspection {
27+
namespace graphql {
28+
namespace introspection {
2729

2830
enum class TypeKind
2931
{
@@ -146,6 +148,33 @@ enum class DirectiveLocation
146148
};
147149
}
148150

149-
} // namespace graphql::introspection
151+
} // namespace introspection
152+
153+
namespace service {
154+
155+
#ifdef GRAPHQL_DLLEXPORTS
156+
// Export all of the built-in converters
157+
template <>
158+
GRAPHQLSERVICE_EXPORT introspection::TypeKind Argument<introspection::TypeKind>::convert(
159+
const response::Value& value);
160+
template <>
161+
GRAPHQLSERVICE_EXPORT AwaitableResolver Result<introspection::TypeKind>::convert(
162+
AwaitableScalar<introspection::TypeKind> result, ResolverParams&& params);
163+
template <>
164+
GRAPHQLSERVICE_EXPORT void Result<introspection::TypeKind>::validateScalar(
165+
const response::Value& value);
166+
template <>
167+
GRAPHQLSERVICE_EXPORT introspection::DirectiveLocation Argument<introspection::DirectiveLocation>::convert(
168+
const response::Value& value);
169+
template <>
170+
GRAPHQLSERVICE_EXPORT AwaitableResolver Result<introspection::DirectiveLocation>::convert(
171+
AwaitableScalar<introspection::DirectiveLocation> result, ResolverParams&& params);
172+
template <>
173+
GRAPHQLSERVICE_EXPORT void Result<introspection::DirectiveLocation>::validateScalar(
174+
const response::Value& value);
175+
#endif // GRAPHQL_DLLEXPORTS
176+
177+
} // namespace service
178+
} // namespace graphql
150179

151180
#endif // INTROSPECTIONSHAREDTYPES_H

samples/learn/schema/StarWarsSchema.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2626
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2727

28-
namespace graphql {
29-
namespace learn {
28+
namespace graphql::learn {
3029
namespace object {
3130

3231
class Character;
@@ -73,7 +72,6 @@ void AddSubscriptionDetails(const std::shared_ptr<schema::ObjectType>& typeSubsc
7372

7473
std::shared_ptr<schema::Schema> GetSchema();
7574

76-
} // namespace learn
77-
} // namespace graphql
75+
} // namespace graphql::learn
7876

7977
#endif // STARWARSSCHEMA_H

samples/learn/schema/StarWarsSharedTypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2424
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2525

26-
namespace graphql::learn {
26+
namespace graphql {
27+
namespace learn {
2728

2829
enum class [[nodiscard("unnecessary conversion")]] Episode
2930
{
@@ -71,6 +72,7 @@ struct [[nodiscard("unnecessary construction")]] ReviewInput
7172
std::optional<std::string> commentary;
7273
};
7374

74-
} // namespace graphql::learn
75+
} // namespace learn
76+
} // namespace graphql
7577

7678
#endif // STARWARSSHAREDTYPES_H

samples/proxy/schema/ProxySchema.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2626
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2727

28-
namespace graphql {
29-
namespace proxy {
28+
namespace graphql::proxy {
3029
namespace object {
3130

3231
class Query;
@@ -57,7 +56,6 @@ void AddQueryResultsDetails(const std::shared_ptr<schema::ObjectType>& typeQuery
5756

5857
std::shared_ptr<schema::Schema> GetSchema();
5958

60-
} // namespace proxy
61-
} // namespace graphql
59+
} // namespace graphql::proxy
6260

6361
#endif // PROXYSCHEMA_H

samples/proxy/schema/ProxySharedTypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2424
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2525

26-
namespace graphql::proxy {
26+
namespace graphql {
27+
namespace proxy {
2728

2829
enum class [[nodiscard("unnecessary conversion")]] OperationType
2930
{
@@ -75,6 +76,7 @@ struct [[nodiscard("unnecessary construction")]] QueryInput
7576
std::optional<std::string> variables;
7677
};
7778

78-
} // namespace graphql::proxy
79+
} // namespace proxy
80+
} // namespace graphql
7981

8082
#endif // PROXYSHAREDTYPES_H

samples/today/nointrospection/TodaySchema.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2626
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2727

28-
namespace graphql {
29-
namespace today {
28+
namespace graphql::today {
3029
namespace object {
3130

3231
class Node;
@@ -97,7 +96,6 @@ void AddExpensiveDetails(const std::shared_ptr<schema::ObjectType>& typeExpensiv
9796

9897
std::shared_ptr<schema::Schema> GetSchema();
9998

100-
} // namespace today
101-
} // namespace graphql
99+
} // namespace graphql::today
102100

103101
#endif // TODAYSCHEMA_H

samples/today/nointrospection/TodaySharedTypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2424
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2525

26-
namespace graphql::today {
26+
namespace graphql {
27+
namespace today {
2728

2829
enum class [[nodiscard("unnecessary conversion")]] TaskState
2930
{
@@ -232,6 +233,7 @@ struct [[nodiscard("unnecessary construction")]] FirstNestedInput
232233
ThirdNestedInput third;
233234
};
234235

235-
} // namespace graphql::today
236+
} // namespace today
237+
} // namespace graphql
236238

237239
#endif // TODAYSHAREDTYPES_H

samples/today/schema/TodaySchema.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2626
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2727

28-
namespace graphql {
29-
namespace today {
28+
namespace graphql::today {
3029
namespace object {
3130

3231
class Node;
@@ -97,7 +96,6 @@ void AddExpensiveDetails(const std::shared_ptr<schema::ObjectType>& typeExpensiv
9796

9897
std::shared_ptr<schema::Schema> GetSchema();
9998

100-
} // namespace today
101-
} // namespace graphql
99+
} // namespace graphql::today
102100

103101
#endif // TODAYSCHEMA_H

samples/today/schema/TodaySharedTypes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
static_assert(graphql::internal::MajorVersion == 5, "regenerate with schemagen: major version mismatch");
2424
static_assert(graphql::internal::MinorVersion == 0, "regenerate with schemagen: minor version mismatch");
2525

26-
namespace graphql::today {
26+
namespace graphql {
27+
namespace today {
2728

2829
enum class [[nodiscard("unnecessary conversion")]] TaskState
2930
{
@@ -232,6 +233,7 @@ struct [[nodiscard("unnecessary construction")]] FirstNestedInput
232233
ThirdNestedInput third;
233234
};
234235

235-
} // namespace graphql::today
236+
} // namespace today
237+
} // namespace graphql
236238

237239
#endif // TODAYSHAREDTYPES_H

0 commit comments

Comments
 (0)