Class: Graphqlmd::Graphqlmd

Inherits:
Object
  • Object
show all
Includes:
Graphqlmd
Defined in:
lib/graphqlmd.rb

Constant Summary

Constants included from Graphqlmd

CLIENT_MUTATION_ID, IGNORED_OBJECT_NAMES, LIST, NON_NULL, SCALAR, SCHEMA_QUERY, VERSION

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Graphqlmd

Returns a new instance of Graphqlmd.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/graphqlmd.rb', line 10

def initialize options
  @url = options[:url]
  @title = options[:title]
  @note = options[:note]
  @is_hide_client_mutation_id = options[:is_hide_client_mutation_id]
  @is_hide_table_of_contents = options[:is_hide_table_of_contents]
  @is_hide_deprecated = options[:is_hide_deprecated]
  @is_hide_scalar = options[:is_hide_scalar]
  @is_allow_links = options[:is_allow_links]
  @is_vuepress = options[:is_vuepress]
  @ignored_queries = options[:ignored_queries]
  @ignored_mutations = options[:ignored_mutations]
  @ignored_objects = options[:ignored_objects]
end

Instance Method Details

#callObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/graphqlmd.rb', line 25

def call
  response = fetch_schema
  data = JSON.parse(response.body).dig 'data', 'schema'

  puts_title
  puts_note
  puts_top_table_of_contents
  puts_queries data['queries']
  puts_mutations data['mutations']
  puts_objects data['types']
end