graphiti-api/spraypaint.js

Nested includes don't work for return scopes

Opened this issue · 0 comments

const bazScope = Baz.selectExtra(['baz_optional_field']);

const returnScope = Foo.selectExtra(['foo_optional_field']).includes(['foo_sideload']).
  merge({bars: Bar.merge({ baz_sideload: bazScope }).includes(['bar_sideload']});
parent.save({ returnScope });

This will call a PATCH URL like /parents?extra_fields[foos]=foo_optional_field&extra_fields[bazes]=baz_optional_field&include=foo_sideload

As you can see the extra_fields all gets constructed correctly, but the include only has the Foo sideloads and not the nested Bar sideloads.