Lift-off II: Resolvers

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

"exception": {
          "message": "request to failed, reason: getaddrinfo ENOTFOUND",
          "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?

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 ( 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!

Hi Michelle,

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

Here is the code for the server…


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: ‘’,



thumbnail: () => ‘’,

length: () => 1210,

modulesCount: () => 6,




const server2 = new ApolloServer({





const server = new ApolloServer({



dataSources: () => {

return {

trackAPI: new TrackAPI(),




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


:rocket: Server is running!

:sound: Listening on port 4000




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