Class: Graphlient::Schema
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Graphlient::Schema
- Defined in:
- lib/graphlient/schema.rb
Defined Under Namespace
Classes: MissingConfigurationError
Constant Summary collapse
- PATH_ERROR_MESSAGE =
'schema_path is missing. Please add it like this: `Graphlient.new(url, schema_path: YOUR_PATH)`'.freeze
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #dump! ⇒ Object
-
#initialize(http, path) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(http, path) ⇒ Schema
Returns a new instance of Schema.
13 14 15 16 17 18 19 |
# File 'lib/graphlient/schema.rb', line 13 def initialize(http, path) schema_source = path || http super(GraphQL::Client.load_schema(schema_source)) @path = path @http = http end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
11 12 13 |
# File 'lib/graphlient/schema.rb', line 11 def http @http end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/graphlient/schema.rb', line 11 def path @path end |
Instance Method Details
#dump! ⇒ Object
21 22 23 24 |
# File 'lib/graphlient/schema.rb', line 21 def dump! raise MissingConfigurationError, PATH_ERROR_MESSAGE unless path GraphQL::Client.dump_schema(http, path) end |