-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: recognize immutable fields in lists #227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any tests of actually trying to update a MID with a model using @immutable
? The test in this PR is really just unit testing the parser rather than the actual user-visible behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, though I still think it'd be good for Paul to take a look.
Also CI is broken
expect(res2.errors![0].message).toEqual( | ||
`Variable "$i" got invalid value { title: "A different title" } at "i.content"; Field "title" is not defined by type "PartialPostInput". Did you mean "date"?`, | ||
) | ||
expect(res2.errors![1].message).toContain( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the idea of testing the immutable fields handling based on parsing GraphQL queries, this seems pretty fragile.
I think instead there should be a direct call to the Ceramic server trying to make an update to an immutable field and getting the matching error message, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. FYI I'll close this PR, rebasing from main didnt helped, but I created a new branch branch with the changes(missing this last change) and I'll ask for a review on the new one that doesnt seem to have the CI issue
Marking as draft until I fix the CI |
Ci fixed here: #228 |
025bec0
to
fd65109
Compare
Description
In the current version a field declared as
uniqueListValue: [Int] @list(maxLength: 5) @immutable
is not included in the ImmutableFields. This PR allows to identify these kinds of declarations.