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

224
Views
Expected value found [object, Object] Query Params

I don't get it, I sent in the right input type here:

Caller from JS code:

export interface FilterInput {
    limit?: number;
}

const filter: FilterInput = { limit: 1 };
const query = {
    query: `query { 
        companies(filter: ${filter}) {
            list {
                name
            }
        }
    }`,
};
const response = await sendQuery(query);
        

GraphQL Schema:

companies(filter: FilterInput): Companies

input FilterInput {
  limit: Int
}

Error: Expected value of type "FilterInput", found [object, Object].

When I try this out in graphiql in the browser, it works fine:

query {
    companies(filter: { limit: 6 }) {
        list {
            name
        }
    }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Using a js object in a template string directly resolves to [object Object] i.e. ${filter} resolves to precisely [object Object] hence the error.

To solve it you can use JSON.stringify(filter). Here is the string in the same format as before but with the fix:

`query { 
    companies(filter: ${JSON.stringify(filter)}) {
        list {
            name
        }
    }
}`
about 4 years ago · Juan Pablo Isaza Report
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!