Skip to content

Commit

Permalink
Reorganize modules to work with RDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Jan 31, 2024
1 parent 79e6d4e commit 64e12ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/graphql/testing/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ module Helpers
# @param schema_class [Class<GraphQL::Schema>]
# @return [Module] A helpers module which always uses the given schema
def self.for(schema_class)
Module.new do
include SchemaHelpers
@@schema_class_for_helpers = schema_class
end
SchemaHelpers.for(schema_class)
end

class Error < GraphQL::Error
Expand Down Expand Up @@ -119,6 +116,13 @@ def with_resolution_context(*args, **kwargs, &block)
# schema will be added later
super(nil, *args, **kwargs, &block)
end

def self.for(schema_class)
Module.new do
include SchemaHelpers
@@schema_class_for_helpers = schema_class
end
end
end
end
end
Expand Down

0 comments on commit 64e12ff

Please sign in to comment.