7 ms·
As someone with a bit more experience with these technologies, would you please describe what GraphQL actually has to do with graphs? I work with very, very lar
by eggie 11y ago
As someone with a bit more experience with these technologies, would you please describe what GraphQL actually has to do with graphs? I work with very, very large graphs. I looked at GraphQL to see if it could be of use, but as far as I can understand the graph aspect of GraphQL is marketing multiplied by doublespeak. RDF and Sparql seem to be much more apt systems in this space. So I would appreciate if you opined biased to disillusion my confusion.
- tiglionabbit 11y agoGraphQL lets you represent your API as a graph. You do this by defining a set of types that have fields in them which resolve to instances of other types. For example, if you have a "Person" type with a "friends" field that resolves to more people, you could traverse this as deeply as you wanted, like so: query { me { friends { friends { friends { friends { name } } } } } } That would get you the names of my friends of friends of friends of friends. It's a directed graph where you can traverse as many edges as you want in any direction in a single query. It's like a power tools version of your usual REST API. What more are you expecting? (in relay this would look a bit different due to the "connection" spec, but you're free to define a graphql endpoint this way too)