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

Filed names cant end with number? #1330

Closed
yangit opened this issue Aug 10, 2016 · 5 comments
Closed

Filed names cant end with number? #1330

yangit opened this issue Aug 10, 2016 · 5 comments

Comments

@yangit
Copy link

yangit commented Aug 10, 2016

I will sound stupid but may this be a bug?
If name of the field ends(contains?) with a number than optimistic updates will not work.
Here is the stripped down repo to reproduce:
https://github.com/yangit/relayNumberBug

There are 2 branches which are different by one field name containing one extra symbol!
Here is the link to a diff

By looking at it could you guess why such a small change could break optimistic updates?

I have no errors in console in any case
I rebuild schema
I refresh my browser using hard refresh
I replace thisIsUniqueName using global project search
I knock my head against the wall

Any ideas?

@josephsavona
Copy link
Contributor

Tgat is super weird. Relay treats field names as opaque - it doesn't substring them or treat numbers in the field name specially (not on purpose, at least). Are you sure there's nothing else different, and that you've updated the schema appropriately with the right field names? Just checking to rule out obvious things.

@yangit
Copy link
Author

yangit commented Aug 10, 2016

I definitely rebuild schema. I get all sorts of errors if I forget.
I even embedded schema rebuild into npm start to avoid forgetting.

I'm not sure but I tried my best to eliminate all listed issues.
If you think I can try something else let me know.
BTW I can change name to any other unique name if it does not end with number.
Here is a link to non breaking change

@yangit
Copy link
Author

yangit commented Aug 10, 2016

Anyone mind doing npm install then npm start and looking at localhost:3000 in two different branches?
Detailed instructions are given here
I would deeply appreciate that.

@yangit
Copy link
Author

yangit commented Aug 10, 2016

Here is an example of what I see in debugger
_conversations3sn0Oo:conversations(first:1000)
That is for a field called conversations
That number 3 there is definitely added by Relay
Something to do with params?
Could that be a reason?

@wincent
Copy link
Contributor

wincent commented May 27, 2017

Relay Modern is now out so I am closing these old issues that pertain to the legacy core, because nobody is actively working on that anymore. Please file any new issues relevant to the new core separately. Thanks!

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

3 participants