{
  "version": 3,
  "sources": ["../src/useOverridenOrDefaultApolloClient.ts"],
  "sourcesContent": ["import {\n  ApolloClient,\n  useApolloClient as useDefaultApolloClient,\n} from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport * as React from \"react\";\n\n/**\n * @internal\n */\nexport function useOverridenOrDefaultApolloClient() {\n  const client = React.useContext(ApolloReactRelayDuctTapeContext);\n  if (client) {\n    return client;\n  }\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return useDefaultApolloClient() as ApolloClient<any>;\n}\n\nconst ApolloReactRelayDuctTapeContext = React.createContext<\n  ApolloClient<unknown> | undefined\n>(undefined);\n\n/**\n * A context provider that allows passing an explicit ApolloClient instance to\n * the apollo-react-relay-duct-tape hooks. If this provider is not used, the\n * hooks will default to one provided by @apollo/client's ApolloProvider.\n *\n * This allows a subset of a tree to use apollo-react-relay-duct-tape using a\n * different ApolloClient instance than the rest of the tree above and below it.\n */\nexport const ApolloReactRelayDuctTapeProvider: React.FC<\n  React.PropsWithChildren<{\n    client: ApolloClient<unknown>;\n  }>\n> = (props) => {\n  invariant(\n    props.client,\n    \"ApolloReactRelayDuctTapeProvider: client is required\",\n  );\n  return React.createElement(\n    ApolloReactRelayDuctTapeContext.Provider,\n    { value: props.client },\n    props.children,\n  );\n};\n"],
  "mappings": ";AAAA;AAAA,EAEE,mBAAmB;AAAA,OACd;AACP,OAAO,eAAe;AACtB,YAAY,WAAW;AAKhB,SAAS,oCAAoC;AAClD,QAAM,SAAe,iBAAW,+BAA+B;AAC/D,MAAI,QAAQ;AACV,WAAO;AAAA,EACT;AAEA,SAAO,uBAAuB;AAChC;AAEA,IAAM,kCAAwC,oBAE5C,MAAS;AAUJ,IAAM,mCAIT,CAAC,UAAU;AACb;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AACA,SAAa;AAAA,IACX,gCAAgC;AAAA,IAChC,EAAE,OAAO,MAAM,OAAO;AAAA,IACtB,MAAM;AAAA,EACR;AACF;",
  "names": []
}
