diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-26 18:31:05 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-04 10:53:39 +0200 |
commit | 04b046587fe609cd889f3fa518f08299abc61267 (patch) | |
tree | 634fc7d5e2a416950868700a82c171ff4f54239b /app/graphql/resolvers/merge_request_pipelines_resolver.rb | |
parent | cd5789415b6e561564073693243e890e79596ed2 (diff) | |
download | gitlab-ce-04b046587fe609cd889f3fa518f08299abc61267.tar.gz |
Add pipeline lists to GraphQL
This adds Keyset pagination to GraphQL lists. PoC for that is
pipelines on merge requests and projects.
When paginating a list, the base-64 encoded id of the ordering
field (in most cases the primary key) can be passed in the `before` or
`after` GraphQL argument.
Diffstat (limited to 'app/graphql/resolvers/merge_request_pipelines_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/merge_request_pipelines_resolver.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/graphql/resolvers/merge_request_pipelines_resolver.rb b/app/graphql/resolvers/merge_request_pipelines_resolver.rb new file mode 100644 index 00000000000..00b51ee1381 --- /dev/null +++ b/app/graphql/resolvers/merge_request_pipelines_resolver.rb @@ -0,0 +1,16 @@ +module Resolvers + class MergeRequestPipelinesResolver < BaseResolver + include ::ResolvesPipelines + + alias_method :merge_request, :object + + def resolve(**args) + resolve_pipelines(project, args) + .merge(merge_request.all_pipelines) + end + + def project + merge_request.source_project + end + end +end |