@@ -58,8 +58,8 @@ func constructOptions(options []Option) (*constructOptionsOutput, error) {
5858}
5959
6060func constructQuery (
61- v interface {} ,
62- variables map [string ]interface {} ,
61+ v any ,
62+ variables map [string ]any ,
6363 options ... Option ,
6464) (string , * constructOptionsOutput , error ) {
6565 query , err := query (v )
@@ -96,8 +96,8 @@ func constructQuery(
9696
9797// ConstructQuery build GraphQL query string from struct and variables.
9898func ConstructQuery (
99- v interface {} ,
100- variables map [string ]interface {} ,
99+ v any ,
100+ variables map [string ]any ,
101101 options ... Option ,
102102) (string , error ) {
103103 query , _ , err := constructQuery (v , variables , options ... )
@@ -109,8 +109,8 @@ func ConstructQuery(
109109}
110110
111111func constructMutation (
112- v interface {} ,
113- variables map [string ]interface {} ,
112+ v any ,
113+ variables map [string ]any ,
114114 options ... Option ,
115115) (string , * constructOptionsOutput , error ) {
116116 query , err := query (v )
@@ -147,8 +147,8 @@ func constructMutation(
147147
148148// ConstructMutation build GraphQL mutation string from struct and variables.
149149func ConstructMutation (
150- v interface {} ,
151- variables map [string ]interface {} ,
150+ v any ,
151+ variables map [string ]any ,
152152 options ... Option ,
153153) (string , error ) {
154154 query , _ , err := constructMutation (v , variables , options ... )
@@ -161,8 +161,8 @@ func ConstructMutation(
161161
162162// ConstructSubscription build GraphQL subscription string from struct and variables.
163163func ConstructSubscription (
164- v interface {} ,
165- variables map [string ]interface {} ,
164+ v any ,
165+ variables map [string ]any ,
166166 options ... Option ,
167167) (string , string , error ) {
168168 query , err := query (v )
@@ -200,7 +200,7 @@ func ConstructSubscription(
200200// queryArguments constructs a minified arguments string for variables.
201201//
202202// E.g., map[string]interface{}{"a": int(123), "b": true} -> "$a:Int!$b:Boolean!".
203- func queryArguments (variables map [string ]interface {} ) string {
203+ func queryArguments (variables map [string ]any ) string {
204204 // Sort keys in order to produce deterministic output for testing purposes.
205205 // TODO: If tests can be made to work with non-deterministic output, then no need to sort.
206206 keys := make ([]string , 0 , len (variables ))
@@ -228,7 +228,7 @@ func queryArguments(variables map[string]interface{}) string {
228228// writeArgumentType writes a minified GraphQL type for t to w.
229229// value indicates whether t is a value (required) type or pointer (optional) type.
230230// If value is true, then "!" is written at the end of t.
231- func writeArgumentType (w io.Writer , t reflect.Type , v interface {} , value bool ) {
231+ func writeArgumentType (w io.Writer , t reflect.Type , v any , value bool ) {
232232 if t .Implements (graphqlTypeInterface ) {
233233 var graphqlType GraphQLType
234234 var ok bool
@@ -293,7 +293,7 @@ func writeArgumentType(w io.Writer, t reflect.Type, v interface{}, value bool) {
293293// a minified query string from the provided struct v.
294294//
295295// E.g., struct{Foo Int, BarBaz *bool} -> "{foo,barBaz}".
296- func query (v interface {} ) (string , error ) {
296+ func query (v any ) (string , error ) {
297297 var buf bytes.Buffer
298298
299299 err := writeQuery (& buf , reflect .TypeOf (v ), reflect .ValueOf (v ), false )
0 commit comments