The second scenario is best
The second one is to build a GraphQL API that uses a database as data
source skipping the REST API.
REST and GraphQL can both be operated over HTTP, though GraphQL is protocol agnostic.
And GraphQL is the new kid in the block with lot of cool features and it solves most of the problem faced with REST like :
1.) Multiple end points to fetch data
In rest we have create multiple API endpoints
2.) Over/Under Fetching
Some time API return extra data that we don't need or less data in response
3.) Network Requests
multiple endpoint leads to more network requests
4.) Error Handling
Error handling in REST is pretty straightforward, we simply check the HTTP headers to get the status of a response. Depending on the HTTP status code ( 404, 503, 500 etc) we get, we can easily tell what the error is and how to go about resolving it. GraphQL on the other hand, when operated over HTTP, we will always get a 200 OK response status. When an error occurs while processing GraphQL queries, the complete error message is sent to the client with the response
5.) Versioning
Often when consuming third-party REST APIs, we see stuff like v1, v2, v3 etc. which simply indicate the version of the REST API we are using. This leads to code redundancy and less maintainable code. With GraphQL, there is no need for versioning as we can easily add new fields and types to our GraphQL API without impacting existing queries. Also, we can easily mark fields as deprecated and the fields will be excluded from the response gotten from the server
For detailed comparison please visit
GraphQl vs Rest
or this post
Or Official GraphQL site