-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observer is null for relaySubscriptionHandler #2855
Comments
It looks like that function expects
Could you please share the full error message and backtrace?
Yes. |
Sure TypeError: source.subscribe is not a function
at new Executor (RelayModernQueryExecutor.js:97)
at Object.execute (RelayModernQueryExecutor.js:48)
at RelayModernEnvironment.js:270
at _subscribe (RelayObservable.js:580)
at RelayObservable.subscribe (RelayObservable.js:281)
at RelayObservable.js:196
at _subscribe (RelayObservable.js:580)
at RelayObservable.subscribe (RelayObservable.js:281)
at RelayObservable.js:293
at _subscribe (RelayObservable.js:580) " Since subscribeFn is passed to ReactRelayNetworkModern it may also be an issue with how this function is handled by this Network Layer The function created by createActionCableHandler seems ok export type SubscribeFunction = (
operation: ConcreteBatch,
variables: Variables,
cacheConfig: CacheConfig,
observer: any
) => RelayObservable<QueryPayload> | Disposable; but observer can't be created with this function's options... |
just came to report this, see also: relay-tools/react-relay-network-modern#95 i'm working on a pr locally as well. |
I've run into this as well. @modosc have you been able to solve this? |
I was having this error too with subscriptionFn in modern relay. The solution was to add a "subscribe"property , with a "dispose" property too, in the object I was returning in my function.
|
Did anyone solve this? I'm having the same problem with the ActionCable subscription handler. Modifying the returned object to have a |
Sorry, I'm not sure if this is still a problem 😖 If you run into this again, please open a new issue and we can investigate again! |
Hi @rmosolgo, currently (if I don't get it terribly wrong),
createRelaySubscriptionHandler
doens't pass an observer to Relay Network layer, resulting in an Uncaught TypeError: Cannot read property 'onNext' of undefinedOffending lines
observer is undefined. Am I doing something wrong? If yes, maybe some additional comments in docs can be helpful (let me know if you accept PR)
Thanks!
graphql
version: 1.10.5rails
(or other framework): 6graphql-batch
version: 0.5.4react-relay
: 9.0.0react-relay-network-modern
: ^4.2.0`We're using intepreters, it happens with any query / subscription
GraphQL query
We use react-relay-network-modern setup as follow:
The text was updated successfully, but these errors were encountered: