@@ -67,7 +67,7 @@ std::vector<std::shared_ptr<object::__Type>> Schema::getTypes() const
67
67
68
68
std::shared_ptr<object::__Type> Schema::getQueryType () const
69
69
{
70
- return _query. lock () ;
70
+ return _query;
71
71
}
72
72
73
73
std::shared_ptr<object::__Type> Schema::getMutationType () const
@@ -236,7 +236,12 @@ UnionType::UnionType(std::string name, std::string description)
236
236
237
237
void UnionType::AddPossibleTypes (std::vector<std::shared_ptr<object::__Type>> possibleTypes)
238
238
{
239
- _possibleTypes = std::move (possibleTypes);
239
+ _possibleTypes.resize (possibleTypes.size ());
240
+ std::transform (possibleTypes.cbegin (), possibleTypes.cend (), _possibleTypes.begin (),
241
+ [](const std::shared_ptr<object::__Type>& shared)
242
+ {
243
+ return shared;
244
+ });
240
245
}
241
246
242
247
__TypeKind UnionType::getKind () const
@@ -255,7 +260,11 @@ std::unique_ptr<std::vector<std::shared_ptr<object::__Type>>> UnionType::getPoss
255
260
{
256
261
std::unique_ptr<std::vector<std::shared_ptr<object::__Type>>> result (new std::vector<std::shared_ptr<object::__Type>>(_possibleTypes.size ()));
257
262
258
- std::copy (_possibleTypes.cbegin (), _possibleTypes.cend (), result->begin ());
263
+ std::transform (_possibleTypes.cbegin (), _possibleTypes.cend (), result->begin (),
264
+ [](const std::weak_ptr<object::__Type>& weak)
265
+ {
266
+ return weak.lock ();
267
+ });
259
268
260
269
return result;
261
270
}
@@ -347,7 +356,7 @@ __TypeKind WrapperType::getKind() const
347
356
348
357
std::shared_ptr<object::__Type> WrapperType::getOfType () const
349
358
{
350
- return _ofType;
359
+ return _ofType. lock () ;
351
360
}
352
361
353
362
Field::Field (std::string name, std::string description, std::unique_ptr<std::string>&& deprecationReason, std::vector<std::shared_ptr<InputValue>> args, std::shared_ptr<object::__Type> type)
@@ -382,7 +391,7 @@ std::vector<std::shared_ptr<object::__InputValue>> Field::getArgs() const
382
391
383
392
std::shared_ptr<object::__Type> Field::getType () const
384
393
{
385
- return _type;
394
+ return _type. lock () ;
386
395
}
387
396
388
397
bool Field::getIsDeprecated () const
@@ -419,7 +428,7 @@ std::unique_ptr<std::string> InputValue::getDescription() const
419
428
420
429
std::shared_ptr<object::__Type> InputValue::getType () const
421
430
{
422
- return _type;
431
+ return _type. lock () ;
423
432
}
424
433
425
434
std::unique_ptr<std::string> InputValue::getDefaultValue () const
0 commit comments