Skip to content

GraphQL feature provider #2421

Description

@lcalisto

Is your feature request related to a problem? Please describe.

Not a problem, more a gap. In GraphQL for geospatial APIs workshop I've been giving, a recurring question is how to bridge existing GraphQL backends with OGC API standards. Right now there's no way to publish a GraphQL endpoint through pygeoapi without building a custom provider from scratch.

Describe the solution you'd like

GraphQL as a data source, a feature provider that sits in front of an existing GraphQL endpoint and publishes it as OGC API Features, translating the request params (limit/offset, property filters, bbox when the schema has a spatial filter) into a GraphQL query and mapping the response to GeoJSON. Something as:

client -> OGC API Features (pygeoapi) -> GraphQL provider -> existing GraphQL API

The thing is GraphQL has no standard schema, so the provider config would need a query template, field mappings and a pagination strategy per collection. Perhaps heavy YAML than the usual providers, which is why I'm asking before writing anything.

I'm volunteering to implement this. I can use WoSIS at ISRIC, which has a public GraphQL API, so I have a real backend to develop and test against. What I'm looking for is feedback on whether the approach fits, and whether this belongs in core or in pygeoapi-plugins (alongside CKAN/SPARQL).

Describe alternatives you've considered

  • Exposing GraphQL query syntax to clients on top of pygeoapi: discarded because it goes against OGC API Features conformance and CQL2 already fills the client-side filtering role. I don't see the added value.

Additional context

The closest prior mention of GraphQL I found is #222, but that was about the server framework side (Starlette), not a data provider, I don't think there's any overlap.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions