Skip to content

Commit

Permalink
Add rake task to dump graphql schema
Browse files Browse the repository at this point in the history
$ rake graphql:dump

The task creates a JSON and IDL dump files.

Also generate the first dump files.
  • Loading branch information
ChristianRimondi committed Jul 12, 2019
1 parent 4555453 commit bd8849a
Show file tree
Hide file tree
Showing 3 changed files with 1,061 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ begin
require 'spree/testing_support/extension_rake'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
require 'graphql/rake_task'

GraphQL::RakeTask.new(schema_name: 'Spree::Graphql::Schema')

RSpec::Core::RakeTask.new(:spec)

Expand All @@ -31,6 +34,17 @@ task :test_app do
Rake::Task['extension:test_app'].invoke
end

namespace :graphql do
desc 'Dumps GraphQL schema as IDL and JSON.'
task :dump do
Rake::Task[:first_run].invoke

require File.expand_path('spec/dummy/config/environment.rb', __dir__)

Rake::Task['graphql:schema:dump'].invoke
end
end

namespace :dev do
desc 'Setup development app'
task :setup do
Expand Down
2 changes: 2 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
type Query {
}
Loading

0 comments on commit bd8849a

Please sign in to comment.