Commit Graph

101 Commits

Author SHA1 Message Date
GitLab Bot 6e320396b2 Add latest changes from gitlab-org/gitlab@master 2020-10-26 12:08:44 +00:00
GitLab Bot 79c7e23671 Add latest changes from gitlab-org/gitlab@master 2020-10-14 03:08:32 +00:00
GitLab Bot 1ca6880aac Add latest changes from gitlab-org/gitlab@master 2020-10-06 18:08:49 +00:00
GitLab Bot 6717550536 Add latest changes from gitlab-org/gitlab@master 2020-10-06 00:09:01 +00:00
GitLab Bot d57e27ef35 Add latest changes from gitlab-org/gitlab@master 2020-10-01 15:10:05 +00:00
GitLab Bot 4b9ace6c1f Add latest changes from gitlab-org/gitlab@master 2020-09-02 09:10:23 +00:00
GitLab Bot ee936c190e Add latest changes from gitlab-org/gitlab@master 2020-06-12 00:08:47 +00:00
GitLab Bot eea1fbf9f9 Add latest changes from gitlab-org/gitlab@master 2020-06-02 15:08:24 +00:00
GitLab Bot 6985123d92 Add latest changes from gitlab-org/gitlab@master 2020-05-28 00:08:37 +00:00
GitLab Bot 21539fe9ab Add latest changes from gitlab-org/gitlab@master 2020-05-22 00:08:07 +00:00
GitLab Bot 34e72e5412 Add latest changes from gitlab-org/gitlab@master 2020-05-21 18:08:27 +00:00
GitLab Bot cfc6fe5100 Add latest changes from gitlab-org/gitlab@master 2020-04-24 21:09:48 +00:00
GitLab Bot f6cdec670b Add latest changes from gitlab-org/gitlab@master 2020-04-08 06:09:54 +00:00
GitLab Bot e2ee1eec50 Add latest changes from gitlab-org/gitlab@master 2020-04-08 03:09:31 +00:00
GitLab Bot 5bfb8d1fad Add latest changes from gitlab-org/gitlab@master 2020-03-18 18:09:35 +00:00
GitLab Bot 286fe61013 Add latest changes from gitlab-org/gitlab@master 2020-03-13 12:09:22 +00:00
GitLab Bot 20d564f106 Add latest changes from gitlab-org/gitlab@master 2020-02-05 12:09:15 +00:00
GitLab Bot c8f773a859 Add latest changes from gitlab-org/gitlab@master 2020-01-30 21:08:47 +00:00
GitLab Bot d65442b1d9 Add latest changes from gitlab-org/gitlab@master 2020-01-23 00:08:53 +00:00
GitLab Bot b6ec12ceca Add latest changes from gitlab-org/gitlab@master 2020-01-22 21:08:48 +00:00
GitLab Bot e0b84f4ba4 Add latest changes from gitlab-org/gitlab@master 2020-01-08 21:08:08 +00:00
GitLab Bot 7aada820a9 Add latest changes from gitlab-org/gitlab@master 2019-11-21 18:06:26 +00:00
GitLab Bot 3fc9a8e695 Add latest changes from gitlab-org/gitlab@master 2019-11-15 12:06:12 +00:00
charlieablett d08a78f4b0 Allow tests to ignore recursion 2019-10-23 15:35:33 +13:00
charlieablett 32cdfb9535 Check for recursion and fail if too recursive
- List all overly-recursive fields
- Reduce recursion threshold to 2
- Add test for not-recursive-enough query
- Use reusable methods in tests
- Add changelog
- Set changeable acceptable recursion level
- Add error check test helpers
2019-10-23 15:35:33 +13:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Brett Walker aa7b1cfc5b Upgrade GraphQL gem to 1.8.17
- Due to https://github.com/exAspArk/batch-loader/pull/32,
we  changed BatchLoader.for into BatchLoader::GraphQL.for
- since our results are wrapped in a BatchLoader::GraphQL,
calling `sync` during authorization is required to get real object
- `graphql` now has it's own authorization system.  Our
`authorized?` method conflicted and required renaming
2019-09-04 17:42:48 +00:00
Alex Kalderimis 8738a83390 Improves the graphql_helpers used in GraphQL tests
This improves the graphql test helpers, failing earlier and more
explicitly.
2019-07-30 11:15:52 -04:00
Thong Kuah f0391c2517 Add frozen_string_literal to spec/support
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-25 17:33:34 +12:00
Luke Duncalfe a00a23ca82 GraphQL mutations for managing Notes
https://gitlab.com/gitlab-org/gitlab-ce/issues/62826
2019-07-10 12:13:47 +12:00
Luke Duncalfe 4b9b2a43d0 GraphQL mutations for add, remove and toggle emoji
Adding new `AddAwardEmoji`, `RemoveAwardEmoji` and `ToggleAwardEmoji`
GraphQL mutations.

Adding new `#authorized_find_with_pre_checks!` and (unused, but for
completeness `#authorized_find_with_post_checks!`) authorization
methods. These allow us to perform an authorized find, and run our own
additional checks before or after the authorization runs.

https://gitlab.com/gitlab-org/gitlab-ce/issues/62826
2019-06-28 12:03:33 +12:00
Patrick Derichs 453a9b298c Add task count and completed count to graphql types
Add specs for task completion status (graphql)

Fix style issues

Changed format of constants in spec

Refactor specs to reduce creation of records

Reduce parameters to merge request creation

Use set's for project and user

Move let's out of it_behaves_like block

Fix description parameter

Fix format of lets

Use dig to get task completion status out of graphql response

Modified rspec output

Add changelog entry
2019-06-15 06:56:28 +02:00
Phil Hughes 11f85ae8c3 Enables GraphQL batch requests
Enabling GraphQL batch requests allows for multiple queries
to be sent in 1 request reducing the amount of requests
we send to the server.

Responses come come back in the same order as the queries were
provided.
2019-05-28 10:22:02 +02:00
Bob Van Landuyt 0b27841fd6 Eager load the GraphQL schema in specs
Avoid counting on Rails eager loading the GraphQL types, but preload
them before the specs.

This would avoid loading the schema in 2 separate threads
concurrently (1 inside the specs, 1 inside the test-server that will
receive requests). Loading the schema in parallel like that could
cause duplicate definition errors.
2019-05-10 12:52:19 -05:00
Ken Ding f80f68d520 58404 - setup max depth for graphql
58404 - add change log


58404 - add spec


58404 - add more spec to test depth 2


58404 - fix spec


58404 - fix rubocop


58404 - refactor the code by Bob's advice


58404 - revert changes of all_graphql_fields_for


58404 - change text only


58404 - fix rspec according to gitlab's standard


58404 - revert previous spec


58404 - fix rubocop
2019-05-07 00:32:29 +09:30
Bob Van Landuyt 33cf8edae1 Port changes for design management to CE
This ports the changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10462/
to CE
2019-04-29 08:28:43 +02:00
Brett Walker 2c98d6eef1 Allow arrays to specify fields graphql_query_for 2019-04-11 11:32:13 -05:00
Brett Walker f458c56107 Initial field and query complexity limits
It makes all Types::BaseField default to a complexity of 1.

Queries themselves now have limited complexity, scaled
to the type of user: no user, authenticated user, or an
admin user.
2019-04-04 08:39:30 -05:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
Bob Van Landuyt ee4ba6ce38 Adjust GraphQL helper to query empty fields
These adjustments make sure our GraphQL helpers support rendering
queries for empty fields like this:

      {
        echo(text: "Hello world")
      }

Instead of like this:

     {
       echo(text: "Hello world") {
       }
     }

The latter would be an invalid query, causing parsing errors.
2019-03-06 15:35:30 +01:00
Nick Thomas 21779d0018
Add metadata about the GitLab server to GraphQL 2019-03-05 15:00:32 +00:00
Lin Jen-Shin 91e9e50a11 Add field mergeRequests for project in GraphQL
And fix the tests so that it won't run into circular paths.
2019-02-14 15:52:17 +08:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Jasper Maes bf73520079 convert specs in javascripts/ and support/ to new syntax 2018-12-21 10:10:26 +01:00
Bob Van Landuyt 3bcb04f100 Add mutation toggling WIP state of merge requests
This is mainly the setup of mutations for GraphQL. Including
authorization and basic return type-structure.
2018-07-25 18:37:12 +02:00
Bob Van Landuyt 04b046587f 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.
2018-07-04 10:53:39 +02:00
Bob Van Landuyt 9403b1d951 Allow querying a single MR within a project
This allows the user to get a single MR nested in a GraphQL project
query.

Since we need the full path and the iid anyway, this makes more sense
than having a root query that needs the full path as well.
2018-06-15 14:38:32 +02:00
Bob Van Landuyt 9b65d4bb41 Initial setup GraphQL using graphql-ruby 1.8
- All definitions have been replaced by classes:
  http://graphql-ruby.org/schema/class_based_api.html
- Authorization & Presentation have been refactored to work in the
  class based system
- Loaders have been replaced by resolvers
- Times are now coersed as ISO 8601
2018-06-06 10:58:54 +02:00
Bob Van Landuyt aa4b1ae712 Add `present_using` to types
By specifying a presenter for the object type, we can keep the logic
out of `GitlabSchema`.

The presenter gets initialized using the object being presented, and
the context (including the `current_user`).
2018-06-05 20:47:42 +02:00
Nick Thomas 287c34ca1f Convert from GraphQL::Batch to BatchLoader 2018-06-05 20:47:42 +02:00
Nick Thomas 9c6c17cbcd Add a minimal GraphQL API 2018-06-05 20:47:42 +02:00