index.js
const { ApolloServer, gql } = require("apollo-server");
const typeDefs = require("./typeDefs");
const resolvers = require("./resolvers");
const RestAPI = require("./dataSource");

const server = new ApolloServer({
  typeDefs,
  resolvers,
  dataSources: () => {
    return { restAPI: new RestAPI() };
  },
});

// The `listen` method launches a web server.
server.listen().then(({ url }) => {
  console.log(`🚀  Server ready at ${url}`);
});