Created
April 15, 2021 14:43
-
-
Save sibelius/52dce77405e7297dce34146fd334add7 to your computer and use it in GitHub Desktop.
Special missing field handlers to debug what fields are missing when using renderPolicy partial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MissingFieldHandler } from 'relay-runtime/lib/store/RelayStoreTypes'; | |
// missingFieldHandlers debug only | |
export const missingFieldHandlers: ReadonlyArray<MissingFieldHandler> = [ | |
{ | |
kind: 'scalar', | |
handle( | |
field, | |
record, | |
args, | |
store) { | |
// eslint-disable-next-line | |
console.log('missing scalar', { | |
field, | |
record, | |
args, | |
store, | |
}); | |
return undefined; | |
}, | |
}, | |
{ | |
kind: 'linked', | |
handle( | |
field, | |
record, | |
args, | |
store) { | |
// eslint-disable-next-line | |
console.log('missing linked', { | |
field, | |
record, | |
args, | |
store, | |
}); | |
return undefined; | |
}, | |
}, | |
{ | |
kind: 'pluralLinked', | |
handle( | |
field, | |
record, | |
args, | |
store) { | |
// eslint-disable-next-line | |
console.log('missing pluralLinked', { | |
field, | |
record, | |
args, | |
store, | |
}); | |
return undefined; | |
}, | |
}, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment