Skip to content

Commit

Permalink
Replace request with isomorphic-unfetch
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Kim <[email protected]>
  • Loading branch information
JsonKim authored and Alan-Cha committed May 12, 2020
1 parent 0c12ebf commit dc48906
Show file tree
Hide file tree
Showing 10 changed files with 376 additions and 257 deletions.
2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/lib/index.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions packages/openapi-to-graphql/lib/resolver_builder.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ConnectOptions } from './types/options';
import { ConnectOptions, RequestOptions } from './types/options';
import { Operation } from './types/operation';
import { ResolveFunction, SubscriptionIterator } from './types/graphql';
import { PreprocessingData } from './types/preprocessing_data';
import * as NodeRequest from 'request';
declare type GetResolverParams = {
operation: Operation;
argsFromLink?: {
Expand All @@ -12,7 +11,7 @@ declare type GetResolverParams = {
responseName?: string;
data: PreprocessingData;
baseUrl?: string;
requestOptions?: NodeRequest.OptionsWithUrl;
requestOptions?: RequestOptions;
};
declare type GetSubscribeParams = {
operation: Operation;
Expand Down
60 changes: 42 additions & 18 deletions packages/openapi-to-graphql/lib/resolver_builder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/openapi-to-graphql/lib/resolver_builder.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions packages/openapi-to-graphql/lib/types/options.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as NodeRequest from 'request';
import { ResolveFunction, ResolveObject, GraphQLOperationType } from './graphql';
/**
* Type definition of the options that users can pass to OpenAPI-to-GraphQL.
Expand All @@ -19,6 +18,9 @@ export declare type Report = {
numMutationsCreated: number;
numSubscriptionsCreated: number;
};
export declare type RequestOptions = {
[key: string]: any;
};
export declare type ConnectOptions = {
[key: string]: boolean | number | string;
};
Expand Down Expand Up @@ -126,7 +128,7 @@ export declare type Options = {
* calls to the API backend.
* e.g. Setup the web proxy to use.
*/
requestOptions?: NodeRequest.OptionsWithUrl;
requestOptions?: RequestOptions;
/**
* Allows to override or add options to the PubSub connect object used to make
* publish/subscribe to the API backend.
Expand Down Expand Up @@ -329,7 +331,7 @@ export declare type InternalOptions = {
* calls to the API backend.
* e.g. Setup the web proxy to use.
*/
requestOptions?: NodeRequest.OptionsWithUrl;
requestOptions?: RequestOptions;
/**
* Allows to override or add options to the PubSub connect object used to make
* publish/subscribe to the API backend.
Expand Down
Loading

0 comments on commit dc48906

Please sign in to comment.