go-graphql-client icon indicating copy to clipboard operation
go-graphql-client copied to clipboard

ExecRaw does not respect OperationName option

Open bhoriuchi opened this issue 1 year ago • 1 comments

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

bhoriuchi avatar Jun 21 '23 17:06 bhoriuchi

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.

hgiasac avatar Jun 21 '23 17:06 hgiasac