Skip to content
Open
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
1 change: 0 additions & 1 deletion .editorconfig

This file was deleted.

11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_style = space
indent_size = 4
27 changes: 26 additions & 1 deletion csharp/Platform.Data.Doublets.Gql.Schema/LinksMutation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,32 @@ public static Links InsertLink(object service, Links links)
public static Links InsertLink(object service, LinksInsert linksInsert)
{
var link = (ILinks<ulong>)service;
var create = link.GetOrCreate((ulong)(linksInsert.from_id ?? 0), (ulong)(linksInsert.to_id ?? 0));

// Handle nested 'from' object
ulong fromId = 0;
if (linksInsert.from?.data != null)
{
var fromLink = InsertLink(service, linksInsert.from.data);
fromId = (ulong)fromLink.id;
}
else if (linksInsert.from_id.HasValue)
{
fromId = (ulong)linksInsert.from_id.Value;
}

// Handle nested 'to' object
ulong toId = 0;
if (linksInsert.to?.data != null)
{
var toLink = InsertLink(service, linksInsert.to.data);
toId = (ulong)toLink.id;
}
else if (linksInsert.to_id.HasValue)
{
toId = (ulong)linksInsert.to_id.Value;
}

var create = link.GetOrCreate(fromId, toId);
return LinksType.GetLinkOrDefault(service, (long)create);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class LinksObjRelInsert
{
public LinksObjRelInsert data { get; set; }
public LinksInsert data { get; set; }

public LinksOnConflict on_conflict { get; set; }
}
Expand Down