Skip to content

Commit 00fd98b

Browse files
committed
Fix a circular reference between Query and Schema
1 parent 7d8e661 commit 00fd98b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Introspection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ std::vector<std::shared_ptr<object::__Type>> Schema::getTypes() const
6767

6868
std::shared_ptr<object::__Type> Schema::getQueryType() const
6969
{
70-
return _query;
70+
return _query.lock();
7171
}
7272

7373
std::shared_ptr<object::__Type> Schema::getMutationType() const

Introspection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Schema : public object::__Schema
4141
std::vector<std::shared_ptr<object::__Directive>> getDirectives() const override;
4242

4343
private:
44-
std::shared_ptr<ObjectType> _query;
44+
std::weak_ptr<ObjectType> _query;
4545
std::shared_ptr<ObjectType> _mutation;
4646
std::shared_ptr<ObjectType> _subscription;
4747
std::unordered_map<std::string, size_t> _typeMap;

0 commit comments

Comments
 (0)