I like @MarcintheCloud's answer, just wanted to paraphrase and give my solution to the problem.
GraphQL does not care or depend on any specific database type, KV, Graph, Document, etc and in fact markets itself as being able to fetch data from different sources. So you can create a UI to fetch the latest stock prices from redis, stock history from Mongo and similar stock by name from Elasticsearch. GraphQL will let you abstract that complexity away from your API (but it still exists elsewhere) allowing you to fetch all the data in one go. There is no relation between GraphQL and Graph databases.
Gremlin, in brief, is a powerful graph traversal comparable to what SQL is for some relational databases.
Definitions aside, how I use the both of them is by mapping GraphQL to Gremlin. I have attempted to create a standard around it https://github.com/The-Don-Himself/graphql2gremlin. Basically, it works by interchanging GraphQL arguments between vertexes and edges so a GraphQL query like this
{
users(
following: {
users: {
user_id: "eq(5)"
}
}
) {
user_id
username
bio
}
}
Means fetch a users followers for user_id 5 and get the id, username and bio fields. There are samples of much more complex GraphQL to Gremlin examples and it works perfect for my use case.
The gremlin traversal could look like this
g.V().hasLabel('users').has('user_id', eq(5)).in('following').hasLabel('users').values('user_id', 'username', 'bio')
I also open sourced a sample Twitter Graph in PHP if you want to play around with it https://github.com/The-Don-Himself/gremlin-ogm.