graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

What about extensions?

Open resistorsoftware opened this issue 6 years ago • 0 comments

I have a successful query I execute as:

result = Fizz::Client.query(ShopNameQuery)

I dump out result.data.shop.name and I get "fooblewoobles" which is correct.

When I reach out to the extensions, which are loaded with cost information on the call like this:

"extensions"=>{"cost"=>{"requestedQueryCost"=>1, "actualQueryCost"=>1, "throttleStatus"=>{"maximumAvailable"=>1000.0, "currentlyAvailable"=>999, "restoreRate"=>50.0}}

I get missing method error for cost. So I am left with having to use the hash keys:

result.extensions['cost']['requestedQueryCost'] 

instead of

result.extensions.cost.requestedQueryCost

Is that the expected and normal way the client works?

resistorsoftware avatar Dec 14 '18 18:12 resistorsoftware