How to use an enum when resolving an external key in a federated graph? #6491
Unanswered
SebBrookfield
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm not sure if this is a bug or not, but I'm struggling to use an enum as a key when resolving an external reference.
If I try to use the ResolveReferenceWith() extension, I find that the enum is defaulted to the default value.
Take the following example:
In the above example, the option passed to CreateExample is always "OptionA". If I change the type to String and don't update the supergraph schema, it works. (But I can't now compile the supergraph because the types don't match anymore)
My way around this at the moment is to access the LocalContextData["data"] and manually parse the enum.
I'm assuming this is to do with the fact that it's a string value being passed to the subgraph.
I've tried using a EnumType class, but this doesn't seem to do anything.
Could anyone help at all?
Hopefully this is clear.
Beta Was this translation helpful? Give feedback.
All reactions