DEV Community

Discussion on: Active Storage meets GraphQL Pt. 2: Exposing attachment URLs

Collapse
 
such profile image
Adrien Montfort

Hey thanks a lot for this article! Very instructive.

I have an issue when I try using the FieldExtension. The class of the object I'm getting is the GraphqlObject Type but I'm expecting my ActiveRecord type. I've tried in a regular resolver and it works correctly. Any idea why by any chance?

Collapse
 
such profile image
Adrien Montfort

Apparently you need to use object.object to get the ActiveRecord object! (and object.object.class for its class).

Collapse
 
palkan_tula profile image
Vladimir Dementyev

Which version of graphql gem it is? Probably, that's the reason. The code I posted works fine for us in 1.9.4.

Thread Thread
 
such profile image
Adrien Montfort • Edited

I tried with 1.9.3 and 1.9.6...