Fix intern graph request override return

Reviewed By: passy, lblasa

Differential Revision: D49538074

fbshipit-source-id: bab45624f8115ca5df38510d3c4330fbe2ec7550
This commit is contained in:
Andrey Goncharov
2023-09-22 06:34:11 -07:00
committed by Facebook GitHub Bot
parent fcd21111a0
commit bb35c7cbb9
2 changed files with 32 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
* @format
*/
import {GraphFileUpload, User} from 'flipper-common';
import {GraphFileUpload, GraphResponse, User} from 'flipper-common';
import {Atom, createState} from 'flipper-plugin';
export async function fetchUser(): Promise<User | null> {
@@ -36,6 +36,20 @@ export async function internGraphPOSTAPIRequest(
throw new Error('Feature not implemented');
}
export async function internGraphPOSTAPIRequestRaw(
_endpoint: string,
_formFields: {
[key: string]: any;
} = {},
_fileFields: Record<string, GraphFileUpload> = {},
_options: {
timeout?: number;
internGraphUrl?: string;
} = {},
): Promise<GraphResponse> {
throw new Error('Feature not implemented');
}
export async function internGraphGETAPIRequest(
_endpoint: string,
_params: {
@@ -49,6 +63,19 @@ export async function internGraphGETAPIRequest(
throw new Error('Feature not implemented');
}
export async function internGraphGETAPIRequestRaw(
_endpoint: string,
_params: {
[key: string]: any;
} = {},
_options: {
timeout?: number;
internGraphUrl?: string;
} = {},
): Promise<GraphResponse> {
throw new Error('Feature not implemented');
}
export async function graphQLQuery(_query: string): Promise<any> {
throw new Error('Feature not implemented');
}

View File

@@ -19,8 +19,8 @@ import {RenderHost} from 'flipper-frontend-core';
import {setMenuEntries} from '../../reducers/connections';
import {
currentUser,
internGraphGETAPIRequest,
internGraphPOSTAPIRequest,
internGraphGETAPIRequestRaw,
internGraphPOSTAPIRequestRaw,
isConnected,
} from '../../fb-stubs/user';
@@ -34,8 +34,8 @@ export function initializeFlipperLibImplementation(
...base,
intern: {
...base.intern,
graphGet: internGraphGETAPIRequest,
graphPost: internGraphPOSTAPIRequest,
graphGet: internGraphGETAPIRequestRaw,
graphPost: internGraphPOSTAPIRequestRaw,
currentUser,
isConnected,
},