Sha256: 39aa21f9df8ce32fbb942618676a31987c043be1022191a2301b50ea7b426d81

Contents?: true

Size: 407 Bytes

Versions: 20

Compression:

Stored size: 407 Bytes

Contents

module NulogyGraphqlApi
  class GraphQLError
    def initialize(message, backtrace: nil)
      @message = message
      @backtrace = backtrace
    end

    def render
      {
        data: {},
        errors: [{ message: @message }.merge(extensions)]
      }
    end

    def extensions
      if @backtrace
        { extensions: { backtrace: @backtrace } }
      else
        {}
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
nulogy_graphql_api-4.3.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-4.2.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-4.1.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-4.0.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-3.0.1 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.2.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.1.3 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.1.2 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.1.1 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.1.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.0.1 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-2.0.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-1.1.1 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-1.1.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-1.0.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-0.6.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-0.5.3 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-0.5.1 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-0.5.0 lib/nulogy_graphql_api/graphql_error.rb
nulogy_graphql_api-0.4.0 lib/nulogy_graphql_api/graphql_error.rb