Created
October 23, 2019 02:20
-
-
Save helielson/101568a530eb68301ddb95ae03e58393 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const missingHandlerByRefConcreteTypeField: MissingFieldHandler = { | |
kind: 'linked', | |
handle(field, _, argValues) { | |
try { | |
const argsString = | |
field.args && field.args.length | |
? `{${field.args.map(a => `"${a.name}":"${argValues[a.name]}"`).join(',')}}` | |
: null; | |
const idValue = [field.concreteType, argsString].filter(v => !!v).join(':'); | |
return base64.encode(idValue); | |
} catch (e) { | |
// it wasn't be possible to transform the field ref | |
} | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment