With version 1.1.0 we are now receiving this error:
TypeError: Object(...) is not a function
at new QueryRef (QueryRef.js:6)
at ApolloBase.watchQuery (Apollo.js:30)
When running watch query.
this.apollo.watchQuery
This was working in 1.0.1
What versions are you running? Angular, TS etc
Here's some of my package.json that might be relevant:
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"typescript": "2.4.2",
"apollo-angular": "^1.1.0",
"apollo-angular-link-http": "^1.0.2",
"apollo-cache-inmemory": "^1.1.4",
"apollo-client": "^2.2.8",
"apollo-link": "^1.2.2",
"apollo-link-error": "^1.0.9",
"graphql": "^0.13.0",
"graphql-tag": "^2.6.1",
"graphql-tools": "^2.14.1",
I'm seeing this issue as well...
Looks like apollo-angular 1.1.0 is requiring angular 6. I'm having issues converting to 6 right now so I don't know if that will fix this issue but that might be worth a shot. I'll update if I get it working.
Update:
Looks like updating to Angular 6 fixed the issue. Don't forget you'll need to update rxjs and typescript as well.
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.0.0",
"typescript": "~2.7.2"
Having this issue as well. Upgrading to angular 6 is not an option for me. If angular 6 is required, shouldn't the version bump be a major?
Yes, it should. For now Apollo 1.0.X for Angular 5 and less, Apollo 1.X for Angular 6+.
Most helpful comment
Update:
Looks like updating to Angular 6 fixed the issue. Don't forget you'll need to update rxjs and typescript as well.