2020-04-10 08:27:43 +02:00
|
|
|
package core
|
2019-09-05 06:09:56 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
func simpleMutation(t *testing.T) {
|
|
|
|
gql := `mutation {
|
|
|
|
product(id: 15, insert: { name: "Test", price: 20.5 }) {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
|
|
|
|
sql := `test`
|
|
|
|
|
|
|
|
backgroundCtx := context.Background()
|
|
|
|
ctx := &coreContext{Context: backgroundCtx}
|
|
|
|
|
|
|
|
resSQL, err := compileGQLToPSQL(gql)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println(">", string(resSQL))
|
|
|
|
|
|
|
|
if string(resSQL) != sql {
|
|
|
|
t.Fatal(errNotExpected)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestCompileGQL(t *testing.T) {
|
|
|
|
t.Run("withComplexArgs", withComplexArgs)
|
|
|
|
t.Run("simpleMutation", simpleMutation)
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|