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.

ApolloQueryObservable.map does not exist

See original GitHub issue

When creating a new project with the angular cli and importing ApolloQueryObservable. The map function is somehow not available:

this.users = this.apollo.watchQuery<UsersQuery>({
            query: UsersQueryNode,
            variables: {
              id: data.users,
            },
          }).map(result => result.data.users) as any;

The TS compiler says:

Property ‘map’ does not exist on type ‘ApolloQueryObservable<UsersQuery>’.

My dependcies:

 "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@types/node": "^6.0.78",
    "apollo-angular": "^0.13.0",
    "apollo-client": "^1.5.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.1.2",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/language-service": "^4.0.0",
    "@types/jasmine": "2.5.45",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
  }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
Urigocommented, Jun 26, 2017

@davideberlein sure! https://github.com/apollographql/angular-docs/blob/master/source/queries.md#using-with-rxjs (also on each of our doc pages there is a “Edit on Github” button at the bottom)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ApolloQueryObservable.map does not exist #322 - GitHub
When creating a new project with the angular cli and importing ApolloQueryObservable. The map function is somehow not available: this.users ...
Read more >
Subscribing to angular Apollo query observable brings old ...
The problem comes from Apollo's cache. As you're making the same request, it reuses the previous result it got from the request. There...
Read more >
Apollo Angular Version 0.11 – The Guild
We've applied this rule to the service as well, so there is no ... First thing, you need to define a function to...
Read more >
Reading and writing data to the cache - Apollo GraphQL Docs
Any changes you make to cached data with writeQuery are not pushed to your GraphQL server. If you reload your environment, these changes...
Read more >
Handling GraphQL errors like a champ with unions and ...
How would I distinguish a “user does not exist” error from a “user ... You can build some custom function in your client...
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