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

Sgqlc does not throw an eror when a filter of an invalid field is given #66

Open
mike-sosa-sofarocean opened this issue Oct 8, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mike-sosa-sofarocean
Copy link

For example if we have a input

class DogInput(sgqlc.types.Input):
     __schema__ = wex_schema
    birth_date = sgqlc.types.Field(ZonedDateTime, graphql_name='birthDate')

and we run a query with given filter

[{expression: GREATER_THAN_OR_EQUAL_TO, value: {adoptionAge: 3}}]

Then instead of throwing an error since DogInput doesn't have an adoption_age field, sgqlc will simply send the query with filter input

[{expression: GREATER_THAN_OR_EQUAL_TO, value: {}}]

Is this the intended result? And if so, is there a way of turning on error logging/debugging. It would be nice to know that the filters that you are trying to apply aren't valid.

@barbieri barbieri self-assigned this Oct 8, 2019
@barbieri barbieri added the bug Something isn't working label Oct 8, 2019
@barbieri
Copy link
Member

barbieri commented Oct 8, 2019

It's due the origin where the fields are looked, instead of looking at the given object (with extra fields), I do look at the known fields in the actual type.

I'll see if I can change this, it's been some time since I wrote it, but I recall for input objects I tried to be "more relaxed" allowing both the Python and GraphQL naming, thus this "direction".

However I'm bit busy, may take a while to look at it :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants