From bb35c7cbb9c501e7cbe110aaeb2836074c897cba Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 22 Sep 2023 06:34:11 -0700 Subject: [PATCH] Fix intern graph request override return Reviewed By: passy, lblasa Differential Revision: D49538074 fbshipit-source-id: bab45624f8115ca5df38510d3c4330fbe2ec7550 --- desktop/flipper-ui-core/src/fb-stubs/user.tsx | 29 ++++++++++++++++++- .../utils/flipperLibImplementation/index.tsx | 8 ++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/desktop/flipper-ui-core/src/fb-stubs/user.tsx b/desktop/flipper-ui-core/src/fb-stubs/user.tsx index 4f602334d..b7493da9a 100644 --- a/desktop/flipper-ui-core/src/fb-stubs/user.tsx +++ b/desktop/flipper-ui-core/src/fb-stubs/user.tsx @@ -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 { @@ -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 = {}, + _options: { + timeout?: number; + internGraphUrl?: string; + } = {}, +): Promise { + 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 { + throw new Error('Feature not implemented'); +} + export async function graphQLQuery(_query: string): Promise { throw new Error('Feature not implemented'); } diff --git a/desktop/flipper-ui-core/src/utils/flipperLibImplementation/index.tsx b/desktop/flipper-ui-core/src/utils/flipperLibImplementation/index.tsx index 91ce6f342..d10cc5307 100644 --- a/desktop/flipper-ui-core/src/utils/flipperLibImplementation/index.tsx +++ b/desktop/flipper-ui-core/src/utils/flipperLibImplementation/index.tsx @@ -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, },