Use double quotes in lib/
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
require 'graphql'
|
||||
require "graphql"
|
||||
|
||||
module GraphQL
|
||||
class ApiTypesCreator
|
||||
@@ -65,7 +65,7 @@ module GraphQL
|
||||
model = api_type_model.constantize
|
||||
fields = {}
|
||||
|
||||
api_type_info['fields'].each do |field_name, field_type|
|
||||
api_type_info["fields"].each do |field_name, field_type|
|
||||
if field_type.is_a?(Array) # paginated association
|
||||
fields[field_name.to_sym] = [field_type.first.constantize]
|
||||
elsif SCALAR_TYPES[field_type.to_sym]
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
require 'graphql'
|
||||
require "graphql"
|
||||
|
||||
module GraphQL
|
||||
class QueryTypeCreator
|
||||
|
||||
def self.create(api_types)
|
||||
GraphQL::ObjectType.define do
|
||||
name 'QueryType'
|
||||
description 'The root query for the schema'
|
||||
name "QueryType"
|
||||
description "The root query for the schema"
|
||||
|
||||
api_types.each do |model, created_type|
|
||||
if created_type.fields['id']
|
||||
if created_type.fields["id"]
|
||||
field model.graphql_field_name do
|
||||
type created_type
|
||||
description model.graphql_field_description
|
||||
argument :id, !types.ID
|
||||
resolve ->(object, arguments, context) { model.public_for_api.find_by(id: arguments['id'])}
|
||||
resolve ->(object, arguments, context) { model.public_for_api.find_by(id: arguments["id"])}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user