3

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.