debian-mirror-gitlab/spec/support/graphql/fake_query_type.rb

23 lines
455 B
Ruby
Raw Normal View History

2021-12-11 22:18:48 +05:30
# frozen_string_literal: true
2022-01-26 12:08:38 +05:30
require 'graphql'
2021-12-11 22:18:48 +05:30
module Graphql
2022-01-26 12:08:38 +05:30
class FakeQueryType < ::GraphQL::Schema::Object
2021-12-11 22:18:48 +05:30
graphql_name 'FakeQuery'
field :hello_world, String, null: true do
argument :message, String, required: false
end
2022-01-26 12:08:38 +05:30
field :breaking_field, String, null: true
2021-12-11 22:18:48 +05:30
def hello_world(message: "world")
"Hello #{message}!"
end
2022-01-26 12:08:38 +05:30
def breaking_field
raise "This field is supposed to break"
end
2021-12-11 22:18:48 +05:30
end
end