Class: GraphQL::Extras::Test::Response::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/extras/test/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Error

Returns a new instance of Error.



26
27
28
29
30
31
32
# File 'lib/graphql/extras/test/response.rb', line 26

def initialize(payload)
  @message = payload["message"]
  @path = payload["path"]
  @locations = payload["locations"]
  @extensions = payload["extensions"]
  @code = payload.dig("extensions", "code")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



22
23
24
# File 'lib/graphql/extras/test/response.rb', line 22

def code
  @code
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



21
22
23
# File 'lib/graphql/extras/test/response.rb', line 21

def extensions
  @extensions
end

#locationsObject (readonly)

Returns the value of attribute locations.



24
25
26
# File 'lib/graphql/extras/test/response.rb', line 24

def locations
  @locations
end

#messageObject (readonly)

Returns the value of attribute message.



20
21
22
# File 'lib/graphql/extras/test/response.rb', line 20

def message
  @message
end

#pathObject (readonly)

Returns the value of attribute path.



23
24
25
# File 'lib/graphql/extras/test/response.rb', line 23

def path
  @path
end