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

Docs need to mention null usage for initialVariables #700

Closed
RavenHursT opened this issue Dec 22, 2015 · 2 comments
Closed

Docs need to mention null usage for initialVariables #700

RavenHursT opened this issue Dec 22, 2015 · 2 comments

Comments

@RavenHursT
Copy link

The docs for setting initialVariables for the Container API do not mention how to initialize unknown values for variables (i.e. The initial cursor value for pagination).

The correct way to initialize variables w/ an unknown value is to use null. It took over half a day of searching and asking before this answer was given to me:

http://stackoverflow.com/questions/34406667/relay-pagination-how-to-initialize-after-value/34407181#34407181

This should definitely be in the documentation for this feature.

@devknoll
Copy link
Contributor

@RavenHursT This is technically true, but I'm curious: why are you managing the after cursor yourself? Relay will automatically add the argument and its value when you change the first variable.

@RavenHursT
Copy link
Author

@devknoll : Server-side rendering.. if I go to www.mysite.com/widgets?pageNumber=5 then we need a way to initialize what will be rendered when using https://github.com/denvned/isomorphic-relay

@ghost ghost closed this as completed in 9ec5d79 Mar 3, 2016
venepe pushed a commit to venepe/relay that referenced this issue Mar 7, 2016
Summary:Added information in Container API docs for null usage in initialVariables. Fixes facebook#700
Closes facebook#701

Differential Revision: D3001979

Pulled By: yungsters

fb-gh-sync-id: ceaf7e4cf0f45ed4f354a041b6ab474b66d23eff
shipit-source-id: ceaf7e4cf0f45ed4f354a041b6ab474b66d23eff
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants