Merge branch 'bw-query_graphql_field-enhancement' into 'master'
Allow arrays to be specified for fields in graphql_query_for Closes #60238 See merge request gitlab-org/gitlab-ce!27142
This commit is contained in:
commit
224916f843
2 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,7 @@ describe 'GitlabSchema configurations' do
|
||||||
|
|
||||||
it 'shows an error if complexity is too high' do
|
it 'shows an error if complexity is too high' do
|
||||||
project = create(:project, :repository)
|
project = create(:project, :repository)
|
||||||
query = graphql_query_for('project', { 'fullPath' => project.full_path }, "id\nname\ndescription")
|
query = graphql_query_for('project', { 'fullPath' => project.full_path }, %w(id name description))
|
||||||
|
|
||||||
allow(GitlabSchema).to receive(:max_query_complexity).and_return 1
|
allow(GitlabSchema).to receive(:max_query_complexity).and_return 1
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,8 @@ module GraphqlHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def wrap_fields(fields)
|
def wrap_fields(fields)
|
||||||
return unless fields.strip.present?
|
fields = Array.wrap(fields).join("\n")
|
||||||
|
return unless fields.present?
|
||||||
|
|
||||||
<<~FIELDS
|
<<~FIELDS
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue