apollo-angular
Version:
Use your GraphQL data in your Angular app, with the Apollo Client
1 lines • 1.64 kB
Source Map (JSON)
{"version":3,"file":"ngApolloLinkPersisted.mjs","sources":["../../persisted-queries/src/index.ts","../../persisted-queries/src/ngApolloLinkPersisted.ts"],"sourcesContent":["import { setContext } from '@apollo/client/link/context';\nimport { ApolloLink } from '@apollo/client/link/core';\nimport { createPersistedQueryLink as _createPersistedQueryLink } from '@apollo/client/link/persisted-queries';\n\nexport type Options = Parameters<typeof _createPersistedQueryLink>[0];\n\nconst transformLink = setContext((_, context) => {\n const ctx: any = {};\n\n if (context.http) {\n ctx.includeQuery = context.http.includeQuery;\n ctx.includeExtensions = context.http.includeExtensions;\n }\n\n if (context.fetchOptions && context.fetchOptions.method) {\n ctx.method = context.fetchOptions.method;\n }\n\n return ctx;\n});\n\nexport const createPersistedQueryLink = (options: Options) =>\n ApolloLink.from([_createPersistedQueryLink(options), transformLink as any]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["_createPersistedQueryLink"],"mappings":";;;;AAMA,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,KAAI;IAC9C,MAAM,GAAG,GAAQ,EAAE,CAAC;AAEpB,IAAA,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;QAC7C,GAAG,CAAC,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC;KACxD;IAED,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE;QACvD,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KAC1C;AAED,IAAA,OAAO,GAAG,CAAC;AACb,CAAC,CAAC,CAAC;MAEU,wBAAwB,GAAG,CAAC,OAAgB,KACvD,UAAU,CAAC,IAAI,CAAC,CAACA,0BAAyB,CAAC,OAAO,CAAC,EAAE,aAAoB,CAAC;;ACtB5E;;AAEG;;;;"}