在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):FrontendMasters/intro-to-graphql开源软件地址(OpenSource Url):https://github.com/FrontendMasters/intro-to-graphql开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Intro to GraphQL
ResourcesCourseThis course has two parts, slides and excercises. The slides describe the excerices in detail. Each excercise has a starting branch and solution branch. Example ExcercisesHello world GraphQL server with Apollo Server
Note: ensure that you have MongoDB installed, and the server is running. See their website In this lesson you'll be creating a simple GraphQL server using Apollo Server.
Creating Schema with SDL
This exercise will have you creating a GraphQL Schema based on the the mongoose models already created
Resolving Queries and Mutations
In this exercise, you'll be creating resolvers for the Queries and Mutations on the product type. You'll be using Mongoose models to perform CRUD in your resolvers.
Interfaces and Unions
Now that you know about schemas and resolvers, we need to make some changes. Our product model in mongoose is split between 3 different product types. We need to make the product type an interface and then create types for each possible type in our mongoose model. Don't forget to create resolver to resolve the type.
Authentication
There are many many ways to authenticate with GraphQL. Our API is a public API, so we'll use API keys. Some queries need authentication, and some queries also need the correct role. Authenticate the request and update the product resolvers!
TestingThe other types don't have any test, go ahead and write some! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论