Skip to content

Commit ddf63e0

Browse files
committed
Fix move semantics
1 parent 8ac5ae8 commit ddf63e0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/GraphQLService.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,21 +1231,21 @@ AwaitableResolver Object::resolve(const SelectionSetParams& selectionSetParams,
12311231

12321232
for (auto& child : children)
12331233
{
1234-
auto location = std::move(child.location).value_or(schema_location {});
1235-
auto path = std::move(child.path).value_or(error_path {});
1236-
12371234
try
12381235
{
12391236
co_await launch;
12401237

1241-
auto value = co_await child.result;
1238+
auto value = co_await std::move(child.result);
12421239

12431240
if (!document.data.emplace_back(std::string { child.name }, std::move(value.data)))
12441241
{
12451242
std::ostringstream message;
12461243

12471244
message << "Ambiguous field error name: " << child.name;
12481245

1246+
auto location = std::move(child.location).value_or(schema_location {});
1247+
auto path = std::move(child.path).value_or(error_path {});
1248+
12491249
document.errors.push_back({ message.str(), std::move(location), std::move(path) });
12501250
}
12511251

@@ -1271,6 +1271,9 @@ AwaitableResolver Object::resolve(const SelectionSetParams& selectionSetParams,
12711271

12721272
message << "Field error name: " << child.name << " unknown error: " << ex.what();
12731273

1274+
auto location = std::move(child.location).value_or(schema_location {});
1275+
auto path = std::move(child.path).value_or(error_path {});
1276+
12741277
document.errors.push_back({ message.str(), std::move(location), std::move(path) });
12751278
document.data.emplace_back(std::string { child.name }, {});
12761279
}

0 commit comments

Comments
 (0)