-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Don't warn for missing resolvers #12734
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
Conversation
🦋 Changeset detectedLatest commit: 7df1890 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
size-limit report 📦
|
}); | ||
|
||
expect(read).toHaveBeenCalledTimes(1); | ||
expect(read).toHaveBeenCalledWith(null, expect.anything()); |
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 left this as null
instead of undefined
for a couple reasons:
- This ensures we have at least a value defined for the field in case a
read
function is not defined for the field. SinceLocalState
should work with any cache, we can't assume all caches implement something like aread
function for@client
fields so a default ofnull
provides a value for all situations. - Codegen becomes trickier because it doesn't have special type generation support for
@client
fields. The closest thing we have isavoidOptionals
, but that is all-or-nothing and we'd recommend having that enabled anyways. - This is something we can solve with documentation
null
instead of undefined
seemed acceptable given the downsides. I'm open to hearing otherwise, but wanted to point this out.
Fixes #12730
Remove the warning for a missing resolver when encountering an
@client
field that does not have a cache value. This is less confusing when@client
fields are managed byread
functions since local resolvers aren't required in order to use@client
fields.