Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
RESTDataSource to request data from Elasticsearh

I'm using RESTDataSource from apollo-datasource-rest library to query data from the opensearch index but running into http request errors.

After extending RESTDataSource class, I have a following method which I want to call to return data from index my_index where name field is exactly equal to the name parameter

async getDataByName(name) {
 const responseData = await this.get(`_search?index=my_index', {
  query: {
    match_phrase: {
     name: name
    }
   }
 })
}

I am getting invalid request error (request [/_search] contains unrecognized parameter: [query]) but same query works in postman. What i am doing wrong?

Tried following this docs but not very helpful - https://www.apollographql.com/docs/apollo-server/data/data-sources/#http-methods

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!