Wrote specs for GraphQL root resolvers

This commit is contained in:
Alberto Miedes Garcés
2017-01-08 11:37:15 +01:00
parent 0b302c2afc
commit ed6ba384dd
3 changed files with 64 additions and 2 deletions

View File

@@ -8,9 +8,9 @@ module GraphQL
def call(object, arguments, context)
if target_model.respond_to?(:public_for_api)
target_model.public_for_api.find(arguments["id"])
target_model.public_for_api.find_by(id: arguments["id"])
else
target_model.find(arguments["id"])
target_model.find_by(id: arguments["id"])
end
end
end