IGPAPI
    Preparing search index...

    Function TypeaheadSearch

    • Typeahead search (POST graphql/query, TypeaheadSearchQuery): the streaming results the app shows as the user types. The response is GraphQL incremental delivery — a @defer/@stream payload followed by patches, one of which is a batched JSON array of patches — so the body is split and merged (parseJson) before decoding into the typed result union.

      Does not navigate; callers change the screen themselves (the composed SearchSerp emits the captured navigation).

      Parameters

      Returns Effect<
          {
              data: {
                  xdt_fbsearch__typeahead_stream: {
                      is_meta_ai_prompt_echo_enabled?: boolean;
                      rank_token: string;
                      results: readonly (
                          | {
                              __typename: "XDTTypeaheadSearchKeyword";
                              keyword_lazified: {
                                  id: string;
                                  name: string;
                                  user?: | {
                                      full_name?: (...)
                                      | (...);
                                      id: string;
                                      is_private?: (...) | (...) | (...);
                                      is_verified?: (...) | (...) | (...);
                                      latest_reel_media?: (...) | (...);
                                      profile_pic_url?: (...) | (...);
                                      search_serp_type?: (...) | (...) | (...);
                                      username: string;
                                  }
                                  | null;
                              };
                          }
                          | {
                              __typename: "XDTTypeaheadSearchUser";
                              rank_token?: string;
                              user: {
                                  full_name?: string;
                                  id: string;
                                  is_private?: boolean;
                                  is_verified?: boolean;
                                  latest_reel_media?: number;
                                  profile_pic_url?: string;
                                  search_serp_type?: number
                                  | null;
                                  username: string;
                              };
                          }
                          | {
                              __typename: "XDTTypeaheadSearchHashtag";
                              hashtag: { id: string; media_count?: number; name: string };
                          }
                      )[];
                  };
              };
          },
          | IgApiError
          | RequestError
          | ParseError
          | TransportError
          | SchemaError
          | GraphqlRootFieldMissingError,
          MobileDevice
          | GraphqlJsonHttp
          | MobileApplication,
      >