Skip to content

Commit 98e3c40

Browse files
committed
Fix #265
1 parent 8c1623a commit 98e3c40

File tree

12 files changed

+46
-32
lines changed

12 files changed

+46
-32
lines changed

samples/client/multiple/MultipleQueriesClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,10 @@ Response parseResponse(response::Value&& response)
638638
} // namespace query::Miscellaneous
639639

640640
static const std::array<std::string_view, 4> s_namesTaskState = {
641+
R"gql(Unassigned)gql"sv,
641642
R"gql(New)gql"sv,
642643
R"gql(Started)gql"sv,
643-
R"gql(Complete)gql"sv,
644-
R"gql(Unassigned)gql"sv
644+
R"gql(Complete)gql"sv
645645
};
646646

647647
template <>

samples/client/multiple/MultipleQueriesClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ namespace multiple {
119119

120120
enum class [[nodiscard]] TaskState
121121
{
122+
Unassigned,
122123
New,
123124
Started,
124125
Complete,
125-
Unassigned,
126126
};
127127

128128
struct [[nodiscard]] CompleteTaskInput

samples/client/mutate/MutateClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const std::string& GetRequestText() noexcept
2525
# Copyright (c) Microsoft Corporation. All rights reserved.
2626
# Licensed under the MIT License.
2727
28-
mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!"}, $skipClientMutationId: Boolean!) {
28+
mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!", testTaskState: Unassigned}, $skipClientMutationId: Boolean!) {
2929
completedTask: completeTask(input: $input) {
3030
completedTask: task {
3131
completedTaskId: id
@@ -106,10 +106,10 @@ CompleteTaskInput& CompleteTaskInput::operator=(CompleteTaskInput&& other) noexc
106106
using namespace mutate;
107107

108108
static const std::array<std::string_view, 4> s_namesTaskState = {
109+
R"gql(Unassigned)gql"sv,
109110
R"gql(New)gql"sv,
110111
R"gql(Started)gql"sv,
111-
R"gql(Complete)gql"sv,
112-
R"gql(Unassigned)gql"sv
112+
R"gql(Complete)gql"sv
113113
};
114114

115115
template <>

samples/client/mutate/MutateClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace graphql::client {
3131
/// # Copyright (c) Microsoft Corporation. All rights reserved.
3232
/// # Licensed under the MIT License.
3333
///
34-
/// mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!"}, $skipClientMutationId: Boolean!) {
34+
/// mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!", testTaskState: Unassigned}, $skipClientMutationId: Boolean!) {
3535
/// completedTask: completeTask(input: $input) {
3636
/// completedTask: task {
3737
/// completedTaskId: id
@@ -52,10 +52,10 @@ namespace mutate {
5252

5353
enum class [[nodiscard]] TaskState
5454
{
55+
Unassigned,
5556
New,
5657
Started,
5758
Complete,
58-
Unassigned,
5959
};
6060

6161
struct [[nodiscard]] CompleteTaskInput

samples/client/mutate/mutate.today.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!"}, $skipClientMutationId: Boolean!) {
4+
mutation CompleteTaskMutation($input: CompleteTaskInput = {id: "ZmFrZVRhc2tJZA==", isComplete: true, clientMutationId: "Hi There!", testTaskState: Unassigned}, $skipClientMutationId: Boolean!) {
55
completedTask: completeTask(input: $input) {
66
completedTask: task {
77
completedTaskId: id

samples/client/query/QueryClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ namespace query {
100100

101101
enum class [[nodiscard]] TaskState
102102
{
103+
Unassigned,
103104
New,
104105
Started,
105106
Complete,
106-
Unassigned,
107107
};
108108

109109
} // namespace query

samples/today/nointrospection/TodaySchema.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,10 @@ void AddTypesToSchema(const std::shared_ptr<schema::Schema>& schema)
684684
schema->AddType(R"gql(Expensive)gql"sv, typeExpensive);
685685

686686
typeTaskState->AddEnumValues({
687+
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Unassigned)], R"md()md"sv, std::make_optional(R"md(Need to deprecate an [enum value](https://spec.graphql.org/October2021/#sec-Schema-Introspection.Deprecation))md"sv) },
687688
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::New)], R"md()md"sv, std::nullopt },
688689
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Started)], R"md()md"sv, std::nullopt },
689-
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Complete)], R"md()md"sv, std::nullopt },
690-
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Unassigned)], R"md()md"sv, std::make_optional(R"md(Need to deprecate an [enum value](https://spec.graphql.org/October2021/#sec-Schema-Introspection.Deprecation))md"sv) }
690+
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Complete)], R"md()md"sv, std::nullopt }
691691
});
692692

693693
typeCompleteTaskInput->AddInputValues({

samples/today/nointrospection/TodaySchema.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ namespace today {
2424

2525
enum class [[nodiscard]] TaskState
2626
{
27+
Unassigned,
2728
New,
2829
Started,
29-
Complete,
30-
Unassigned
30+
Complete
3131
};
3232

3333
[[nodiscard]] constexpr auto getTaskStateNames() noexcept
3434
{
3535
using namespace std::literals;
3636

3737
return std::array<std::string_view, 4> {
38+
R"gql(Unassigned)gql"sv,
3839
R"gql(New)gql"sv,
3940
R"gql(Started)gql"sv,
40-
R"gql(Complete)gql"sv,
41-
R"gql(Unassigned)gql"sv
41+
R"gql(Complete)gql"sv
4242
};
4343
}
4444

samples/today/schema.today.graphql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ type Subscription {
117117
scalar DateTime @specifiedBy(url: "https://en.wikipedia.org/wiki/ISO_8601")
118118

119119
enum TaskState {
120-
New
121-
Started
122-
Complete
123120
Unassigned @deprecated(
124121
reason:"""Need to deprecate an [enum value](https://spec.graphql.org/October2021/#sec-Schema-Introspection.Deprecation)"""
125122
)
123+
New
124+
Started
125+
Complete
126126
}
127127

128128
type Appointment implements Node {

samples/today/schema/TodaySchema.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,10 @@ void AddTypesToSchema(const std::shared_ptr<schema::Schema>& schema)
687687
schema->AddType(R"gql(Expensive)gql"sv, typeExpensive);
688688

689689
typeTaskState->AddEnumValues({
690+
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Unassigned)], R"md()md"sv, std::make_optional(R"md(Need to deprecate an [enum value](https://spec.graphql.org/October2021/#sec-Schema-Introspection.Deprecation))md"sv) },
690691
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::New)], R"md()md"sv, std::nullopt },
691692
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Started)], R"md()md"sv, std::nullopt },
692-
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Complete)], R"md()md"sv, std::nullopt },
693-
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Unassigned)], R"md()md"sv, std::make_optional(R"md(Need to deprecate an [enum value](https://spec.graphql.org/October2021/#sec-Schema-Introspection.Deprecation))md"sv) }
693+
{ service::s_namesTaskState[static_cast<size_t>(today::TaskState::Complete)], R"md()md"sv, std::nullopt }
694694
});
695695

696696
typeCompleteTaskInput->AddInputValues({

0 commit comments

Comments
 (0)