Skip to content

Commit c623c00

Browse files
committed
Favor underlying non-template standard types
1 parent f6b09ee commit c623c00

File tree

109 files changed

+1063
-1102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1063
-1102
lines changed

include/Validation.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,16 @@ struct ValidateArgumentMap
7979
internal::string_view_map<ValidateArgumentValuePtr> values;
8080
};
8181

82-
using ValidateArgumentVariant = std::variant<ValidateArgumentVariable, response::IntType,
83-
response::FloatType, std::string_view, response::BooleanType, ValidateArgumentEnumValue,
84-
ValidateArgumentList, ValidateArgumentMap>;
82+
using ValidateArgumentVariant = std::variant<ValidateArgumentVariable, int, double,
83+
std::string_view, bool, ValidateArgumentEnumValue, ValidateArgumentList, ValidateArgumentMap>;
8584

8685
struct ValidateArgumentValue
8786
{
8887
ValidateArgumentValue(ValidateArgumentVariable&& value);
89-
ValidateArgumentValue(response::IntType value);
90-
ValidateArgumentValue(response::FloatType value);
88+
ValidateArgumentValue(int value);
89+
ValidateArgumentValue(double value);
9190
ValidateArgumentValue(std::string_view value);
92-
ValidateArgumentValue(response::BooleanType value);
91+
ValidateArgumentValue(bool value);
9392
ValidateArgumentValue(ValidateArgumentEnumValue&& value);
9493
ValidateArgumentValue(ValidateArgumentList&& value);
9594
ValidateArgumentValue(ValidateArgumentMap&& value);

include/graphqlservice/GraphQLClient.h

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ namespace graphql::client {
3434
// Errors may specify the line number and column number where the error occurred.
3535
struct ErrorLocation
3636
{
37-
response::IntType line {};
38-
response::IntType column {};
37+
int line {};
38+
int column {};
3939
};
4040

4141
// Errors may specify a path to the field which triggered the error. The path consists of
4242
// field names and the indices of elements in a list.
43-
using ErrorPathSegment = std::variant<response::StringType, response::IntType>;
43+
using ErrorPathSegment = std::variant<std::string, int>;
4444

4545
// Error returned from the service.
4646
struct Error
@@ -141,27 +141,23 @@ struct ModifiedVariable
141141
// Convenient type aliases for testing, generated code won't actually use these. These are also
142142
// the specializations which are implemented in the GraphQLClient library, other specializations
143143
// for input types should be generated in schemagen.
144-
using IntVariable = ModifiedVariable<response::IntType>;
145-
using FloatVariable = ModifiedVariable<response::FloatType>;
146-
using StringVariable = ModifiedVariable<response::StringType>;
147-
using BooleanVariable = ModifiedVariable<response::BooleanType>;
144+
using IntVariable = ModifiedVariable<int>;
145+
using FloatVariable = ModifiedVariable<double>;
146+
using StringVariable = ModifiedVariable<std::string>;
147+
using BooleanVariable = ModifiedVariable<bool>;
148148
using IdVariable = ModifiedVariable<response::IdType>;
149149
using ScalarVariable = ModifiedVariable<response::Value>;
150150

151151
#ifdef GRAPHQL_DLLEXPORTS
152152
// Export all of the built-in converters
153153
template <>
154-
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<response::IntType>::serialize(
155-
response::IntType&& value);
154+
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<int>::serialize(int&& value);
156155
template <>
157-
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<response::FloatType>::serialize(
158-
response::FloatType&& value);
156+
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<double>::serialize(double&& value);
159157
template <>
160-
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<response::StringType>::serialize(
161-
response::StringType&& value);
158+
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<std::string>::serialize(std::string&& value);
162159
template <>
163-
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<response::BooleanType>::serialize(
164-
response::BooleanType&& value);
160+
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<bool>::serialize(bool&& value);
165161
template <>
166162
GRAPHQLCLIENT_EXPORT response::Value ModifiedVariable<response::IdType>::serialize(
167163
response::IdType&& value);
@@ -245,27 +241,23 @@ struct ModifiedResponse
245241
// Convenient type aliases for testing, generated code won't actually use these. These are also
246242
// the specializations which are implemented in the GraphQLClient library, other specializations
247243
// for output types should be generated in schemagen.
248-
using IntResponse = ModifiedResponse<response::IntType>;
249-
using FloatResponse = ModifiedResponse<response::FloatType>;
250-
using StringResponse = ModifiedResponse<response::StringType>;
251-
using BooleanResponse = ModifiedResponse<response::BooleanType>;
244+
using IntResponse = ModifiedResponse<int>;
245+
using FloatResponse = ModifiedResponse<double>;
246+
using StringResponse = ModifiedResponse<std::string>;
247+
using BooleanResponse = ModifiedResponse<bool>;
252248
using IdResponse = ModifiedResponse<response::IdType>;
253249
using ScalarResponse = ModifiedResponse<response::Value>;
254250

255251
#ifdef GRAPHQL_DLLEXPORTS
256252
// Export all of the built-in converters
257253
template <>
258-
GRAPHQLCLIENT_EXPORT response::IntType ModifiedResponse<response::IntType>::parse(
259-
response::Value response);
254+
GRAPHQLCLIENT_EXPORT int ModifiedResponse<int>::parse(response::Value response);
260255
template <>
261-
GRAPHQLCLIENT_EXPORT response::FloatType ModifiedResponse<response::FloatType>::parse(
262-
response::Value response);
256+
GRAPHQLCLIENT_EXPORT double ModifiedResponse<double>::parse(response::Value response);
263257
template <>
264-
GRAPHQLCLIENT_EXPORT response::StringType ModifiedResponse<response::StringType>::parse(
265-
response::Value response);
258+
GRAPHQLCLIENT_EXPORT std::string ModifiedResponse<std::string>::parse(response::Value response);
266259
template <>
267-
GRAPHQLCLIENT_EXPORT response::BooleanType ModifiedResponse<response::BooleanType>::parse(
268-
response::Value response);
260+
GRAPHQLCLIENT_EXPORT bool ModifiedResponse<bool>::parse(response::Value response);
269261
template <>
270262
GRAPHQLCLIENT_EXPORT response::IdType ModifiedResponse<response::IdType>::parse(
271263
response::Value response);

include/graphqlservice/GraphQLService.h

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -494,27 +494,24 @@ struct ModifiedArgument
494494
// Convenient type aliases for testing, generated code won't actually use these. These are also
495495
// the specializations which are implemented in the GraphQLService library, other specializations
496496
// for input types should be generated in schemagen.
497-
using IntArgument = ModifiedArgument<response::IntType>;
498-
using FloatArgument = ModifiedArgument<response::FloatType>;
499-
using StringArgument = ModifiedArgument<response::StringType>;
500-
using BooleanArgument = ModifiedArgument<response::BooleanType>;
497+
using IntArgument = ModifiedArgument<int>;
498+
using FloatArgument = ModifiedArgument<double>;
499+
using StringArgument = ModifiedArgument<std::string>;
500+
using BooleanArgument = ModifiedArgument<bool>;
501501
using IdArgument = ModifiedArgument<response::IdType>;
502502
using ScalarArgument = ModifiedArgument<response::Value>;
503503

504504
#ifdef GRAPHQL_DLLEXPORTS
505505
// Export all of the built-in converters
506506
template <>
507-
GRAPHQLSERVICE_EXPORT response::IntType ModifiedArgument<response::IntType>::convert(
508-
const response::Value& value);
507+
GRAPHQLSERVICE_EXPORT int ModifiedArgument<int>::convert(const response::Value& value);
509508
template <>
510-
GRAPHQLSERVICE_EXPORT response::FloatType ModifiedArgument<response::FloatType>::convert(
511-
const response::Value& value);
509+
GRAPHQLSERVICE_EXPORT double ModifiedArgument<double>::convert(const response::Value& value);
512510
template <>
513-
GRAPHQLSERVICE_EXPORT response::StringType ModifiedArgument<response::StringType>::convert(
511+
GRAPHQLSERVICE_EXPORT std::string ModifiedArgument<std::string>::convert(
514512
const response::Value& value);
515513
template <>
516-
GRAPHQLSERVICE_EXPORT response::BooleanType ModifiedArgument<response::BooleanType>::convert(
517-
const response::Value& value);
514+
GRAPHQLSERVICE_EXPORT bool ModifiedArgument<bool>::convert(const response::Value& value);
518515
template <>
519516
GRAPHQLSERVICE_EXPORT response::IdType ModifiedArgument<response::IdType>::convert(
520517
const response::Value& value);
@@ -829,28 +826,28 @@ struct ModifiedResult
829826
// Convenient type aliases for testing, generated code won't actually use these. These are also
830827
// the specializations which are implemented in the GraphQLService library, other specializations
831828
// for output types should be generated in schemagen.
832-
using IntResult = ModifiedResult<response::IntType>;
833-
using FloatResult = ModifiedResult<response::FloatType>;
834-
using StringResult = ModifiedResult<response::StringType>;
835-
using BooleanResult = ModifiedResult<response::BooleanType>;
829+
using IntResult = ModifiedResult<int>;
830+
using FloatResult = ModifiedResult<double>;
831+
using StringResult = ModifiedResult<std::string>;
832+
using BooleanResult = ModifiedResult<bool>;
836833
using IdResult = ModifiedResult<response::IdType>;
837834
using ScalarResult = ModifiedResult<response::Value>;
838835
using ObjectResult = ModifiedResult<Object>;
839836

840837
#ifdef GRAPHQL_DLLEXPORTS
841838
// Export all of the built-in converters
842839
template <>
843-
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<response::IntType>::convert(
844-
FieldResult<response::IntType> result, ResolverParams params);
840+
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<int>::convert(
841+
FieldResult<int> result, ResolverParams params);
845842
template <>
846-
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<response::FloatType>::convert(
847-
FieldResult<response::FloatType> result, ResolverParams params);
843+
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<double>::convert(
844+
FieldResult<double> result, ResolverParams params);
848845
template <>
849-
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<response::StringType>::convert(
850-
FieldResult<response::StringType> result, ResolverParams params);
846+
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<std::string>::convert(
847+
FieldResult<std::string> result, ResolverParams params);
851848
template <>
852-
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<response::BooleanType>::convert(
853-
FieldResult<response::BooleanType> result, ResolverParams params);
849+
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<bool>::convert(
850+
FieldResult<bool> result, ResolverParams params);
854851
template <>
855852
GRAPHQLSERVICE_EXPORT AwaitableResolver ModifiedResult<response::IdType>::convert(
856853
FieldResult<response::IdType> result, ResolverParams params);

include/graphqlservice/introspection/Introspection.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ class Type
4343

4444
// Accessors
4545
GRAPHQLINTROSPECTION_EXPORT TypeKind getKind() const;
46-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getName() const;
47-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDescription() const;
46+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getName() const;
47+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
4848
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Field>>>
49-
getFields(std::optional<response::BooleanType>&& includeDeprecatedArg) const;
49+
getFields(std::optional<bool>&& includeDeprecatedArg) const;
5050
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
5151
getInterfaces() const;
5252
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
5353
getPossibleTypes() const;
5454
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::EnumValue>>>
55-
getEnumValues(std::optional<response::BooleanType>&& includeDeprecatedArg) const;
55+
getEnumValues(std::optional<bool>&& includeDeprecatedArg) const;
5656
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::InputValue>>>
5757
getInputFields() const;
5858
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getOfType() const;
@@ -67,12 +67,12 @@ class Field
6767
GRAPHQLINTROSPECTION_EXPORT explicit Field(const std::shared_ptr<const schema::Field>& field);
6868

6969
// Accessors
70-
GRAPHQLINTROSPECTION_EXPORT response::StringType getName() const;
71-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDescription() const;
70+
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
71+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
7272
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
7373
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getType() const;
74-
GRAPHQLINTROSPECTION_EXPORT response::BooleanType getIsDeprecated() const;
75-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDeprecationReason() const;
74+
GRAPHQLINTROSPECTION_EXPORT bool getIsDeprecated() const;
75+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDeprecationReason() const;
7676

7777
private:
7878
const std::shared_ptr<const schema::Field> _field;
@@ -85,10 +85,10 @@ class InputValue
8585
const std::shared_ptr<const schema::InputValue>& inputValue);
8686

8787
// Accessors
88-
GRAPHQLINTROSPECTION_EXPORT response::StringType getName() const;
89-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDescription() const;
88+
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
89+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
9090
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getType() const;
91-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDefaultValue() const;
91+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDefaultValue() const;
9292

9393
private:
9494
const std::shared_ptr<const schema::InputValue> _inputValue;
@@ -101,10 +101,10 @@ class EnumValue
101101
const std::shared_ptr<const schema::EnumValue>& enumValue);
102102

103103
// Accessors
104-
GRAPHQLINTROSPECTION_EXPORT response::StringType getName() const;
105-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDescription() const;
106-
GRAPHQLINTROSPECTION_EXPORT response::BooleanType getIsDeprecated() const;
107-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDeprecationReason() const;
104+
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
105+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
106+
GRAPHQLINTROSPECTION_EXPORT bool getIsDeprecated() const;
107+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDeprecationReason() const;
108108

109109
private:
110110
const std::shared_ptr<const schema::EnumValue> _enumValue;
@@ -117,8 +117,8 @@ class Directive
117117
const std::shared_ptr<const schema::Directive>& directive);
118118

119119
// Accessors
120-
GRAPHQLINTROSPECTION_EXPORT response::StringType getName() const;
121-
GRAPHQLINTROSPECTION_EXPORT std::optional<response::StringType> getDescription() const;
120+
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
121+
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
122122
GRAPHQLINTROSPECTION_EXPORT std::vector<DirectiveLocation> getLocations() const;
123123
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
124124

0 commit comments

Comments
 (0)