Scott Moss
CEO of Tipe
Scott Moss & FrontEnd Masters
tldr; Strongly typed query language and runtime for your data
tldr; Different but sneakily similar
In this lesson you'll be creating a simple GraphQL server using Apollo Server.
tldr; GraphQL schema strictly defines what resources, how they relate, and how a client and consume them
tldr; Many ways to create schemas, SDL is the best
tldr; Describe resources that will be used in queries and mutations
tldr; CRUD on your GraphQL API
This exercise will have you creating a GraphQL Schema based on the the mongoose models already created
tldr; Like controllers, but instead resolve types all the way down
tldr; Return the same shape as described in the schema, or delegate to another resolver
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.
tldr; Inheritable types for your schema
tldr; A combination type that can be one of many different types that may not relate to each other
tldr; Have to create a resolver that tells graphql what type to resolve to
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.
tldr; There is not wrong way
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!
By Scott Moss