Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-29 18:11:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-29 18:11:56 +0300
commit37066217ce3827f60baac3669d07318da74aa36a (patch)
tree2063919e687b7e2f423bebd04f9e510c4db230e8 /spec/support/graphql
parent27f6da0ab2b8f1945a78709c7b5d540a6cc400fd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/graphql')
-rw-r--r--spec/support/graphql/fake_query_type.rb15
-rw-r--r--spec/support/graphql/fake_tracer.rb15
2 files changed, 30 insertions, 0 deletions
diff --git a/spec/support/graphql/fake_query_type.rb b/spec/support/graphql/fake_query_type.rb
new file mode 100644
index 00000000000..ffd851a6e6a
--- /dev/null
+++ b/spec/support/graphql/fake_query_type.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Graphql
+ class FakeQueryType < Types::BaseObject
+ graphql_name 'FakeQuery'
+
+ field :hello_world, String, null: true do
+ argument :message, String, required: false
+ end
+
+ def hello_world(message: "world")
+ "Hello #{message}!"
+ end
+ end
+end
diff --git a/spec/support/graphql/fake_tracer.rb b/spec/support/graphql/fake_tracer.rb
new file mode 100644
index 00000000000..c2fb7ed12d8
--- /dev/null
+++ b/spec/support/graphql/fake_tracer.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Graphql
+ class FakeTracer
+ def initialize(trace_callback)
+ @trace_callback = trace_callback
+ end
+
+ def trace(*args)
+ @trace_callback.call(*args)
+
+ yield
+ end
+ end
+end