graphlient icon indicating copy to clipboard operation
graphlient copied to clipboard

client.schema is a Graphlient::Schema

Open mxdavis opened this issue 7 years ago • 7 comments

Hi,

Not sure if this is the right place for this. This is my second time using graphlient, and the first I did not have this problem.

Right now my expect(client.schema).to be_a GraphQL::Schema doesn't pass, but expect(client.schema).to be_a Graphlient::Schema does.

This is my client:

let(:client) do
    Graphlient::Client.new('https://www.example.org/graphql') do |client|
      client.http do |h|
        h.connection do |c|
          c.use Faraday::Adapter::Rack, app
        end
      end
    end
  end

Thanks very much.

mxdavis avatar May 09 '18 20:05 mxdavis

This changed in 3.0.1, https://github.com/ashkan18/graphlient/commit/eff5e927ba1c4e0d720f6d7925519da72a73bf8f. Where/how is this an issue for you?

dblock avatar May 10 '18 15:05 dblock

Oh I think this is documented wrong, care to update the README? The Graphlient::Schema class delegates everything to a GraphQL::Schema I believe so they effectively act the same, but one does't inherit from the other.

dblock avatar May 10 '18 15:05 dblock

cc: @povilasjurcys

dblock avatar May 10 '18 15:05 dblock

@mxdavis As a general testing advice, I would suggest testing interfaces (duck typing) rather than checking the class.

yuki24 avatar May 10 '18 15:05 yuki24

Ok cool, the other testing was working so I'll go with that. Thanks so much for your speedy responses

mxdavis avatar May 17 '18 16:05 mxdavis

See #45 that fixes the related test. Not sure how this slipped in.

dblock avatar May 17 '18 18:05 dblock

Closing via #45

dblock avatar May 17 '18 20:05 dblock