# Lift-Off II: QUERYING LIVE DATA - Error while running the query in Apollo Sandbox

**URL:** <https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336>\
**Category:** Other Apollo Topics\
**Tags:** odyssey\
**Created:** [June 6, 2023, 7:37am UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336 "2023-06-06T07:37:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreelakshmi\_Suresh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/sreelakshmi_suresh/32/4335_2.png) [@Sreelakshmi\_Suresh](https://community.apollographql.com/u/Sreelakshmi_Suresh)\
**Post date:** [June 6, 2023, 7:37am UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/1 "2023-06-06T07:37:30Z")

</div>

After running the sample query, I’m receiving the following error:

```auto
{
  "data": {},
  "errors": [
    {
      "message": "Cannot return null for non-nullable field Query.tracksForHome.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "tracksForHome"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "stacktrace": [
          "Error: Cannot return null for non-nullable field Query.tracksForHome.",
          " at completeValue (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\graphql\\execution\\execute.js:594:13)",
          " at executeField (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\graphql\\execution\\execute.js:489:19)",
          " at executeFields (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\graphql\\execution\\execute.js:413:20)",
          " at executeOperation (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\graphql\\execution\\execute.js:344:14)",
          " at execute (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\graphql\\execution\\execute.js:136:20)",
          " at executeIncrementally (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\@apollo\\server\\dist\\cjs\\incrementalDeliveryPolyfill.js:47:34)",
          " at processTicksAndRejections (node:internal/process/task_queues:96:5)",
          " at async execute (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\@apollo\\server\\dist\\cjs\\requestPipeline.js:223:37)",
          " at async processGraphQLRequest (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\@apollo\\server\\dist\\cjs\\requestPipeline.js:158:32)",
          " at async internalExecuteOperation (C:\\Users\\SreelakshmiSuresh\\Desktop\\Training\\Backend Training\\GraphQL\\odyssey-lift-off-part2\\server\\node_modules\\@apollo\\server\\dist\\cjs\\ApolloServer.js:615:16)"
        ]
      }
    }
  ]
}Preformatted text

```

I checked all the files for typos but couldn’t find any. Any help would be appreciated. Thanks !

---

<div class="post-metadata">

**Author:** ![Michelle\_Mabuyo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/michelle_mabuyo/32/80_2.png) [@Michelle\_Mabuyo](https://community.apollographql.com/u/Michelle_Mabuyo)\
**Post date:** [June 7, 2023, 3:01pm UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/2 "2023-06-07T15:01:16Z")

</div>

Hey there @Sreelakshmi_Suresh ! This error usually points to something wrong with the resolver function for `Query.tracksForHome`. Here are some things you can check:

- Are you importing the resolvers.js file correctly?
- Is the resolver function defined correctly?
- Is the resolver function calling the datasource correctly?

If you could provide a link to your GitHub repo, I can also take a second look for you!

Let me know.

---

<div class="post-metadata">

**Author:** ![Sreelakshmi\_Suresh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/sreelakshmi_suresh/32/4335_2.png) [@Sreelakshmi\_Suresh](https://community.apollographql.com/u/Sreelakshmi_Suresh)\
**Post date:** [June 8, 2023, 5:05am UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/3 "2023-06-08T05:05:11Z")

</div>

Thank you so much for your reply.  
I went through the code once again but maybe it’s a small error and that’s why I’m not able to point what went wrong.  
Here is the link to my GitHub repo: [GitHub - sreelakshmi-suresh/odyssey-lift-off-part2](https://github.com/sreelakshmi-suresh/odyssey-lift-off-part2.git)

Thank you so much!

---

<div class="post-metadata">

**Author:** ![Michelle\_Mabuyo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/michelle_mabuyo/32/80_2.png) [@Michelle\_Mabuyo](https://community.apollographql.com/u/Michelle_Mabuyo)\
**Post date:** [June 8, 2023, 2:44pm UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/4 "2023-06-08T14:44:53Z")

</div>

Your repo seems to be missing the file contents of the `server` folder! So I’m not able to check your code.

I did run what was in `final/server` and that ran successfully with the query returning data back. That could also be another reference point to check against your own code.

Let me know when you push your `server` files though, I’m still happy to take a look.

---

<div class="post-metadata">

**Author:** ![Sreelakshmi\_Suresh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/sreelakshmi_suresh/32/4335_2.png) [@Sreelakshmi\_Suresh](https://community.apollographql.com/u/Sreelakshmi_Suresh)\
**Post date:** [June 9, 2023, 4:58am UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/5 "2023-06-09T04:58:35Z")

</div>

I’m so sorry, I turned the server folder into a submodule by mistake. I have uploaded the folder again. Please do check.  
Thank you so much for looking into it.

---

<div class="post-metadata">

**Author:** ![Michelle\_Mabuyo](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/michelle_mabuyo/32/80_2.png) [@Michelle\_Mabuyo](https://community.apollographql.com/u/Michelle_Mabuyo)\
**Post date:** [June 14, 2023, 10:46pm UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/6 "2023-06-14T22:46:05Z")

</div>

Hey @Sreelakshmi_Suresh sorry for the delay! I took a look at your code and identified the problem in `resolvers.js`. In the very last line, it should be:

```javascript
module.exports = resolvers;

```

Note the s in `exports`. Your file current has `export`. This means that the resolvers weren’t being exported correctly, so the resolvers weren’t connected to ApolloServer, resulting in the error.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Sreelakshmi\_Suresh](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/sreelakshmi_suresh/32/4335_2.png) [@Sreelakshmi\_Suresh](https://community.apollographql.com/u/Sreelakshmi_Suresh)\
**Post date:** [June 15, 2023, 4:59am UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/7 "2023-06-15T04:59:20Z")

</div>

Holy smoke!  
Thank you so much, I was trying to find if there was anything wrong with the logic.  
Appreciate your help!!

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/lift-off-ii-querying-live-data-error-while-running-the-query-in-apollo-sandbox/6336/8 "2025-02-06T20:48:44Z")

</div>

Archived on February 6, 2025, 8:48pm UTC


