Hacker News new | ask | show | jobs
by moonforeshot 3306 days ago
hope graphql would provide some standard for defining schemas with schema.org vocabulary...

graphql can be designed to incorporate most of json-ld specs (and hydra too)...

Then everyone can benefit because it's machine-friendly-annotated data everywhere :)

1 comments

A similar thought crossed my mind too. I've never used JSON-LD. I'm not quite sure where I would use it. One of the ideas was what you said.

The other idea I had is that it may help with transforming payloads from their serialized format into a static type system like TypeScript. It could be nice to have a system that can see an incoming response, validate the type using JSON-LD, and construct an instance of that object with it. It can be done without JSON-LD, but it may be useful.

...or FB can create a 'sdk-code-generation' like they did with Thrift, along with typescript generation.

Also, your idea is possible with current Typescript 2.3's language-server specs :)

But, this is quite separate from 'generic-machine understandable' data - which is what json-ld is all about.