Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request expands Census data resolvers by adding a new census_values query and implementing the previously stubbed-out Tables resolver for census datasets. These changes support issue #260.
Changes:
- Added new GraphQL query
census_valuesfor querying census data by geoid, dataset, or table name - Implemented the
Tablesresolver forCensusDatasetusing a dataloader pattern - Added filtering capabilities for census values with support for exact and prefix matching on geoids
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| schema/graphql/schema.graphqls | Added census_values query and CensusValueFilter input type with filtering options |
| server/model/models_gen.go | Added CensusValueFilter struct definition |
| server/model/finders.go | Added FindCensusValues and CensusTablesByDatasetIDs method signatures to interfaces |
| server/gql/query_resolver.go | Implemented CensusValues query resolver |
| server/gql/census_resolver.go | Implemented Tables resolver using dataloader for efficient batch loading |
| server/gql/loaders.go | Added CensusTablesByDatasetIDs dataloader configuration |
| server/gql/loader_params.go | Added censusTableLoaderParam struct for dataloader parameters |
| server/finders/dbfinder/census.go | Implemented database queries for finding census values and tables by dataset IDs |
| internal/generated/gqlout/generated.go | Auto-generated GraphQL bindings and marshaling code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR expands the Census data resolvers by adding a new
values_relayfield toCensusDatasetthat supports Relay-style cursor pagination for querying census values. This enables efficient pagination through large census datasets, which is particularly useful for querying NTD agency data.Changes
GraphQL Schema
values_relayfield toCensusDatasettype with cursor pagination (first,after)CensusDatasetValueFilterinput type with filters:table- filter by table namegeoid- filter by exact geoidgeoid_prefix- filter by geoid prefix (e.g.,ntd:00001to find all values for an NTD agency)CensusValueConnection,CensusValueEdge,PageInfoTablesresolver forCensusDatasetImplementation
(geoid, table_id)encoded in base64 for stable cursor-based paginationWHERE (geoid, table_id) > (last_geoid, last_table_id)patternTesting
TestCensusResolver_DatasetValuesRelaycovering:CensusCursorencode/decode round-tripsEscapeLikehelper functionin support of interline-io/calact-network-analysis-tool#260