Skip to content

Commit

Permalink
Update how Schema::Field yields definition_block
Browse files Browse the repository at this point in the history
Previously this used `instance_exec` which sets `self` to the field
instance.

This changes to `yield` which still yields the field instance
(supporting the same functionality) but doesn't change `self`.
  • Loading branch information
swalkinshaw committed Sep 7, 2018
1 parent 3777475 commit 2d48ac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/graphql/schema/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def initialize(type: nil, name: nil, owner: nil, null: nil, field: nil, function

if definition_block
if definition_block.arity == 1
instance_exec(self, &definition_block)
yield self
else
instance_eval(&definition_block)
end
Expand Down

0 comments on commit 2d48ac3

Please sign in to comment.