fix: bug with parsing variables in roles_query

This commit is contained in:
Vikram Rangnekar
2020-06-04 21:55:52 -04:00
parent 82cc712a93
commit bd157290f6
16 changed files with 159 additions and 113 deletions

View File

@ -2,8 +2,9 @@ package qcode
import (
"errors"
"github.com/chirino/graphql/schema"
"testing"
"github.com/chirino/graphql/schema"
)
func TestCompile1(t *testing.T) {
@ -130,6 +131,22 @@ updateThread {
}
func TestFragmentsCompile(t *testing.T) {
gql := `
fragment userFields on user {
name
email
}
query { users { ...userFields } }`
qcompile, _ := NewCompiler(Config{})
_, err := qcompile.Compile([]byte(gql), "anon")
if err == nil {
t.Fatal(errors.New("expecting an error"))
}
}
var gql = []byte(`
{products(
# returns only 30 items