-
Notifications
You must be signed in to change notification settings - Fork 86
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
Mapping of JSON response on Operation isn't done completely #164
Comments
sgqlc doesn't do any multithread on its own, or you mean on your side? But I bet that's not the issue. I don't have time to dig into this now, but it would help me immensely if you can try to provide me an example (you can modify the existing examples, like the GitHub or Shopify). But as an advice, the |
Yeah, I know it's against the GraphQL best practices to request a lot at once. In our company it's an internal software tool that exposes a GraphQL API, and we need to use it for system testing. In this testing use case it useful to have all relevant data available from the beginning. I'm going to try to solve it by separating the 1 query in multiple ones. But even when requesting 1 level less, I still have the same issue. I'm not using multi threading. But if you follow the import chain of some packages you end up in the reprlib package which imports the _thread package. That's why I thought it could be a cause of the issue. Because I had similar issues in other projects with multi threading. Attached you can find the query used I'm afraid that I don't have the time to investigate this issue on a different example. Regarding attached query. |
I narrowed the issue down to the following: o = self.__type(other.get('data'), self.__selection_list) => self.__selection_list doesn't contain all selections |
I think I ran into this issue as well when iterating over github forks. Example included. The type of owners on repo.forks nodes changes after addition. Small example (this is line 143 and 146 of the code):
Interestingly, this does not happen with stargazers or watchers, which are also nodes. One potential difference: the owner of a fork uses sum types, as it could be either a User or an Organization. stargazers and watchers are always users. Perhaps the bug has to do with sum types in queries? The type of repo.forks.json_data shows that the type of the owner is changed from
|
In the schema we use has quite a lot of nested objects
ex.
query {
devices {
id
name
inputs {
id
type
inputSettings {
voltage
temperature
resolutionSettings {
...
}
}
}
}
}
If we query all devices we get a valid json representation, thanks to the
__to_graphql(depth=x)
functionality.But when we map this json_data on the operation class we encountered the issue that the most nested data isn't mapped.
data = op + json_data
When debugging and going over it I noticed that all the data is mapped correctly. When looking at some imports used I see that there is some form of multithreading used. My suspicion is that there is some race condition or something when there is a lot of nested data that needs to be loaded.
In above example the returned data would be something like this:
[Device]
=> Without the resolutionSettings data in it, but this data is present in the json_data response
The text was updated successfully, but these errors were encountered: