Schools (schools)
The schools query reads the Insights Schools OData entity. Each School node is one school record; filters are flat OData column names (no nested filter objects like Base Property).
Connection result
| Field | Type | Description |
|---|---|---|
totalCount | Int! | Row count for the filter. |
nodes | [School] | School records for this page. |
Endpoint
POST /graphqlRoot query (example)
query SchoolsQuery(
$filter: SchoolFilter!
$limit: Int
$offset: Int
$orderBy: SchoolSort
) {
schools(filter: $filter, limit: $limit, offset: $offset, orderBy: $orderBy) {
totalCount
nodes {
id
name
status
modificationTimestamp
location {
address { city stateOrProvince postalCode }
gis { countyFipsCode latitude longitude }
}
classification { level gradeRangeMin gradeRangeMax charterYN }
enrollment { studentsTotal studentTeacherRatio }
district { id name status }
testScores { testYear subjectName percentMetStandard }
schoolRatings { schoolRating schoolRank schoolRankYear }
}
}
}Variables (example)
{
"filter": {
"stateOrProvince": { "eq": "CA" },
"city": { "contains": "Los Angeles" }
},
"limit": 25,
"offset": 0,
"orderBy": { "name": "ASC" }
}How filtering works
- Flat filters: Every key on
SchoolFiltermaps to a single OData property (e.g.city,studentsTotal,latitude). There is nolocation.address.citypath in the filter - usecitydirectly. - Operators: Same primitives as elsewhere:
StringFilter(eq, contains, startswith), plusIntFilter,FloatFilter, andBooleanFilterfor fields such ascharterYN. - Combining: Resolver wraps plain objects in
{ and: ... }when you omit explicitandoror. - Strings in OData: Insights double-quotes certain school string literals for OData compatibility - handled inside the API client.
| SchoolFilter (examples) | Purpose |
|---|---|
id, districtId, name, status | Identity and lifecycle. |
unparsedAddress, city, stateOrProvince, postalCode, … | Address matching. |
countyFipsCode, countyOrParish | Geography filters. |
level, gradeRangeMin, gradeRangeMax | Grade span. |
charterYN, magnetYN, privateYN, virtualYN | Program flags. |
studentsTotal, studentTeacherRatio, graduationRate, … | Numeric metrics. |
latitude, longitude | Geo bounds / proximity filters. |
How sorting works
SchoolSort exposes top-level fields only. Mapped OData columns include:
| Sort field | Notes |
|---|---|
name, city, stateOrProvince, status | Lexical / status ordering. |
studentsTotal | Enrollment size. |
graduationRate | School-level graduation metric. |
Directions: ASC or DESC. Only one field per group is typical; multiple entries depend on server mapping (comma-separated OData).
How expansion works
district: Resolver loadsSchoolDistrictviadistrictId+ DataLoader (batched).testScores: Loads TestScores rows whereschoolIdequals this school’sid.schoolRatings: Loads accountability/rating rows for the school id.- Omit these fields in the GraphQL selection set when you do not need them to reduce Insights calls.
School - fields by level (schema)
| Field | Description / child type |
|---|---|
id, name, status, modificationTimestamp | Core identifiers and freshness. |
location | SchoolLocation -> address (SchoolAddress), gis (SchoolGIS). |
contact | SchoolContact (website, phone). |
classification | SchoolClassification (level, grades, charter/magnet/private/virtual flags). |
enrollment | SchoolEnrollment (counts, ratios, demographics). |
spending | SchoolSpending (per-pupil and federal/state splits). |
graduation | SchoolGraduation (rate + year). |
district | Optional SchoolDistrict parent. |
testScores | [TestScore!]! - assessment outcome rows. |
schoolRatings | [SchoolRating!]! - rating/rank rows. |
Pagination
limit maps to OData $top, and offset maps to $skip.