graphql_query
Execute GraphQL queries to retrieve live NPAC porting data or static telecom reference information from LSMS and LERG databases.
Instructions
Execute GraphQL queries against LSMS or LERG. These are DISTINCT APIs with different schemas — do not mix their syntax.
LSMS (service='lsms'): Live NPAC porting data. Uses named query parameters (NOT FilterInput). Key queries: subscriptionVersion(phoneNumber), subscriptionVersionsByLrn(lrn, limit), subscriptionVersionsBySpid(spid, limit), numberBlock(npanxxx), serviceProviders(limit), locationRoutingNumber(lrn), npanxxBySpid(spid, limit), lsmsStats. Relationships: subscriptionVersion→serviceProvider, →lrnMetadata. Safety limits: max 1000 results, 10s timeout. Large tables (subscriptionVersions 514M rows) MUST be filtered.
LERG (service='lerg'): Static telecom reference. Uses FilterInput with operators. 27 tables with camelCase names (lerg1, lerg6, lerg7Sha). Return fields MUST be camelCase (ocnName not ocn_name). LIKE patterns MUST be UPPERCASE. Filter syntax: { field: "ocnName", op: LIKE, value: "%VERIZON%" }. IN uses 'values' plural. Relationships: lerg6→carrier, →switchInfo, →homingArrangements. Also supports dynamicJoin for arbitrary cross-table SQL joins.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL query string | |
| service | Yes | Target service: 'lsms' for live porting data, 'lerg' for static telecom reference | |
| variables | No | Optional GraphQL variables |