Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
GraphQL with NodeJs: From Beginner to Advanced Concepts
Rating: 3.7 out of 5(79 ratings)
655 students

GraphQL with NodeJs: From Beginner to Advanced Concepts

GraphQL API development with Node.Js and MongoDB; Learn Authentication, Caching, DataLoaders, Pagination, Subscription
Created byHaider Malik
Last updated 1/2020
English

What you'll learn

  • Build highly scaleable APIS with GraphQL, NodeJs and MongoDB
  • Secure GraphQL API using JWT Authentication
  • Learn Advanced Concepts- Interfaces, Unions, DataLoaders, Caching, Pagination, Sorting, Filtering
  • Learn Cursor based Pagination in GraphQL
  • Testing with GraphQL, NodeJs and Jest
  • Unit Testing and Integration testing in GraphQL

Course content

8 sections41 lectures2h 47m total length
  • Create Express Server in NodeJs3:44

    Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

    With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.

    Express provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love.

  • Create GraphQL Server using express-graphql7:58

    Create a GraphQL HTTP server with HTTP web framework that supports connect styled middleware, including Connect itself, Express

  • Understand GraphQL Resolver Arguments3:07

    In order to respond to queries, a schema needs to have resolve functions for all fields. Resolve functions cannot be included in the GraphQL schema language, so they must be added separately. This collection of functions is called the “resolver map”.

    Every resolver in a GraphQL.js schema accepts four positional arguments:

    fieldName(obj, args, context, info) { result }
    

    These arguments have the following meanings and conventional names:

    1. obj: The object that contains the result returned from the resolver on the parent field, or, in the case of a top-level Query field, the rootValue passed from the server configuration. This argument enables the nested nature of GraphQL queries.
    2. args: An object with the arguments passed into the field in the query. For example, if the field was called with author(name: "Ada"), the args object would be: { "name": "Ada" }.
    3. context: This is an object shared by all resolvers in a particular query, and is used to contain per-request state, including authentication information, dataloader instances, and anything else that should be taken into account when resolving the query.
    4. info: This argument should only be used in advanced cases, but it contains information about the execution state of the query, including the field name, path to the field from the root, and more. It’s only documented in the GraphQL.js source code.
  • Connect GraphQL App with MongoDB using Mongoose3:51

    Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

    In simple words, Mongoose acts as an intermediate between mongodb and server side language(like NodeJs)

Requirements

  • Knowledge of Javascript is required
  • Knowledge of NodeJs is required

Description

GraphQL is a new API standard that provides a more efficient, robust and flexible alternative to REST. It was developed and open-sourced by Facebook and is now maintained by a large community of companies and individuals from all over the world.

APIs have become ubiquitous components of software infrastructures. In short, an API defines how aclient can load data from a server.

At its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API. Instead of multiple endpoints that return fixed data structures, a GraphQL server only exposes a single endpoint and responds with precisely the data a client asked for.

How GraphQL is better than REST

1. Increased mobile usage creates need for efficient data loading Increased mobile usage, low-powered devices and sloppy networks were the initial reasons why Facebook developed GraphQL. GraphQL minimizes the amount of data that needs to be transferred over the network and thus majorly improves applications operating under these conditions.

2. Variety of different frontend frameworks and platforms The heterogeneous landscape of frontend frameworks and platforms that run client applications makes it difficult to build and maintain one API that would fit the requirements of all. With GraphQL, each client can access precisely the data it needs.

3. Fast development & expectation for rapid feature development Continuous deployment has become a standard for many companies, rapid iterations and frequent product updates are indispensable. With REST APIs, the way data is exposed by the server often needs to be modified to account for specific requirements and design changes on the client-side. This hinders fast development practices and product iterations.

What you will learn?

 This course will cover these following topics

  • Getting Started with GraphQL and NodeJs
  • CURD Operations with GraphQL, NodeJs, and MongoDB
  • Authentication and Authorization in GraphQL, NodeJs and MongoDB
  • Pagination, Filtering, And Sorting in GraphQL
  • Fragments, Interfaces, and Unions in GraphQL
  • Subscriptions and Data Loaders in GraphQL
  • Caching and Batching in GraphQL
  • Testing with Jest in GraphQL and NodeJs

Who this course is for:

  • NodeJs developers who want learn about GraphQL
  • Developers who have basic knowledge of GraphQL but want to learn more advanced concepts in GraphQL
  • Developers who want to learn how to build GraphQL APIs
  • Developers who want to learn how to implement Authentication, Subscriptions, Testing, and Caching in GraphQL