Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file name discrepancies and bring attention to server null data no errors issue in Kotlin Tutorial #5740

Merged

Conversation

YuanRuQian
Copy link
Contributor

Hi, I mentioned these issues in my Discord post

Changes Made:

  • Fixed a typo in the "Add More Info" section where it incorrectly mentioned "LaunchListAdapter.kt" instead of "LaunchList.kt" for binding GraphQL data.
  • Addressed a mention in the "Subscriptions" section regarding error handling location in the client code. The mentioned location (MainActivity.kt) didn't match the actual code (Apollo.kt).

Additionally, In the "Add a Details View" section , I observed a discrepancy in the behavior of the current server demo when handling invalid IDs. According to the expected behavior, the server should return errors when provided with invalid IDs. However, upon testing by providing invalid IDs in the query, all responses contained only null data but no errors. Maybe the dev team to investigate this issue to ensure new learners encounter the expected behavior.

Query:

query LaunchDetails($id: ID!) {
  launch(id: $id) {
    id
    site
    mission {
      name
      missionPatch(size: LARGE)
    }
    rocket {
      name
      type
    }
    isBooked
  }
}

Query Variables:

{
  "id": "invalidId"
}

Expected response:

{
  "errors": [
    {
      "message": "Cannot read property 'flight_number' of undefined",
      "locations": [
        {
          "line": 1,
          "column": 32
        }
      ],
      "path": [
        "launch"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR"
      }
    }
  ],
  "data": {
    "launch": null
  }
}

Actual response:
Screenshot 2024-03-18 at 3 17 37 PM

Thank you!

@apollo-cla
Copy link

@YuanRuQian: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@YuanRuQian YuanRuQian changed the title Fix file name discrepancies and bring attention to server null data issue in Kotlin Tutorial Fix file name discrepancies and bring attention to server null data no errors issue in Kotlin Tutorial Mar 18, 2024
Copy link
Contributor

@martinbonnin martinbonnin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for catching those ❤️

You're also 100% right on the behaviour change about errors vs null. Nullability in GraphQL is one of my favorite topics, I'll investigate this with the team and report here

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@martinbonnin
Copy link
Contributor

(keeping this open for now as a reminder that we still need to investigate the tutorial issue).

I'll merge and open a separate tutorial issue at the end of the week if we haven't figured it out before that!

@martinbonnin
Copy link
Contributor

Fixing the tutorial might take a bit of time. Merging this as-is as opened #5747 as a follow up. Thanks again 🙏

@martinbonnin martinbonnin merged commit 9121f3b into apollographql:release-3.x Mar 20, 2024
1 check passed
martinbonnin added a commit that referenced this pull request Mar 20, 2024
… (#5748)

Co-authored-by: Lydia Yuan <32387159+YuanRuQian@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants