<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 "> The Course Data

The Course Data

Overview

The course API is the same fictional insurance company you worked on in GraphQL 101. It holds three kinds of data:

  • Policyholders: the company’s customers
  • Policies: the insurance each policyholder owns (auto, home, life, or renters)
  • Claims: requests for payment against a policy, such as after a car accident

This page shows the data the API starts with. Field names are shown exactly as you’d use them in a query.

Policyholders

id name email
ph1 Maria Alvarez maria.alvarez@example.com
ph2 James Okafor james.okafor@example.com
ph3 Priya Raman priya.raman@example.com

Policies

id policyNumber type monthlyPremium effectiveDate riskTier policyholder
p1 AUTO-100001 AUTO 142.50 2025-01-15 MEDIUM Maria Alvarez
p2 HOME-100002 HOME 98.00 2024-06-01 LOW Maria Alvarez
p3 AUTO-100003 AUTO 210.75 2025-03-10 HIGH James Okafor
p4 LIFE-100004 LIFE 45.00 2023-11-20 LOW Priya Raman
p5 RENTERS-100005 RENTERS 18.25 2025-08-01 MEDIUM Priya Raman

Policies also have two fields that aren’t stored, but calculated when you ask for them:

  • annualPremium: monthlyPremium × 12
  • totalClaimed: the total amount of the policy’s approved claims. Open and denied claims don’t count.

Claims

id claimNumber amount status filedDate policy
c1 CLM-5001 1250.00 APPROVED 2025-04-02 AUTO-100001
c2 CLM-5002 430.50 DENIED 2025-06-18 AUTO-100001
c3 CLM-5003 3800.00 APPROVED 2024-11-05 HOME-100002
c4 CLM-5004 2200.00 OPEN 2025-08-21 AUTO-100003
c5 CLM-5005 975.25 APPROVED 2025-05-09 AUTO-100003
c6 CLM-5006 640.00 OPEN 2025-09-12 RENTERS-100005

How the data is connected

  • Each policy belongs to one policyholder, and a policyholder can have several policies. Maria Alvarez has both an auto and a home policy.
  • Each claim belongs to one policy, and a policy can have several claims. AUTO-100001 has two claims, and LIFE-100004 has none.

In a query, you follow these connections with nested fields. From a policyholder you can reach their policies, and from each policy its claims, all in one request. You can also go the other way, from a claim to its policy and on to the policyholder.

Good to know

  • Your changes are saved. Policies and claims you add are written to services/policies/data.json and services/policies/claims.json, so they’re still there after the server restarts. To go back to the starting data, stop the server, run npm run reset-data in services/policies, and start it again.
  • Amounts are in US dollars. The API returns them as numbers, so trailing zeros are dropped: 975.25 comes back as 975.25, but 1250.00 comes back as 1250.