spec/support/dummy/schema.rb in graphql-1.7.0 vs spec/support/dummy/schema.rb in graphql-1.7.1
- old
+ new
@@ -107,11 +107,11 @@
field :source, !DairyAnimalEnum, "Animal which produced this milk", hash_key: :source
field :origin, !types.String, "Place the milk comes from"
field :flavors, types[types.String], "Chocolate, Strawberry, etc" do
argument :limit, types.Int
resolve ->(milk, args, ctx) {
- args[:limit] ? milk.flavors.first(args[:limit]) : milk.flavors
+ args[:limit] ? milk.flavors.first(args.limit) : milk.flavors
}
end
field :executionError do
type GraphQL::STRING_TYPE
resolve ->(t, a, c) { raise(GraphQL::ExecutionError, "There was an execution error") }
@@ -232,11 +232,11 @@
DeepNonNullType = GraphQL::ObjectType.define do
name "DeepNonNull"
field :nonNullInt, !types.Int do
argument :returning, types.Int
- resolve ->(obj, args, ctx) { args[:returning] }
+ resolve ->(obj, args, ctx) { args.returning }
end
field :deepNonNull, DeepNonNullType.to_non_null_type do
resolve ->(obj, args, ctx) { :deepNonNull }
end
@@ -326,11 +326,11 @@
field :allDairy, types[DairyProductUnion] do
argument :executionErrorAtIndex, types.Int
resolve ->(obj, args, ctx) {
result = CHEESES.values + MILKS.values
- result[args[:executionErrorAtIndex]] = GraphQL::ExecutionError.new("missing dairy") if args[:executionErrorAtIndex]
+ result[args.executionErrorAtIndex] = GraphQL::ExecutionError.new("missing dairy") if args.executionErrorAtIndex
result
}
end
field :allEdible, types[EdibleInterface] do
@@ -382,20 +382,20 @@
description "The root for mutations in this schema"
field :pushValue, !types[!types.Int] do
description("Push a value onto a global array :D")
argument :value, !types.Int, as: :val
resolve ->(o, args, ctx) {
- GLOBAL_VALUES << args[:val]
+ GLOBAL_VALUES << args.val
GLOBAL_VALUES
}
end
field :replaceValues, !types[!types.Int] do
description("Replace the global array with new values")
argument :input, !ReplaceValuesInputType
resolve ->(o, args, ctx) {
GLOBAL_VALUES.clear
- GLOBAL_VALUES.push(*args[:input][:values])
+ GLOBAL_VALUES.push(*args.input[:values])
GLOBAL_VALUES
}
end
end