I'm new to both Hasura/Graphql and GO. I've succeeded in writing a couple of Hasura actions which are supported by a GO server which in turn calls the Hasura server to run a query. These both work. For some reason the third one does not and I cannot see why. I don't get any errors from my GO server. It just doesn't return the same result as running the query directly in Hasura GraphiQL and I would be much appreciative of any help someone can provide.
I've defined an Action as follows -
type Query {
lookupCostCentreLocalDB (
arg1: InputCostCentreAndId!
): ValidCostCentreDtl
}
input InputCostCentreAndId {
costCentre : String!
altId : String!
}
type ValidCostCentreDtl {
validCostCentre : String!
}
When I run the following query from the Hasura GraphiQL it works fine
query {GLW_GL_MAP (where: {_and: [{C3_Cost_Centre: {_eq: "8106"}},{idAlt: {_eq: 2}}]}){C3_Cost_Centre}}
and returns a cost centre
The action triggers my GO Server which builds the same query inserting the parameters and sends it to the Hasura URL
//Extract the data returned into the QueryResult data structure
var queryResult QueryLocalGLWCostCentre
err = json.Unmarshal(bodyBytes, &queryResult)
if err != nil {
fmt.Println("Unmarshal queryResult failed")
panic(err)
}
fmt.Println("bodyBytes =:", bodyBytes, "RESULT Length: ", len(queryResult.Data.GLWGLMAP), "queryResult=", queryResult, "queryResult.Data.GLWGLMAP=", queryResult.Data.GLWGLMAP)
Hi
I'm new to both Hasura/Graphql and GO. I've succeeded in writing a couple of Hasura actions which are supported by a GO server which in turn calls the Hasura server to run a query. These both work. For some reason the third one does not and I cannot see why. I don't get any errors from my GO server. It just doesn't return the same result as running the query directly in Hasura GraphiQL and I would be much appreciative of any help someone can provide.
I've defined an Action as follows -
When I run the following query from the Hasura GraphiQL it works fine
query {GLW_GL_MAP (where: {_and: [{C3_Cost_Centre: {_eq: "8106"}},{idAlt: {_eq: 2}}]}){C3_Cost_Centre}}
and returns a cost centreThe action triggers my GO Server which builds the same query inserting the parameters and sends it to the Hasura URL
but it returns a different result - in this case it does not return a cost centre. The call to Hasura is done as follows
The result of the Println statements is
The following is a breakdown of the response
My GO struct for the response is as follows -
Can anyone provide any clues on what my problem is?
Regards