hongbo-miao/hongbomiao.com

View on GitHub
web/src/shared/utils/graphQLFetch.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Observable } from 'rxjs';
import { ajax, AjaxResponse } from 'rxjs/ajax';
import config from '../../config';

const graphQLFetch = (query: string): Observable<AjaxResponse<unknown>> =>
  ajax.post(
    config.graphqlServerGraphQLURL,
    {
      query,
    },
    { 'Content-Type': 'application/json' },
  );

export default graphQLFetch;