# Lift-off II: Resolvers

**URL:** <https://community.apollographql.com/t/lift-off-ii-resolvers/5779>\
**Category:** Other Apollo Topics\
**Tags:** odyssey\
**Created:** [February 22, 2023, 6:33am UTC](https://community.apollographql.com/t/lift-off-ii-resolvers/5779 "2023-02-22T06:33:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudiwever](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rudiwever](https://community.apollographql.com/u/rudiwever)\
**Post date:** [February 22, 2023, 6:33am UTC](https://community.apollographql.com/t/lift-off-ii-resolvers/5779/1 "2023-02-22T06:33:36Z")

</div>

I’ve completed Connecting the dots in server-land.  
And now that I try and run the app, I get

```auto
"exception": {
          "message": "request to https://odyssey-lift-off-rest-api.herokuapp.com/tracks failed, reason: getaddrinfo ENOTFOUND odyssey-lift-off-rest-api.herokuapp.com",
          "type": "system",
          "errno": "ENOTFOUND",
          "code": "ENOTFOUND",
            ...,
}

```

and the problem seems to be when I switch from the mocks to the resolvers and dataSources.

Any advice?

---

<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:** [February 22, 2023, 2:41pm UTC](https://community.apollographql.com/t/lift-off-ii-resolvers/5779/2 "2023-02-22T14:41:41Z")

</div>

Hi @rudiwever!

Would you be able to share your code for the server file (or the whole repo)? There might be a typo or something there we’re not seeing with the way the pieces are connected together.

I also tried to access the endpoint directly ([https://odyssey-lift-off-rest-api.herokuapp.com/tracks](https://odyssey-lift-off-rest-api.herokuapp.com/tracks)) and I can see the JSON data, so we can rule that one out as the cause of the issue.

Hope we can troubleshoot this together!

---

<div class="post-metadata">

**Author:** ![rudiwever](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@rudiwever](https://community.apollographql.com/u/rudiwever)\
**Post date:** [February 23, 2023, 12:21am UTC](https://community.apollographql.com/t/lift-off-ii-resolvers/5779/3 "2023-02-23T00:21:14Z")

</div>

Hi Michelle,

I tried the endpoint as well, and yes it works.

Here is the code for the server…

/src/server/index.js

const { ApolloServer } = require(‘apollo-server’);

const typeDefs = require(‘./schema’);

const resolvers = require(‘./resolvers’);

const TrackAPI = require(‘./datasources/track-api’);

const mocks = {

Query: () =\> ({

tracksForHome: () =\> […new Array(9)],

}),

Track: () =\> ({

id: () =\> ‘track\_01’,

title: () =\> ‘Astro Kitty, Space Explorer’,

author: () =\> {

return {

name: ‘Grumpy Cat’,

photo: ‘[https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm\_mctf3c.jpg](https://res.cloudinary.com/dety84pbu/image/upload/v1606816219/kitty-veyron-sm_mctf3c.jpg)’,

};

},

thumbnail: () =\> ‘[https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula\_cat\_djkt9r.jpg](https://res.cloudinary.com/dety84pbu/image/upload/v1598465568/nebula_cat_djkt9r.jpg)’,

length: () =\> 1210,

modulesCount: () =\> 6,

}),

};

//THIS SERVER WORKS

const server2 = new ApolloServer({

typeDefs,

mocks,

});

//THIS SERVER FAILS

const server = new ApolloServer({

typeDefs,

resolvers,

dataSources: () =\> {

return {

trackAPI: new TrackAPI(),

};

},

});

server.listen().then(() =\> {

console.log(`

🚀 Server is running!

🔉 Listening on port 4000

📭

`);

});

---

<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:** [February 24, 2023, 8:10pm UTC](https://community.apollographql.com/t/lift-off-ii-resolvers/5779/4 "2023-02-24T20:10:09Z")

</div>

Thanks for that info! Where are you seeing the error? Is it in the server console terminal? The client browser?
