Created
August 14, 2023 14:09
-
-
Save bengrunfeld/5b0647b7496225d05d347d0ee6e0b36f to your computer and use it in GitHub Desktop.
Apollo Fragments - possibleTypes
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
var possibleTypes = schema.data.__schema.types | |
.filter(supertype => supertype.possibleTypes) | |
.reduce((all, supertype) => { | |
all[supertype.name] = supertype.possibleTypes.map(subtype => subtype.name); | |
return all; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment