Query Linked Data using GraphQL queries and JSON-LD contexts. v2.0.0 converts GraphQL queries to SPARQL, executes them via local or remote engines, and returns tree-structured results. Bridges the gap between GraphQL developers and RDF/SPARQL ecosystems. Requires a separate query engine package (graphql-ld-comunica or graphql-ld-sparqlendpoint).
npm install graphql-ldNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup: create a Client with a JSON-LD context and a Comunica query engine, then execute a simple GraphQL query.
Provide a queryEngine instance, e.g., new QueryEngineComunica({...}).Use the graphql-ld-sparqlendpoint package instead and pass its engine to 'queryEngine'.
Include @single in your GraphQL query if you expect a single result.
Use import syntax in ES modules. If required CommonJS, use dynamic import() or ensure bundler compatibility.
new Client({ context, queryEngine: new QueryEngineComunica({...}) })Ensure sources array is present: new QueryEngineComunica({ sources: [...] })Double-check the GraphQL query syntax and JSON-LD context JSON formatting.