Open MattReimer opened 3 years ago
I am not in front of my computer at the moment but the syntax should be:
data = query("samples", limit=10, offset= 0, pointDistance= list(latitude=40, longitude= -108, distance= 50000))
I will test this when I get back.
Yeah, I thought it would be something like that too. I just found the list syntax but I get:
data = query("samples", limit=10, offset= 0, pointDistance= list(latitude=40, longitude= -108, distance= 50000))
Retrieving data: Error: Query Execution Error:
Expected type QueryDistance, found ["40", "-108", "50000"].
Must be a typing issue. No idea how that works in R. Sorry I can't be more useful
I will also add the logic required to have objects as arguments to endpoints which will push that to the docs.
Ok so QueryDistance is a defined graphql type. I knew that would come back to bite me. I limited the graphql parameter and field types to a set of basic types of instead of introspecting the additional type layer. I left it at the name and did not introspect the next level knowing if we were to have any complex type requirements it would need adjusting. I will add that to the introspection and everything will fall into place once that is complete.
Thanks @David-Fowler. Yeah QueryDistance is a type we define . We should have warned you that non-simple input types were coming. I hope it doesn't introduce too much of a headache.
That said, having GraphQL InputTypes supported was always going to be needed sooner or later, especially when mutations start gaining complexity so better now than later.
Let me know if I can provide anything more to help.
I don't think this is a bug. I just don't know how to do it.
from the API docs for
samples
:QueryDistance
QueryDistance is an object like
So I would expect this to go into the query like:
But that doesn't work and I'm not an R expert. thoughts @David-Fowler ?