Complete the code to import ApolloServer from the correct package.
const { [1] } = require('apollo-server');The ApolloServer class is imported from the 'apollo-server' package to create a GraphQL server.
Complete the code to define a simple type definition for a Query named 'hello'.
const typeDefs = `type Query { [1]: String }`;The Query type must have a field named 'hello' that returns a String.
Fix the error in the resolver function to return the string 'Hello world!'.
const resolvers = { Query: { hello: () => [1] } };The resolver must return a string literal. It needs quotes around the text.
Fill both blanks to create and start the Apollo Server with typeDefs and resolvers.
const server = new [1]({ typeDefs, [2] }); server.listen().then(({ url }) => { console.log(`Server ready at ${url}`); });
The server is created using the ApolloServer class and needs the 'resolvers' object passed in the config.
Fill all three blanks to import ApolloServer, define a Query type, and create the server.
const { [1] } = require('apollo-server');
const typeDefs = `type Query { [2]: String }`;
const resolvers = { Query: { [3]: () => 'Hello!' } };
const server = new ApolloServer({ typeDefs, resolvers });
server.listen().then(({ url }) => console.log(`Running at ${url}`));We import ApolloServer, define a Query type with a 'hello' field, and create a resolver for 'hello'.