Class: NulogyGraphqlApi::GraphQLError
- Inherits:
-
Object
- Object
- NulogyGraphqlApi::GraphQLError
- Defined in:
- lib/nulogy_graphql_api/graphql_error.rb
Instance Method Summary collapse
- #extensions ⇒ Object
-
#initialize(message, backtrace: nil) ⇒ GraphQLError
constructor
A new instance of GraphQLError.
- #render ⇒ Object
Constructor Details
#initialize(message, backtrace: nil) ⇒ GraphQLError
Returns a new instance of GraphQLError.
3 4 5 6 |
# File 'lib/nulogy_graphql_api/graphql_error.rb', line 3 def initialize(, backtrace: nil) @message = @backtrace = backtrace end |
Instance Method Details
#extensions ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/nulogy_graphql_api/graphql_error.rb', line 15 def extensions if @backtrace { extensions: { backtrace: @backtrace } } else {} end end |
#render ⇒ Object
8 9 10 11 12 13 |
# File 'lib/nulogy_graphql_api/graphql_error.rb', line 8 def render { data: {}, errors: [{ message: @message }.merge(extensions)] } end |