-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I am writting graphql server that is compatible with Apollo. I am also using rapidJSON. When handling response I need to copy the JSON response into Apollo transport message. Making writeResponse
function publicly available would allow generation of the response in one go without copying.
auto response=resolve(...);
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
writer.StartObject();
writer.Key("id");
writer.String(gql_ws.id.data());
writer.Key("type");
writer.String("next");
writer.Key("payload");
//copy
auto r=graphql::response::toJSON(std::move(response));
writer.RawValue(r.c_str(), r.size(), rapidjson::kObjectType);
//function not exported
// graphql::response::writeResponse(writer, std::move(response));
writer.EndObject();
return buffer.GetString();
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request