mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 01:41:13 +08:00
24 lines
579 B
JavaScript
24 lines
579 B
JavaScript
import graphql from '@coralproject/graphql-anywhere-optimized';
|
|
import { createTypeGetter } from 'graphql-ast-tools';
|
|
import introspectionData from './introspection.json';
|
|
|
|
// Use typeGetter to get more optimized documents.
|
|
const typeGetter = createTypeGetter(introspectionData);
|
|
|
|
// Use global fragment cache for transformed fragments.
|
|
const fragmentMap = {};
|
|
|
|
export default (...args) => {
|
|
while (args.length < 7) {
|
|
args.push(undefined);
|
|
}
|
|
|
|
const transformOptions = {
|
|
typeGetter,
|
|
fragmentMap,
|
|
};
|
|
|
|
args[6] = transformOptions;
|
|
return graphql(...args);
|
|
};
|