spec/support/dummy/schema.rb in graphql-1.7.3 vs spec/support/dummy/schema.rb in graphql-1.7.4
- old
+ new
@@ -358,9 +358,16 @@
c.add_error(GraphQL::ExecutionError.new("Could not fetch latest value"))
return 0
}
end
+ field :executionErrorWithOptions do
+ type GraphQL::INT_TYPE
+ resolve ->(t, a, c) {
+ GraphQL::ExecutionError.new("Permission Denied!", options: { "code" => "permission_denied" })
+ }
+ end
+
# To test possibly-null fields
field :maybeNull, MaybeNullType do
resolve ->(t, a, c) { OpenStruct.new(cheese: nil) }
end