UNPKG

916 BSource Map (JSON)View Raw
1{"version":3,"file":"selectURI.js","sourceRoot":"","sources":["../../../src/link/http/selectURI.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,SAAS,GAAG,UACvB,SAAoB,EACpB,WAAyD;IAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE/B,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;AACH,CAAC,CAAC","sourcesContent":["import { Operation } from '../core';\n\nexport const selectURI = (\n operation: Operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n"]}
\No newline at end of file