Courses / Data, AI & infrastructure / GraphQL APIs

₹99Self-paced

GraphQL APIs

Build a GraphQL API on Node.js with a typed schema, batched resolvers, authorization rules, cursor paging and a contract test suite.

  • Who it's for. JavaScript developers who already build REST APIs and want to design and protect a GraphQL service.
  • Before you start. You can write intermediate JavaScript (async/await, modules, arrays and objects), run Node.js scripts and npm commands, read and write JSON, and read a raw HTTP request and response.
  • 29 to 50 hours of study with practice
  • 8 modules, 50 lessons
  • 4 guided projects and a final project

What you'll learn

  • Read and write a GraphQL schema in SDL with correct nullability, enums, inputs, interfaces, unions and a custom scalar.
  • Eliminate N+1 lookups with request-scoped DataLoader batching and prove it with repository call counts.
  • Enforce authorization in a domain-layer policy invoked from resolvers, with a tested permission matrix.
  • Paginate with cursor connections and predict error and null-propagation shapes against the specification.
  • Protect the contract with SDL snapshots, breaking-change classification, in-process operation, error-shape and cost-limit tests.

Skills you'll gain

  • Schema
  • types
  • Queries
  • resolvers
  • Mutations
  • validation
  • Relationships
  • batching
  • Authorization
  • Pagination
  • errors
  • Query complexity
  • Contract tests

Tools you'll use

  • GraphQL SDL
  • GraphQL Yoga
  • Node.js
  • npm
  • DataLoader
  • JavaScript

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 8 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 3 phases

Each phase ends with something you have built and checked.

  1. 01

    Modules 1 to 3

    Schema, queries and mutations

    Write a schema in SDL, implement query resolvers with per-request context, and design mutations with coded validation errors.

    You build: Guided project: ToolShare read API: typed schema and resolvers.

  2. 02

    Modules 4 to 6

    Batching, access and paging

    Remove N+1 lookups with DataLoader, enforce authorization in a domain policy, and page collections with cursor connections and predictable errors.

    You build: Guided project: ToolShare writes and batched relationships; ToolShare access control, paging and error contract.

  3. 03

    Modules 7 to 8

    Cost limits and contract tests

    Estimate and limit query cost before execution, then protect the API with SDL snapshots, breaking-change checks and operation tests.

    You build: Guided project: ToolShare cost gate and contract suite.

Full curriculum

8 modules and 50 lessons, 29 to 50 hours of study

01Schema and types7 lessons, 3 to 5 hours

Lessons

  • One endpoint and the request and response maps
  • Object types, scalar fields and the Query root in SDL
  • Reading nullability: non-null and list modifiers
  • Enums and input objects for constrained values
  • Interfaces and unions with type resolution
  • Custom scalars for dates and validated values
  • Schema design conventions from use cases

After this module you can

  • Send a query, variables and operationName in a JSON body to an in-process Yoga server and name which top-level keys appear in the response.
  • Write SDL object types with built-in scalar fields and reachable Query fields, then request nested selections that stop at scalar leaves.
  • Rewrite a data-shaped schema into a use-case-shaped schema by applying naming, nullability, argument and payload conventions, and justify each change.
02Queries and resolvers6 lessons, 3 to 4 hours

Lessons

  • The four resolver arguments and default resolution
  • Arguments, variables and default values
  • Aliases, fragments and the skip and include directives
  • Parent-child resolution through nested objects
  • Per-request context and who builds it
  • Introspection and the __typename meta field

After this module you can

  • Write a resolver that uses parent, args, context and info correctly and predict when GraphQL falls back to the default property-reading resolver.
  • Declare field arguments with defaults, pass values through the variables map, and explain how coercion rejects a mistyped variable before execution.
  • Query the schema with __schema and __type, read field names, types and descriptions, and explain what introspection reveals to any client.
03Mutations and validation6 lessons, 3 to 4 hours

Lessons

  • Mutation operations and serial execution of root fields
  • Input objects and payload types for mutations
  • Two validation layers: the document and the data
  • Domain validation with GraphQLError and extension codes
  • Repeat-safe mutations with client-supplied keys
  • Subscriptions: publishing change events as a stream

After this module you can

  • Send a mutation with two root fields and demonstrate from a call log that they run one after another, unlike query root fields.
  • Design a mutation that takes one input object and returns a payload type with the changed record, and justify the shape against a scalar-argument alternative.
  • Define a Subscription field backed by an async generator, publish an event from a mutation, and assert the received event in a test.
04Relationships and batching6 lessons, 3 to 4 hours

Lessons

  • Relationship fields in both directions
  • Counting repository calls to reveal N+1
  • The DataLoader batch function contract
  • Per-request loader lifecycle in context
  • Batching one-to-many lookups with grouped keys
  • Loader pitfalls: cache clearing, limits and mutation interplay

After this module you can

  • Add relationship fields in both directions (Loan.tool and Tool.loans) and explain the cycle risk of unbounded nested queries.
  • Instrument a repository with a call counter and show a list query causing one list call plus one lookup per row.
  • Clear or prime a loader after a mutation, cap batch size, and show a stale-read bug caused by a missing clear.
05Authorization6 lessons, 3 to 4 hours

Lessons

  • Attaching the authenticated viewer to the context
  • Keeping rules in a domain layer, not in each resolver
  • Field-level authorization: null versus error
  • Object-level checks: ids and ownership
  • Role- and ownership-gated mutations with a permission matrix
  • Authorization and batching: keeping loaders from leaking

After this module you can

  • Verify a bearer credential in the context factory, attach a viewer or null, and distinguish unauthenticated from forbidden outcomes.
  • Move a permission rule into a policy module that resolvers call, and show two entry points returning the same decision.
  • Show how a viewer-agnostic loader can return a record the viewer may not see, and fix it by authorising after loading or scoping the loader to the viewer.
06Pagination and errors6 lessons, 3 to 4 hours

Lessons

  • Cursor connections: edges, nodes and pageInfo
  • Opaque cursors and stable ordering
  • first and after arguments, page caps and bad cursors
  • Error anatomy: request errors, execution errors and the errors array
  • Null propagation and partial data
  • Designing error contracts: masking, codes and expected failures

After this module you can

  • Write the SDL for a connection type and read a response that has edges, node, cursor and pageInfo.
  • Encode a position as an opaque cursor over a stable ordering with a unique tie-breaker, and decode it safely.
  • Decide which failures are errors with codes and which are modelled as data, mask unexpected errors, and document the codes.
07Query complexity6 lessons, 3 to 4 hours

Lessons

  • Why one request can cost so much: nesting, lists and aliases
  • Measuring depth and breadth from the parsed document
  • Static cost estimation with field weights and list multipliers
  • Rejecting operations before execution
  • Breadth abuse: aliases, batching and timeouts at concept level
  • Trusted documents and introspection policy

After this module you can

  • Estimate by hand the number of objects a nested list query can return and show how aliases multiply work without deeper nesting.
  • Parse an operation with graphql-js and compute its maximum field depth and alias count, treating fragments correctly.
  • Explain what trusted (persisted) operations change about the attack surface and decide an introspection policy for development and production.
08Contract tests7 lessons, 3 to 5 hours

Lessons

  • Schema snapshots with printSchema
  • Classifying schema changes as breaking, dangerous or safe
  • Retiring a field with @deprecated and a removal plan
  • In-process operation tests on seeded data
  • Error-shape contract tests
  • Cost-limit regression tests and the capstone gate
  • The client contract: variables, errors and typed documents

After this module you can

  • Generate a deterministic SDL snapshot from the executable schema and fail a test when the committed snapshot differs.
  • Classify each of ten SDL changes as breaking, potentially dangerous or safe for existing clients, with a reason from the client's point of view.
  • Write a client call that sends variables, reads data and errors separately and degrades safely when a field errors, and state what a typed-document tool adds.

What you'll build

4 guided projects along the way, then a final project.

  • ToolShare read API: typed schema and resolvers

    after module 2
  • ToolShare writes and batched relationships

    after module 4
  • ToolShare access control, paging and error contract

    after module 6
  • ToolShare cost gate and contract suite

    after module 8

Final project

GraphQL service with schema authorization and query-cost tests. Choose one option: Option A, tool-lending service (ToolShare): schema, loaders, authorization policy, cursor paging and a cost gate for members, tools and loans.

What you submit

Source submission: repository with SDL, resolvers, policy module, loaders and tests, plus a short setup guide that starts from a clean checkout.

How it's reviewed

Trainer-reviewed live demonstration: the learner runs the service, issues requests live, shows the batching call counts, a denied request, a rejected expensive query and the contract test run. Marked against the course project review rubric.

Where you'll use it

  • Remove N+1 database lookups from an API by batching with DataLoader and proving the call count.
  • Classify a schema change as breaking or safe and retire a field through deprecation.

Roles that use these skills

  • Backend developer
  • API developer
  • Full-stack developer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What should I know first?

Intermediate JavaScript with async/await, running Node.js and npm, JSON, and REST API Design.

What will I build?

One service such as ToolShare, a clinic appointment service or a conference programme service, with at least 25 in-process tests and a live demonstration.

How is GraphQL APIs structured, and is it open now?

It has 8 modules and 50 lessons. It is not yet released to learners.

Be first in when GraphQL APIs opens

Email us and we will tell you as soon as enrolment opens.

Notify me when it opens
₹99Opens soon
Notify me