Class: GraphqlRails::DumpGraphqlSchemas
- Inherits:
-
Object
- Object
- GraphqlRails::DumpGraphqlSchemas
- Defined in:
- lib/graphql_rails/tasks/dump_graphql_schemas.rb
Overview
Generates graphql schema dump files
Defined Under Namespace
Classes: MissingGraphqlRouterError
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(dump_dir:, groups: nil) ⇒ DumpGraphqlSchemas
constructor
A new instance of DumpGraphqlSchemas.
Constructor Details
#initialize(dump_dir:, groups: nil) ⇒ DumpGraphqlSchemas
Returns a new instance of DumpGraphqlSchemas.
16 17 18 19 |
# File 'lib/graphql_rails/tasks/dump_graphql_schemas.rb', line 16 def initialize(dump_dir:, groups: nil) @groups = groups.presence @dump_dir = dump_dir end |
Class Method Details
.call(**args) ⇒ Object
12 13 14 |
# File 'lib/graphql_rails/tasks/dump_graphql_schemas.rb', line 12 def self.call(**args) new(**args).call end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 |
# File 'lib/graphql_rails/tasks/dump_graphql_schemas.rb', line 21 def call validate return dump_default_schema if groups.empty? groups.each { |group| dump_graphql_schema(group) } end |