incrementalDeliveryPolyfill.js 791 B

1234567891011121314151617181920212223
  1. import { execute, } from 'graphql';
  2. let graphqlExperimentalExecuteIncrementally = undefined;
  3. async function tryToLoadGraphQL17() {
  4. if (graphqlExperimentalExecuteIncrementally !== undefined) {
  5. return;
  6. }
  7. const graphql = await import('graphql');
  8. if ('experimentalExecuteIncrementally' in graphql) {
  9. graphqlExperimentalExecuteIncrementally = graphql
  10. .experimentalExecuteIncrementally;
  11. }
  12. else {
  13. graphqlExperimentalExecuteIncrementally = null;
  14. }
  15. }
  16. export async function executeIncrementally(args) {
  17. await tryToLoadGraphQL17();
  18. if (graphqlExperimentalExecuteIncrementally) {
  19. return graphqlExperimentalExecuteIncrementally(args);
  20. }
  21. return execute(args);
  22. }
  23. //# sourceMappingURL=incrementalDeliveryPolyfill.js.map