Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse gql query string to DocumentNode object

I am using graphql-requst node module. My problem is how can I get the operationName from the gql query string. I referenced this question, but I can't get the query's DocumentNode object. I think I can get the operationName after parse the gql string to the DocumentNode object. How can I solve this problem?

like image 534
Jose Cipriano Neto Avatar asked Aug 31 '26 18:08

Jose Cipriano Neto


1 Answers

You can't get the DocumentNode object with the graphql-request module. Please use graphql-tag instead of graphql-request.

Please reference my answer from this link.

like image 110
Cardoso Avatar answered Sep 03 '26 06:09

Cardoso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!