rubensworks / GraphQL-LD.js

Linked Data Querying with GraphQL
https://gist.github.com/rubensworks/9d6eccce996317677d71944ed1087ea6
MIT License
103 stars 7 forks source link

id not working with inline fragments #7

Open pheyvaer opened 5 years ago

pheyvaer commented 5 years ago

id does not work with the following:

Context:

{
  "Person":  { "@id": "http://schema.org/Person" }
}

Query:

{
  ... on Person {
    id @single # @single does not affect the output actually.
  }
}

Data:

@prefix schema: <http://schema.org/> .
@prefix : <http://example.com/>.

:test1 a schema:Person.

:test2 a schema:Person.

Actual result:

[ { } ]

Expected result:

[ 
  { "id": "http://example.com/test1" }, 
  { "id": "http://example.com/test2" } 
]

The code to execute the query is reused from the README and the data is hosted via the latest version of ldf-server.