public void Write(GraphQLWriter writer) { writer.Write("removeStudent", _meta); bool hasParameters = false; if (_id.HasValue) { if (hasParameters) { writer.Write(", "); } else { hasParameters = true; writer.Write("("); } writer.Write("id: "); writer.WriteValue(_id); } if (hasParameters) { writer.Write(")"); } writer.Write(_meta); writer.WriteLine(" {"); writer.PushIndent(); foreach (var v in _children) { v.Write(writer); } writer.PopIndent(); writer.WriteLine("}"); }
public void Write(GraphQLWriter writer, bool json) { writer.Write("{ "); if (json) { writer.Write("\"id\": "); } else { writer.Write("id: "); } writer.WriteValue(id); if (json) { writer.Write(", "); } if (json) { writer.Write("\"name\": "); } else { writer.Write("name: "); } writer.WriteValue(name); if (json) { writer.Write(", "); } if (json) { writer.Write("\"class_id\": "); } else { writer.Write("class_id: "); } writer.WriteValue(class_id); writer.Write(" }"); }
public void Write(GraphQLWriter writer) { writer.Write("friends", _meta); bool hasParameters = false; if (_first.HasValue) { if (hasParameters) { writer.Write(", "); } else { hasParameters = true; writer.Write("("); } writer.Write("first: "); writer.WriteValue(_first); } if (_after.HasValue) { if (hasParameters) { writer.Write(", "); } else { hasParameters = true; writer.Write("("); } writer.Write("after: "); writer.WriteValue(_after); } if (_last.HasValue) { if (hasParameters) { writer.Write(", "); } else { hasParameters = true; writer.Write("("); } writer.Write("last: "); writer.WriteValue(_last); } if (_before.HasValue) { if (hasParameters) { writer.Write(", "); } else { hasParameters = true; writer.Write("("); } writer.Write("before: "); writer.WriteValue(_before); } if (hasParameters) { writer.Write(")"); } writer.Write(_meta); writer.WriteLine(" {"); writer.PushIndent(); foreach (var v in _children) { v.Write(writer); } writer.PopIndent(); writer.WriteLine("}"); }