lib/generators/artemis/query/query_generator.rb in artemis-0.5.2 vs lib/generators/artemis/query/query_generator.rb in artemis-0.6.0
- old
+ new
@@ -12,20 +12,28 @@
def generate_query_file
template "query.graphql", graphql_file_path
end
+ # def generate_text_fixture_file
+ # template "fixture.yml", text_fixture_path
+ # end
+
private
def query_name
query_type.underscore
end
def graphql_file_path
- "app/operations/#{service_name.underscore}/#{graphql_file_name.presence || query_name}.graphql"
+ "app/operations/#{service_name.underscore}/#{qualified_name}.graphql"
end
+ def text_fixture_path
+ File.join(Artemis::Railtie.config.artemis.fixture_path, service_name.underscore, "#{qualified_name}.yml")
+ end
+
def arguments
target_query.arguments
end
def target_query
@@ -46,7 +54,11 @@
else
fail "Please specify a service name (available services: #{services.join(", ")}):\n\n" \
" rails g artemis:query #{query_type} #{graphql_file_name} --service SERVICE"
end
end
+ end
+
+ def qualified_name
+ graphql_file_name.presence || query_name
end
end