The function getGraphqlResponse sends a POST request to the Instagram GraphQL API with a payload and returns the response data.

  • Parameters

    • payload: URLSearchParams

      The payload parameter in the getGraphqlResponse function is expected to be a URLSearchParams object containing the data to be sent in the POST request to the Instagram GraphQL API endpoint. This data typically includes the query parameters required for the GraphQL query.

    Returns Promise<GraphqlResponse>

    GraphqlResponse - The function getGraphqlResponse is returning the data received from the GraphQL query to the Instagram API. If the request is successful, it will return the GraphQL response data. If there is an error during the request, it will log an error message to the console.