-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use connections instead of array #435
Comments
|
|
Hopefully you have enough information to answer your questions now, @Nutelac, so I'm going to close this. Feel free to comment again if you still have doubts. I've published the content here over at Stack Overflow as it may prove useful to others in the future. |
For getting all edges on a connection, the workaround is to choose a big number for |
@jvliwanag This is an intentional restriction to prevent applications from fetching an entire connection with potentially thousands (or more) items. If you always plan to fetch all items a simple array may be more appropriate. |
First question: Is it good idea to use connections instead of array even when I don't need pagination (I need fetch all data all the time)? I want to do this thing because mutations performed with connections are easier than with arrays (e.g. creating or deleting).
Second question: How can I get all data from connections using Relay? When I do something like this in Relay fragment
I'm getting error
Error: Invariant Violation: readRelayQueryData(): The field 'roles' is a connection. Fields 'edges' and 'pageInfo' cannot be fetched without a 'first', 'last' or 'find' argument.
. I know that I need pass some arguments toroles
, but it's there any chance to get all data somehow?The text was updated successfully, but these errors were encountered: