Skip to content

Commit

Permalink
fix: add no-cache policy
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamjajoo authored and vincenzopalazzo committed Aug 13, 2022
1 parent 4a849d1 commit bfc2172
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion api/LNSocketAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ import {
import axios from "axios";
import { OfferInfo } from "../model/Offer";
import { inject, singleton } from "tsyringe";
import { ApolloClient, InMemoryCache, gql } from "@apollo/client";
import {
ApolloClient,
InMemoryCache,
gql,
DefaultOptions,
} from "@apollo/client";

/**
* Experimental feature.
*
* Implementing the API with the LNSocketAPI to use a native connection to call directly
* the node API without use of any additional services.
*/

@singleton()
export default class LNSocketAPI implements AppAPI {
private address: string;
Expand All @@ -33,13 +39,25 @@ export default class LNSocketAPI implements AppAPI {
@inject("rune") rune: string,
@inject("lnmetrics_url") url: string
) {
const defaultOptions: DefaultOptions = {
watchQuery: {
fetchPolicy: "no-cache",
errorPolicy: "ignore",
},
query: {
fetchPolicy: "no-cache",
errorPolicy: "all",
},
};

this.nodeID = nodeId;
this.address = adderss;
this.rune = rune;
this.lambda = lambda;
this.gqlClient = new ApolloClient({
uri: url,
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
}

Expand Down

0 comments on commit bfc2172

Please sign in to comment.