khaosdoctor / gotql

GraphQL query utility for serverside apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Query is not parsed correctly for where:{ _and :[] }

mesudip opened this issue · comments

Am i missing something

gotql.parser(
    {
        operation: {
            name: "Metadata",
            args: {
                where: {
                    _and: [
                        { hash: { _in: ['a','b'] } }
                        ,{pool:{ _eq:32}}
                        ]
                }
            },
            fields: ["key", "value"]
        }
    },
    'query'
)

>>> query { Metadata(where: { _and: ["[object Object]", "[object Object]"] }) { key value } }

if (isArray(argValue)) return `["${(argValue as unknown as Array<any>).join('","')}"]` // Check for array values (#35)

This is the culprit line. I couldn't fix it due to Type mismatch errors. Typescript is beyond me.

I think this is due to some JSON conversion, thanks for the issue! I'll look into it!

Sorry about the delay, had a very busy month. I'm taking care of this today.