Sha256: 9745845ad3b6548aab9d97256394952c88cf856e2cedbcf2e295dd658606935e
Contents?: true
Size: 496 Bytes
Versions: 1
Compression:
Stored size: 496 Bytes
Contents
# frozen_string_literal: true module GraphQL module Client class Response attr_reader :body, :data, :errors, :extensions def initialize(response_body) response = JSON.parse(response_body) data, errors, extensions = response.values_at('data', 'errors', 'extensions') raise ResponseError, errors if !data && errors @body = response @data = data @errors = errors.to_a @extensions = extensions end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
graphql_client-0.4.1 | lib/graphql_client/response.rb |