@@ -695,7 +695,7 @@ void requireSubFields(const ResolverParams& params)
695
695
696
696
template <>
697
697
AwaitableResolver ModifiedResult<Object>::convert(
698
- AwaitableObject<std::shared_ptr<Object>> result, ResolverParams params)
698
+ AwaitableObject<std::shared_ptr<const Object>> result, ResolverParams params)
699
699
{
700
700
requireSubFields (params);
701
701
@@ -1378,7 +1378,7 @@ class SubscriptionDefinitionVisitor
1378
1378
{
1379
1379
public:
1380
1380
SubscriptionDefinitionVisitor (RequestSubscribeParams&& params, FragmentMap&& fragments,
1381
- const std::shared_ptr<Object>& subscriptionObject);
1381
+ const std::shared_ptr<const Object>& subscriptionObject);
1382
1382
1383
1383
const peg::ast_node& getRoot () const ;
1384
1384
std::shared_ptr<SubscriptionData> getRegistration ();
@@ -1392,15 +1392,15 @@ class SubscriptionDefinitionVisitor
1392
1392
1393
1393
RequestSubscribeParams _params;
1394
1394
FragmentMap _fragments;
1395
- const std::shared_ptr<Object>& _subscriptionObject;
1395
+ const std::shared_ptr<const Object>& _subscriptionObject;
1396
1396
SubscriptionName _field;
1397
1397
response::Value _arguments;
1398
1398
Directives _fieldDirectives;
1399
1399
std::shared_ptr<SubscriptionData> _result;
1400
1400
};
1401
1401
1402
1402
SubscriptionDefinitionVisitor::SubscriptionDefinitionVisitor (RequestSubscribeParams&& params,
1403
- FragmentMap&& fragments, const std::shared_ptr<Object>& subscriptionObject)
1403
+ FragmentMap&& fragments, const std::shared_ptr<const Object>& subscriptionObject)
1404
1404
: _params(std::move(params))
1405
1405
, _fragments(std::move(fragments))
1406
1406
, _subscriptionObject(subscriptionObject)
@@ -1748,6 +1748,7 @@ response::AwaitableValue Request::resolve(RequestResolveParams params) const
1748
1748
AwaitableSubscribe Request::subscribe (RequestSubscribeParams params)
1749
1749
{
1750
1750
const auto spThis = shared_from_this ();
1751
+ const auto launch = std::move (params.launch );
1751
1752
std::unique_lock lock { spThis->_subscriptionMutex };
1752
1753
const auto key = spThis->addSubscription (std::move (params));
1753
1754
const auto itrOperation = spThis->_operations .find (strSubscription);
@@ -1764,14 +1765,14 @@ AwaitableSubscribe Request::subscribe(RequestSubscribeParams params)
1764
1765
std::make_shared<FragmentSpreadDirectiveStack>(),
1765
1766
std::make_shared<FragmentSpreadDirectiveStack>(),
1766
1767
{},
1767
- params. launch ,
1768
+ launch,
1768
1769
};
1769
1770
1770
1771
lock.unlock ();
1771
1772
1772
1773
try
1773
1774
{
1774
- co_await params. launch ;
1775
+ co_await launch;
1775
1776
co_await operation->resolve (selectionSetParams,
1776
1777
registration->selection ,
1777
1778
registration->data ->fragments ,
@@ -1997,10 +1998,10 @@ void Request::removeSubscription(SubscriptionKey key)
1997
1998
}
1998
1999
}
1999
2000
2000
- std::vector<std::shared_ptr<SubscriptionData>> Request::collectRegistrations (
2001
+ std::vector<std::shared_ptr<const SubscriptionData>> Request::collectRegistrations (
2001
2002
std::string_view field, RequestDeliverFilter&& filter) const noexcept
2002
2003
{
2003
- std::vector<std::shared_ptr<SubscriptionData>> registrations;
2004
+ std::vector<std::shared_ptr<const SubscriptionData>> registrations;
2004
2005
const std::lock_guard lock { _subscriptionMutex };
2005
2006
const auto itrListeners = _listeners.find (field);
2006
2007
@@ -2016,7 +2017,7 @@ std::vector<std::shared_ptr<SubscriptionData>> Request::collectRegistrations(
2016
2017
[this ](const auto & key) noexcept {
2017
2018
const auto itr = _subscriptions.find (key);
2018
2019
2019
- return itr == _subscriptions.end () ? std::shared_ptr<SubscriptionData> {}
2020
+ return itr == _subscriptions.end () ? std::shared_ptr<const SubscriptionData> {}
2020
2021
: itr->second ;
2021
2022
});
2022
2023
}
0 commit comments