Questions de la communauté — parcourez ou posez la vôtre.
Aucune question publiée pour l'instant.
E-mails lorsque nous publions de nouveaux articles.
GraphQL API Development with Apollo Server
Buckky Moral
Publié :
Cet article n'a pas encore été traduit. Il est affiché dans sa langue d'origine.
Résumé
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);
Commentaires
Chargement des commentaires…