question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Query returning incorrect data

See original GitHub issue

I’ve got a query that looks like this:

query IssueQuery($project: ID!) {
  issues(project: $project) {
    id
    custom {
      name
      value
    }
  }
}

When I execute this query in GraphiQL, I get results that look like this:

{
  "data": {
    "issues": [
      {
        "id": "6",
        "custom": [
          {
            "name": "priority",
            "value": "P2"
          },
          {
            "name": "severity",
            "value": "S2"
          }
        ]
      },
// etc...

However, when I execute the same query in Apollo, the props.data looks like this instead:

[
  {
    "id": "6",
    "custom": [
      {
        "name": "severity",
        "value": "S2"
      },
      {
        "name": "severity",
        "value": "S2"
      }
    ]
  },

Notice how the contents of the ‘custom’ field aren’t the same - instead of seeing two separate objects I’m seeing the same object twice.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stubailocommented, Oct 16, 2016

Good call, just updated the documentation.

0reactions
stubailocommented, Oct 16, 2016

ohhhhhh - that explains why we have been seeing a lot of these types of bugs. Here’s what we have in the example app: https://github.com/apollostack/GitHunt-React/blob/380bedaef97f2a0932c1ab33bd964812d4a8a65e/ui/client.js#L43-L48

  dataIdFromObject: (result) => {
    if (result.id && result.__typename) {
      return result.__typename + result.id;
    }
    return null;
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

FIX: Incorrect data returned when you query the DATE column ...
When you try to query the table by using the DATE data type as a qualifier, incorrect data may be returned. For example:create...
Read more >
Query returning incorrect result - sql - Stack Overflow
I wrote the below SQL query for pulling the revenue of a specific product Id (500) but it's returning 9335 results but all...
Read more >
Query is returning incorrect results - Oracle Communities
Hi, I have come across a strange behavior in Oracle 11.2.0.4 database. For one of the queries, the database is returning incorrect results....
Read more >
Linked Table Query Returning Incorrect Results
We had this annoying problem: a simple query in Access to a linked table (using ODBC and MS SQL server) returned incorrect results,...
Read more >
Query returning incorrect results randomly - SQLServerCentral
Hi Team, I'm running a simple SQL query which returns a set of columns based on a search criteria. It has to return...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found