question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v3] getMainDefinition is not exposed

See original GitHub issue

getMainDefinition utility function is not exposed from @apollo/client. As a result, the examples on your doc are inaccurate 😕 https://www.apollographql.com/docs/react/data/subscriptions/#client-setup

Intended outcome: import { getMainDefinition } from '@apollo/client'; should work

Actual outcome: But import { getMainDefinition } from '@apollo/client'; throw this error Module ... has no exported member 'getMainDefinition'.

Version 3.0.0-beta.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
dunatroncommented, Feb 14, 2020
import { getMainDefinition } from '@apollo/client/utilities';
1reaction
benjamncommented, Dec 13, 2019

@hwillson This looks like something that could be enabled by exposing the @apollo/client/utilities entry point we talked about, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Subscriptions - Apollo GraphQL Docs
In the majority of cases, your client should not use subscriptions to stay up to date ... import { getMainDefinition } from '@apollo/client/utilities';....
Read more >
Apollo GraphQL subscriptions is not working in Vuejs
I push all server side and client side code to server but subscription is not working there. I am using AWS server. Everything...
Read more >
The Ultimate Guide to handling JWTs on frontend clients ...
JWTs are a popular way of handling auth. Learn what a JWT is, its pros/cons & the best practices in implementing JWT on...
Read more >
Building Web Application with React + Apollo Client + ...
Not to mention, the resources found on the web are also very limited on this ... GraphQL Server has to be coded, programmed,...
Read more >
Apollo GraphQL Custom Directives - E.Y. - Medium
There are 3 default directives specified in the GraphQL ... They are implemented inside the server and not exposed to the end user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found