msgraph-sdk-ruby
msgraph-sdk-ruby copied to clipboard
Support for $top and $skip
Is there a reason that there is lack of support of skip and top parameters? I am guessing it could be overriden with next_link parameters, but providing that ability would be nice.
Also I see that the code doesn't support filtering and ordering at the same time. Is that intentional ? I don't understand why that is, given the lack of documentation.
@rishav Unfortunately these shortcomings are mostly due to lack of resources available to work on our Ruby SDK. Our developers are currently prioritized elsewhere.
@darrelmiller thanks for the response. Would it be cool if we helped out ? My team and I are definitely considering using this gem and that might mean adding a few features that we need. We might need some minor support in terms answering some architectural / design / product related questions
@rishav Absolutely, we welcome community assistance. We are currently doing some architectural re-alignment to try and bring a bit more flexibility into the SDKs. I have been starting to collect together architectural and design requirements for all the SDKs here https://GitHub.com/microsoftgraph/msgraph-sdk-design
@rishav have you done some work on your side to get top/skip parameters passed?
@rishav and @kamaradclimber I had success applying the following MonkeyPatch to the gem in my project:
module MicrosoftGraphExtensions
module CollectionAssociation
def all(page_size = 500)
@page_size = page_size
to_a
end
MicrosoftGraph::CollectionAssociation.send(:alias_method, :original_query_path, :query_path)
def query_path
path = original_query_path
if @page_size.present?
path += path.include?('?') ? '&' : '?'
path += "$top=#{@page_size}"
end
path
end
# Note, removing maximum of 1000 from original line: @loaded || @internal_values.size >= 1000
def last?
@loaded
end
end
end
class MicrosoftGraph
class CollectionAssociation
prepend MicrosoftGraphExtensions::CollectionAssociation
end
end