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.

Export persisted-queries is not available in apollo-angular 2.0.4

See original GitHub issue

Describe the bug

I use lastest version 2.0.4. I try use persited queries as is described in documentation here:

https://apollo-angular.com/docs/recipes/automatic-persisted-queries

or:

https://github.com/kamilkisiela/apollo-angular/blob/86af0c1a2556f38d80a5c90941aee933baee6c0c/website/docs/recipes/automatic-persisted-queries.md

Seems like export for persisted queries is not available import { createPersistedQueryLink } from 'apollo-angular/persisted-queries';

Environment:

  • @apollo/client: 3.2.5
  • apollo-angular: 2.0.4
  • graphql: 14.7.0
  • @angular/core: 10.1.4
  • @angular/cli: 10.1.4
  • typescript: 4.0.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilkisielacommented, Nov 5, 2020
0reactions
yringlercommented, Dec 21, 2020

Hmm… @kamilkisiela, I can only get this working if I use the default createhttplink, not with angular apollos link. thoughts?

const uri = 'https://strapi.yrtestingdomainfor.info/graphql';

export function createApollo(httpLink: HttpLink): ApolloClientOptions<any> {
  const link = ApolloLink.from([
    createPersistedQueryLink({ useGETForHashedQueries: true }) as any,
    createHttpLink({ uri })
  ]);

  const persisted = createPersistedQueryLink();
  const http = httpLink.create({
    uri,
  });

  const angularLink = persisted.concat(http);

  return {
    // This gets me posts, using the link variable uses get
    link: angularLink,
    cache: new InMemoryCache(),
    defaultOptions: {
      watchQuery: {
        notifyOnNetworkStatusChange: true
      }
    }
  };
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic Persisted Queries – Angular
This library is just a simple wrapper of @apollo/client/link/persisted-queries to make it work in Angular with apollo-angular/http (also with ...
Read more >
Angular NativeScript apollo-angular has no export member ...
I'm very new to GraphQL and tried to use it with NativeScript Angular Project but as I install apollo- ...
Read more >
Apollo Angular Persisted Queries (forked) - StackBlitz
Posts and Authors - new Apollo Angular GraphiQL: ... https://github.com/kamilkisiela/apollo-angular-introduction. ... export class AppComponent {}.
Read more >
apollo-angular: Versions - Openbase
Add missing apollo-angular/persisted-queries and apollo-angular/testing ... 2.0.4. 2 years ago. Fix v2 migration: default export ( ApolloClient ) of apollo- ...
Read more >
aws-appsync-auth-link v3.0.7 - npm.io
This SDK can be used with the Apollo JavaScript client found here. Please log questions for this client SDK in this repo and...
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