Scott Moss & Frontend Masters
This course has two parts, slides and excercises. The slides describe the excerices in detail. Each excercise has a starting branch and solution branch. Example lesson-1
and lesson-1-solution
.
lesson-1
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.
lesson-2
yarn test-schema
or npm run test-schema
This exercise will have you creating a GraphQL Schema based on the the mongoose models already created
lesson-3
yarn test-resolvers
or npm run test-resolvers
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.
lesson-4
yarn test-interfaces
or npm run test-interfaces
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.
lesson-5
yarn test-auth
or npm run test-auth
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!
The other types don't have any test, go ahead and write some!
原文地址: http://taobaofed.org/blog/2015/11/26/graphql-basics-server-implementation/ 最近有点时间来看下nodejs和graphQL,于是看了下官网并自己手动尝试了一下。遇到了一些问题,在此把我遇到的问题记录下,便于帮助大家更好的阅读. 1. 使用 Node.js 实现 GraphQL 服务器 我们先按照官方文档搭建一个
原文:http://blog.mygraphql.com/wordpress/?p=106 订阅(Subscriptions) 订阅查询(Subscription Queries) Graphql 订阅(subscriptions)使你可以让你订阅响应式数据源(reactive source) 。当有新数据时,会发送给订阅者。 可以阅读 http://graphql.org/blog/subsc.
This blog post is a continuation of my previous blog post on GraphQL Basics. Click Here to check out the GraphQL Basics post. 这篇博客文章是我之前关于GraphQL Basics的博客文章的延续。 单击此处查看GraphQL基础知识帖子。 It is necessary t
用GraphQL实现常见的CRUD功能,本文介绍简单的查询功能 package com.zte.sunquan.demo.graph.ql; import static graphql.Scalars.GraphQLString; import static graphql.schema.GraphQLArgument.newArgument; import static graphql.sch
An Introduction to Terraform Sample Code This repo contains the sample code for the blog post series A Comprehensive Guide toTerraform. The examples correspond to thefollowing parts of the series: An
Overview So far I have shown you 2d drawing, animation, and hardware accelerated 3d. When you build something with these technologies you may notice something is missing: sound! Traditionally good sou
graphql-to-mongodb If you want to grant your Nodejs GraphQL service a whole lot of the power of the MongoDb database standing behind it with very little hassle, you've come to the right place! Example
Swagger-to-GraphQL Swagger-to-GraphQL converts your existing Swagger schema to an executableGraphQL schema where resolvers perform HTTP calls to certain real endpoints. Itallows you to move your API t
OpenAPI-to-GraphQL Translate APIs described by OpenAPI Specifications (OAS) or Swagger into GraphQL. Getting started OpenAPI-to-GraphQL can be used in two ways: CLI The Command Line Interface (CLI) pr
实现 UIScrollView 视图切换时淡入淡出的切换效果。手指滑动 scroll view 时,scroll view上的视图切换不像一般那样的页面切换效果,而是一种淡入淡出的切换效果。Demo还支持Scroll View自动滚动。 [Code4App.com]