Class: GraphqlRails::DumpGraphqlSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql_rails/tasks/dump_graphql_schema.rb

Overview

Generates graphql schema dump files

Defined Under Namespace

Classes: MissingGraphqlRouterError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group:, router:, dump_dir: nil) ⇒ DumpGraphqlSchema

Returns a new instance of DumpGraphqlSchema.



14
15
16
17
18
# File 'lib/graphql_rails/tasks/dump_graphql_schema.rb', line 14

def initialize(group:, router:, dump_dir: nil)
  @group = group
  @router = router
  @dump_dir = dump_dir
end

Class Method Details

.call(**args) ⇒ Object



10
11
12
# File 'lib/graphql_rails/tasks/dump_graphql_schema.rb', line 10

def self.call(**args)
  new(**args).call
end

Instance Method Details

#callObject



20
21
22
# File 'lib/graphql_rails/tasks/dump_graphql_schema.rb', line 20

def call
  File.write(schema_path, schema_dump)
end