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

359
Views
Inconsistent results between Graphql playground and Apollo Client

I've run into an issue where Apollo client and the GQL playground return different data with the exact same query. The schema looks something like this:

interface A {
  age: Int!
}

interface B implements A {
  age: Int!
  name: String!
}

type SomeType implements A & B { ... }

type Query {
  hello: A 
}

The server returns a concrete type SomeType, which implements both interface A and B.

The query:

{
  hello {
    age
    ... on B {
       name
    }
  }
}

(The only difference I can think of is that when using Apollo client, the query is parsed with the graphl-tag). In the GQL playground, the query returns the expect result. Something like:

{
  "__typename": "someType",
  "age": 10,
  "name": "someName"
}

However, when running this query with Apollo client, I get:

{
  "__typename": "someType",
  "age": 10,
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It seems the query is defined to return type A

type Query {
  hello: A 
}

So getting only the fields defined in A seems correct. Perhaps you should change the schema to something like:

type Query {
  hello: SomeType 
}
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!