Community Q&A — browse recent questions or post your own.
No published questions yet. Be the first to ask.
Email updates when we publish new posts and highlights.
GraphQL API Development with Apollo Server
Buckky Moral
Published:
Abstract
Build efficient and type-safe APIs using GraphQL and Apollo Server.
Why GraphQL?
GraphQL provides a complete description of your API data.
Setup Apollo Server
import { ApolloServer } from '@apollo/server';
import { startStandaloneServer } from '@apollo/server/standalone';
const typeDefs = `#graphql
type Book {
title: String
author: String
}
type Query {
books: [Book]
}
`;
const resolvers = {
Query: {
books: () => books,
},
};
const server = new ApolloServer({ typeDefs, resolvers });
const { url } = await startStandaloneServer(server);
Comments
Loading comments…