apollo-angular
Version:
Use your GraphQL data in your Angular app, with the Apollo Client
24 lines (20 loc) • 812 B
JavaScript
import { ApolloLink } from '@apollo/client/link';
import { SetContextLink } from '@apollo/client/link/context';
import { PersistedQueryLink } from '@apollo/client/link/persisted-queries';
const transformLink = new SetContextLink(context => {
const ctx = {};
if (context.http) {
ctx.includeQuery = context.http.includeQuery;
ctx.includeExtensions = context.http.includeExtensions;
}
if (context.fetchOptions && context.fetchOptions.method) {
ctx.method = context.fetchOptions.method;
}
return ctx;
});
const createPersistedQueryLink = (options) => ApolloLink.from([new PersistedQueryLink(options), transformLink]);
/**
* Generated bundle index. Do not edit.
*/
export { createPersistedQueryLink };
//# sourceMappingURL=apollo-angular-persisted-queries.mjs.map