Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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