Skip to Content
GraphQLSchool districts

School districts (schoolDistricts)

The schoolDistricts query reads the Insights SchoolDistricts OData entity. Filters use flat district columns; expansions load related schools and test rows by foreign key.

Connection result

FieldTypeDescription
totalCountInt!District rows matching the filter.
nodes[SchoolDistrict]District records for this page.

Endpoint

POST /graphql

Root query (example)

query SchoolDistrictsQuery( $filter: SchoolDistrictFilter! $limit: Int $offset: Int $orderBy: SchoolDistrictSort ) { schoolDistricts( filter: $filter limit: $limit offset: $offset orderBy: $orderBy ) { totalCount nodes { id name status modificationTimestamp location { address { city stateOrProvince postalCode } gis { countyFipsCode countyOrParish } } composition { gradeRangeMin gradeRangeMax numberElementarySchools numberMiddleSchools numberHighSchools } ratings { districtRating districtRank districtRankYear } graduation { graduationRate graduationRateYear } schools { id name level status } testScores { testYear subjectName percentMetStandard } } } }

Variables (example)

{ "filter": { "stateOrProvince": { "eq": "TX" }, "name": { "contains": "Independent" } }, "limit": 10, "offset": 0, "orderBy": { "name": "ASC" } }

How filtering works

  • Flat filters: Keys on SchoolDistrictFilter map 1:1 to OData properties (e.g. name, city, districtRating, numberElementarySchools).
  • Operators: Identical vocabulary to schools (eq, contains, startswith, plus numeric comparisons).
  • Combining: Implicit and wrapping when and or or is omitted at the top level.
SchoolDistrictFilter (examples)Purpose
id, name, statusIdentity.
unparsedAddress, city, stateOrProvince, postal fieldsDistrict office address.
countyFipsCode, countyOrParishRegional filters.
gradeRangeMin, gradeRangeMaxDistrict-wide grade span.
numberElementarySchools, numberMiddleSchools, numberHighSchoolsComposition counts.
districtRating, districtRank, districtRankOf, districtRankYearAccountability metrics.
graduationRate, graduationRateYearDistrict graduation filters.

How sorting works

SchoolDistrictSort fieldTypical use
name, city, stateOrProvince, statusLexical ordering.
districtRating, districtRankPerformance ordering.
graduationRateOutcome ordering.

How expansion works

  • schools: Batch-fetches all School rows whose districtId equals this district’s id (large result sets possible - use pagination on the parent query and narrow filters).
  • testScores: TestScores joined with schoolId equal to the district id (same identifier space as documented on TestScore).

SchoolDistrict - fields by level (schema)

FieldDescription / child type
id, name, status, modificationTimestampCore identifiers.
locationSchoolDistrictLocation -> address, gis.
compositionSchoolDistrictComposition (grade span, school counts).
ratingsSchoolDistrictRatings.
graduationSchoolDistrictGraduation.
schools[School!]! - member schools (expanded query).
testScores[TestScore!]! - linked assessments.

Pagination

Same as schools: limit maps to OData $top, and offset maps to $skip.