@graphql-mesh/transport-rest
Version:
17 lines (16 loc) • 738 B
JavaScript
import { createDefaultExecutor } from '@graphql-mesh/transport-common';
import { processDirectives } from './directives/process.js';
export const getSubgraphExecutor = function getRESTSubgraphExecutor({ transportEntry, getSubgraph, fetch, pubsub, logger }) {
const preProcessedSchema = getSubgraph();
const processDirectiveOpts = {
globalFetch: fetch,
pubsub,
logger,
...transportEntry.options,
};
const processedSchema = processDirectives(preProcessedSchema, processDirectiveOpts);
const executor = createDefaultExecutor(processedSchema);
return executor;
};
export { processDirectives } from './directives/process.js';
export { processScalarType } from './directives/scalars.js';