Commit 769951e1 by qiuzhi99

first commit

0 parents
node_modules
\ No newline at end of file
const { ApolloServer } = require("apollo-server");
const gql = require("graphql-tag");
const typeDefs = gql`
type Query {
sayHi: String!
}
`;
const resolvers = {
Query: {
sayHi: () => "hello world"
}
};
const server = new ApolloServer({
typeDefs,
resolvers
});
server.listen({ port: 5001 }).then(res => {
console.log(`Server running at ${res.url}`);
});
{
"name": "merng",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"apollo-server": "^2.9.3",
"graphql": "^14.5.4",
"mongoose": "^5.6.13"
}
}
This diff is collapsed. Click to expand it.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!