Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mesudip opened this issue Feb 2, 2021 · 3 comments · Fixed by #54
Closed

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

mesudip opened this issue Feb 2, 2021 · 3 comments · Fixed by #54
Assignees
Labels

Comments

@mesudip
Copy link

mesudip commented Feb 2, 2021

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 } }

@mesudip mesudip added the bug label Feb 2, 2021
@mesudip mesudip changed the title [BUG] [BUG] Query is not parsed correctly for where:{ _and :[] } Feb 2, 2021
@mesudip
Copy link
Author

mesudip commented Feb 2, 2021

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.

@khaosdoctor
Copy link
Owner

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

@khaosdoctor
Copy link
Owner

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

@khaosdoctor khaosdoctor self-assigned this Mar 6, 2021
roziscoding added a commit that referenced this issue Mar 6, 2021
Co-authored-by: Lucas Santos <[email protected]>
khaosdoctor added a commit that referenced this issue Mar 6, 2021
Co-authored-by: Lucas Santos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants