Skip to content

Epic: Implement GraphQL MVP for Concepts and Sources #2757

Description

@filiperochalopes

@snyaggarwal Related to:

User story

As an OCL API consumer, I want a GraphQL interface for Concepts and Sources so that applications can request only the data they need while preserving OCL as the authoritative source.

Use case

CIEL Lab frequently needs authoritative reads from OCL, especially around concept retrieval and validation after writes.

Using the full REST representation can add unnecessary payload and latency when only a small subset of fields is required.

Check this benchmark bench-concept-editor-detail-load.md

The GraphQL MVP should focus on Concepts and Sources, with a shared authorization model across REST and GraphQL.

Requirements

  • Add a GraphQL endpoint to OCL.
  • Support queries for Concepts.
  • Support queries for Sources.
  • Allow clients to select only the fields required by the request.
  • Reuse the same permission and visibility rules used by the REST API.
  • Centralize permission evaluation so REST and GraphQL do not implement divergent authorization logic.
  • Preserve the existing REST API behavior.

Query execution strategy

  • Allow GraphQL query execution to select the most efficient backend based on the requested fields.
  • If the requested payload can be fully satisfied by Elasticsearch, return the result directly from Elasticsearch without unnecessary database hydration.
  • If requested fields require authoritative relational data, enrich/hydrate the Elasticsearch result using the database.
  • Avoid database queries when the requested GraphQL selection set does not require them.
  • Ensure both execution paths respect the same authorization rules.

Acceptance criteria

  • An authenticated client can query Concepts through GraphQL.
  • An authenticated client can query Sources through GraphQL.
  • The client can explicitly control the returned fields through the GraphQL selection set.
  • Simple queries that can be satisfied entirely by Elasticsearch do not unnecessarily access the database.
  • Queries requiring additional fields correctly hydrate data from the database.
  • REST and GraphQL apply the same permissions for equivalent resources.
  • GraphQL responses remain consistent with OCL authoritative data.
  • Existing REST consumers are unaffected.

Activity

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

Metadata

Metadata

Labels

signal/has-dependenciesRelies on other work or external inputssignal/large-scopeAffects multiple areas or systemssignal/needs-specMissing detail or ambiguous requirementsstage/triagedAI triage complete — scored and classifiedtype/featureNew or improved functionality

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions