fix: jit failing on anon queries

This commit is contained in:
Vikram Rangnekar 2020-06-10 00:38:46 -04:00
parent 00cfa251a2
commit 7b5548a2c6
2 changed files with 2 additions and 5 deletions

View File

@ -90,7 +90,6 @@ type SuperGraph struct {
getRole *sql.Stmt
rmap map[uint64]resolvFn
abacEnabled bool
anonExists bool
qc *qcode.Compiler
pc *psql.Compiler
ge *graphql.Engine

View File

@ -78,15 +78,13 @@ func (sg *SuperGraph) initPrepared() error {
if len(v.Query) == 0 {
continue
}
qt := qcode.GetQType(v.Query)
switch qt {
case qcode.QTQuery:
sg.queries[queryID(&h, v.Name, "user")] = &query{ai: v, qt: qt}
if sg.anonExists {
sg.queries[queryID(&h, v.Name, "anon")] = &query{ai: v, qt: qt}
}
sg.queries[queryID(&h, v.Name, "anon")] = &query{ai: v, qt: qt}
case qcode.QTMutation:
for _, role := range sg.conf.Roles {