-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.ts
More file actions
27 lines (23 loc) · 856 Bytes
/
index.ts
File metadata and controls
27 lines (23 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type {KeyValueCache} from '@apollo/utils.keyvaluecache';
import {IntermineAPI} from './intermine/index.js';
import {MicroservicesAPI} from './microservices/index.js';
export {IntermineAPI} from './intermine/index.js';
export {MicroservicesAPI} from './microservices/index.js';
export type DataSources = {
lisIntermineAPI: IntermineAPI;
lisMicroservicesAPI: MicroservicesAPI;
};
export const dataSources = async (
intermineURI: string,
microservicesURI: string,
cache: KeyValueCache,
): Promise<DataSources> => {
const config = {cache};
const lisIntermineAPI = new IntermineAPI(intermineURI, config);
// TODO: this crashes the server rather than throwing a GraphQL error
//lisIntermineAPI.verifyIntermineVersion();
return {
lisIntermineAPI,
lisMicroservicesAPI: new MicroservicesAPI(microservicesURI, config),
};
};