Class: GraphQL::Client::Response
- Inherits:
-
Object
- Object
- GraphQL::Client::Response
- Defined in:
- lib/graphql/client/response.rb
Overview
Public: Abstract base class for GraphQL responses.
https://facebook.github.io/graphql/#sec-Response-Format
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Public: Wrapped QueryResult of data returned from the server.
-
#errors ⇒ Object
readonly
Public: Get partial failures from response.
-
#extensions ⇒ Object
readonly
Public: Hash of server specific extension metadata.
Instance Method Summary collapse
-
#initialize(data: nil, errors: Errors.new, extensions: {}) ⇒ Response
constructor
Internal: Initialize base class.
Constructor Details
permalink #initialize(data: nil, errors: Errors.new, extensions: {}) ⇒ Response
Internal: Initialize base class.
28 29 30 31 32 |
# File 'lib/graphql/client/response.rb', line 28 def initialize(data: nil, errors: Errors.new, extensions: {}) @data = data @errors = errors @extensions = extensions end |
Instance Attribute Details
permalink #data ⇒ Object (readonly)
Public: Wrapped QueryResult of data returned from the server.
https://facebook.github.io/graphql/#sec-Data
Returns instance of QueryResult subclass.
15 16 17 |
# File 'lib/graphql/client/response.rb', line 15 def data @data end |
permalink #errors ⇒ Object (readonly)
Public: Get partial failures from response.
https://facebook.github.io/graphql/#sec-Errors
Returns Errors collection object with zero or more errors.
22 23 24 |
# File 'lib/graphql/client/response.rb', line 22 def errors @errors end |
permalink #extensions ⇒ Object (readonly)
Public: Hash of server specific extension metadata.
25 26 27 |
# File 'lib/graphql/client/response.rb', line 25 def extensions @extensions end |