hasura / go-graphql-client

Package graphql provides a GraphQL client implementation.
MIT License
395 stars 91 forks source link

ExecRaw does not respect OperationName option #96

Open bhoriuchi opened 1 year ago

bhoriuchi commented 1 year ago

ExecRaw takes options arguments but does not apply them. This causes issue when supplying multiple operations in a request and trying to execute a specific operation by name.

https://github.com/hasura/go-graphql-client/blob/master/graphql.go#L126

hgiasac commented 1 year ago

Hi,

Because you can input the raw GraphQL query string directly in Exec and ExecRaw methods, it doesn't worth manipulating the string to inject the operation name into it. It's very easy to inject the operation name into the GraphQL string by some builder function with fmt.Sprintf

We still add optional arguments for these methods for further extensions. However, it doesn't mean we have to support all extensions.