3 ms·
One thing I've been curious about with GraphQL and supporting libraries. All the examples I've seen have a hardcoded schema definition, which makes sense becau
by owyn 11y ago
One thing I've been curious about with GraphQL and supporting libraries. All the examples I've seen have a hardcoded schema definition, which makes sense because they're just small examples. What if the schema itself is dynamic or stored in a db, with separate schema for every user of an API. Fetching the schema and loading it into the library on every request seems inefficient, although I suppose you could cache it, but I haven't seen any libraries or examples that address that problem.
- andrewingram 11y agoWhat's an actual use case for this? It sounds pretty obscure, so it's not surprising you haven't seen any examples of it.
- owyn 11y agoI was thinking of a user defined schema or ontology for a wiki, allowing the user to also create simple queries for their own data. The example data for a lot of GraphQL tools is Star Wars characters, movies and space-ships. If you look at the Star Wars wiki, it can get a lot more complicated, but it's not something you would want to hard code because new types and relationships are being added all the type. The simplicity of the schemas and queries in GraphQL, and the existence of UI tools out of the box, it seems a lot more approachable than something like WikiData or Semantic Mediawiki.