Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/graphqlservice/GraphQLService.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "internal/DllExports.h"
#include "internal/SortedMap.h"

#include <array>
#include <chrono>
#include <condition_variable>
#include <coroutine>
Expand Down Expand Up @@ -853,7 +854,7 @@ class [[nodiscard("unnecessary construction")]] Object : public std::enable_shar
private:
TypeNames _typeNames;
ResolverMap _resolvers;
std::vector<std::shared_ptr<const Object>> _stitched;
std::array<std::shared_ptr<const Object>, 2> _stitched;
};

// Test if this Type inherits from Object.
Expand Down
10 changes: 4 additions & 6 deletions src/GraphQLService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,17 +1270,15 @@ std::shared_ptr<Object> Object::StitchObject(const std::shared_ptr<const Object>
hasStitchedResolvers = resolvers.emplace(name, resolver).second || hasStitchedResolvers;
}

std::vector<std::shared_ptr<const Object>> stitched { shared_from_this() };
auto object = std::make_shared<Object>(std::move(typeNames), std::move(resolvers));

object->_stitched[0] = shared_from_this();

if (hasStitchedResolvers)
{
stitched.push_back(added);
object->_stitched[1] = added;
}

auto object = std::make_shared<Object>(std::move(typeNames), std::move(resolvers));

object->_stitched = std::move(stitched);

return object;
}

Expand Down