Skip to content

Commit e652672

Browse files
authored
Merge pull request #266 from wravery/sort-clientgen-enums
Fix #265
2 parents 8c1623a + 1a2bd71 commit e652672

22 files changed

+143
-149
lines changed

cmake/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.5.0
1+
4.5.1

include/graphqlservice/internal/Version.h

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

1111
namespace graphql::internal {
1212

13-
constexpr std::string_view FullVersion { "4.5.0" };
13+
constexpr std::string_view FullVersion { "4.5.1" };
1414

1515
constexpr size_t MajorVersion = 4;
1616
constexpr size_t MinorVersion = 5;
17-
constexpr size_t PatchVersion = 0;
17+
constexpr size_t PatchVersion = 1;
1818

1919
} // namespace graphql::internal
2020

res/ClientGen.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/SchemaGen.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlclient_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqljson_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlpeg_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlresponse_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlservice_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,0,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.0"
6+
#define GRAPHQL_RC_VERSION 4,5,1,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.1"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

samples/client/multiple/MultipleQueriesClient.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,6 @@ Response parseResponse(response::Value&& response)
516516

517517
} // namespace query::UnreadCounts
518518

519-
static const std::array<std::pair<std::string_view, TaskState>, 4> s_valuesTaskState = {
520-
std::make_pair(R"gql(New)gql"sv, TaskState::New),
521-
std::make_pair(R"gql(Started)gql"sv, TaskState::Started),
522-
std::make_pair(R"gql(Complete)gql"sv, TaskState::Complete),
523-
std::make_pair(R"gql(Unassigned)gql"sv, TaskState::Unassigned)
524-
};
525-
526519
template <>
527520
TaskState Response<TaskState>::parse(response::Value&& value)
528521
{
@@ -531,8 +524,15 @@ TaskState Response<TaskState>::parse(response::Value&& value)
531524
throw std::logic_error { R"ex(not a valid TaskState value)ex" };
532525
}
533526

527+
static const std::array<std::pair<std::string_view, TaskState>, 4> s_values = {
528+
std::make_pair(R"gql(New)gql"sv, TaskState::New),
529+
std::make_pair(R"gql(Started)gql"sv, TaskState::Started),
530+
std::make_pair(R"gql(Complete)gql"sv, TaskState::Complete),
531+
std::make_pair(R"gql(Unassigned)gql"sv, TaskState::Unassigned)
532+
};
533+
534534
const auto result = internal::sorted_map_lookup<internal::shorter_or_less>(
535-
s_valuesTaskState,
535+
s_values,
536536
std::string_view { value.get<std::string>() });
537537

538538
if (!result)
@@ -637,19 +637,19 @@ Response parseResponse(response::Value&& response)
637637

638638
} // namespace query::Miscellaneous
639639

640-
static const std::array<std::string_view, 4> s_namesTaskState = {
641-
R"gql(New)gql"sv,
642-
R"gql(Started)gql"sv,
643-
R"gql(Complete)gql"sv,
644-
R"gql(Unassigned)gql"sv
645-
};
646-
647640
template <>
648641
response::Value Variable<TaskState>::serialize(TaskState&& value)
649642
{
643+
static const std::array<std::string_view, 4> s_names = {
644+
R"gql(Unassigned)gql"sv,
645+
R"gql(New)gql"sv,
646+
R"gql(Started)gql"sv,
647+
R"gql(Complete)gql"sv
648+
};
649+
650650
response::Value result { response::Type::EnumValue };
651651

652-
result.set<std::string>(std::string { s_namesTaskState[static_cast<size_t>(value)] });
652+
result.set<std::string>(std::string { s_names[static_cast<size_t>(value)] });
653653

654654
return result;
655655
}

0 commit comments

Comments
 (0)