You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my use-case I've got a few fairly large SelectionSets (>1 MB when serialized to string as part of a HTTP POST) and when I try an do a query that has six similarly large SelectionSets the UI entirely pauses for a few seconds. Having profiled this, it appears that the cause of this is the Graphql.Document.serializeQuery function.
Is there a way to do the query serialization in a way where it doesn't pause the UI? Alternatively, since the SelectionSet doesn't change in my case, is there a way to "cache" the serialized query and use it the next time rather than having to re-serialize it every time?
The text was updated successfully, but these errors were encountered:
I'd welcome a PR with performance optimizations to Graphql.Document.serializeQuery if you're interested in experimenting with that. There's a pretty robust test suite around it so there might be some low-hanging fruit there, and you can get a pretty good feedback cycle to experiment with things with those tests running.
Thanks for the reply, and (I should've mentioned this in the original comment) this wonderful graphql client library!
Using serializeQuery seems to do the trick, but while exploring that API I noticed that all the functions deal with RootQuery and RootMutation, and there isn't a way to serialize with placeholder GraphQL variables (eg. $ids). So, right now I still have to re-serialize when my variables change.
Is there a way to serialize SelectionSets with non-root Scopes? and, is there a way to specify GraphQL variables when serializing so I can reuse the resultant string with many different variables?
In my use-case I've got a few fairly large
SelectionSet
s (>1 MB when serialized to string as part of a HTTP POST) and when I try an do a query that has six similarly largeSelectionSet
s the UI entirely pauses for a few seconds. Having profiled this, it appears that the cause of this is the Graphql.Document.serializeQuery function.Is there a way to do the query serialization in a way where it doesn't pause the UI? Alternatively, since the
SelectionSet
doesn't change in my case, is there a way to "cache" the serialized query and use it the next time rather than having to re-serialize it every time?The text was updated successfully, but these errors were encountered: