Cannot read property `replace` of undefined
masiamj opened this issue · 3 comments
Hi all,
This package looks great, and exactly like what I'm looking for; however, I'm having a really tough time getting the implementation right.
Here's a couple key pieces of my implementation:
Do you see anything obvious about why I'd be receiving this error? My bet is it's something trivial, just having a tough time debugging for now.
Thanks for your help!
same here..
Hi there!
Internally, ApolloFragment wraps the fragment string passed in with gql
. So in order for the above to work, drop the gql
and just pass it in as a string.
We could do a check in the library to see if fragment is already a DocumentNode
and omit wrapping gql
internally!
Would love to see that PR!
Also the typename
prop is extracted from the fragment passed in.