Open xmlking opened 1 year ago
I am using Hasura scheme. the generated code is using a redeclared variable which is causing 'data' redeclared in this block error.
'data' redeclared in this block
I have to mutually edit UpsertDeviceResponse from data to data2 is there any workaround?
UpsertDeviceResponse
data
data2
func UpsertDevice( ctx context.Context, client graphql.Client, data Devices_insert_input, ) (*UpsertDeviceResponse, error) { req := &graphql.Request{ OpName: "UpsertDevice", Query: UpsertDevice_Operation, Variables: &__UpsertDeviceInput{ Data: data, }, } var err error var data2 UpsertDeviceResponse resp := &graphql.Response{Data: &data} err = client.MakeRequest( ctx, req, resp, ) return &data2, err }
mutation UpsertDevice($data: devices_insert_input!) { insert_devices_one(object: $data, on_conflict: {update_columns: [ip, description, tags, annotations], constraint: devices_display_name_organization_key, where: {deletedAt: {_is_null: true}}}) { annotations ip id displayName ... } }
Common cases of this are fixed in #291. Leaving this open for a general fix.
I am using Hasura scheme. the generated code is using a redeclared variable which is causing
'data' redeclared in this block
error.I have to mutually edit
UpsertDeviceResponse
fromdata
todata2
is there any workaround?manual fix
query
'data' redeclared in this block