Module: GraphQLDocs
- Defined in:
- lib/graphql-docs.rb,
lib/graphql-docs/client.rb,
lib/graphql-docs/parser.rb,
lib/graphql-docs/helpers.rb,
lib/graphql-docs/version.rb,
lib/graphql-docs/renderer.rb,
lib/graphql-docs/generator.rb,
lib/graphql-docs/configuration.rb
Defined Under Namespace
Modules: Configuration, Helpers Classes: Client, Generator, Parser, Renderer
Constant Summary collapse
- VERSION =
'0.4.0'
Class Method Summary collapse
Class Method Details
.build(options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/graphql-docs.rb', line 15 def build() = GraphQLDocs::Configuration::GRAPHQLDOCS_DEFAULTS.merge() if [:url].nil? && [:path].nil? fail ArgumentError, 'No :url or :path provided!' end if ![:url].nil? && ![:path].nil? fail ArgumentError, 'You can\'t pass both :url and :path!' end if [:url] client = GraphQLDocs::Client.new() response = client.fetch else response = File.read([:path]) end parser = GraphQLDocs::Parser.new(response, ) parsed_schema = parser.parse generator = GraphQLDocs::Generator.new(parsed_schema, ) generator.generate end |