Proposal, Debate and Comment "globalize_accessors" class method were loaded before application available locales initialization because of graphql initializer. This will cause unexpected translation errors at any translatable classes declared at graphql api definition (api.yml). Doing GraphQL initialization after application initialization should solve this issue.
12 lines
317 B
Ruby
12 lines
317 B
Ruby
module GraphQLApi
|
|
class Loader
|
|
def self.setup
|
|
if ActiveRecord::Base.connection.tables.any?
|
|
api_config = YAML.load_file("./config/api.yml")
|
|
GraphqlController.const_set "API_TYPE_DEFINITIONS",
|
|
GraphQL::ApiTypesCreator::parse_api_config_file(api_config)
|
|
end
|
|
end
|
|
end
|
|
end
|